Documentation
¶
Overview ¶
Package stream contains the Stream object.
Index ¶
- type OnDataFunc
- type Reader
- type Stream
- func (s *Stream) AddReader(r *Reader)
- func (s *Stream) Close()
- func (s *Stream) InboundBytes() uint64
- func (s *Stream) InboundFramesInError() uint64
- func (s *Stream) Initialize() error
- func (s *Stream) OutboundBytes() uint64
- func (s *Stream) RTSPSStream(server *gortsplib.Server) *gortsplib.ServerStream
- func (s *Stream) RTSPStream(server *gortsplib.Server) *gortsplib.ServerStream
- func (s *Stream) RemoveReader(r *Reader)
- func (s *Stream) StartOfflineSubStream() error
- func (s *Stream) WaitForReaders()
- type SubStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnDataFunc ¶ added in v1.15.2
OnDataFunc is the callback passed to OnData().
type Reader ¶ added in v1.9.2
type Reader struct {
SkipOutboundBytes bool
Parent logger.Writer
// contains filtered or unexported fields
}
Reader is a stream reader.
func (*Reader) Error ¶ added in v1.15.2
error returns whenever there's an error. It can be called only after stream.AddReader().
func (*Reader) Formats ¶ added in v1.15.2
Formats returns all formats for which the reader has registered a OnData callback.
func (*Reader) OnData ¶ added in v1.15.2
func (r *Reader) OnData(medi *description.Media, forma format.Format, cb OnDataFunc)
OnData registers a callback that is called when data from given format is available.
func (*Reader) OutboundFramesDiscarded ¶ added in v1.17.0
OutboundFramesDiscarded returns the number of frames discarded because the reader is too slow.
type Stream ¶
type Stream struct {
Desc *description.Session
AlwaysAvailable bool
AlwaysAvailableTracks []conf.AlwaysAvailableTrack
AlwaysAvailableFile string
WriteQueueSize int
RTPMaxPayloadSize int
ReplaceNTP bool
Parent logger.Writer
// contains filtered or unexported fields
}
Stream is a media stream. It stores tracks, readers and allows to write data to readers, remuxing it when needed.
func (*Stream) InboundBytes ¶ added in v1.17.0
InboundBytes returns received bytes.
func (*Stream) InboundFramesInError ¶ added in v1.17.0
InboundFramesInError returns the number of frames received with processing errors.
func (*Stream) Initialize ¶ added in v1.12.0
Initialize initializes a Stream.
func (*Stream) OutboundBytes ¶ added in v1.17.0
OutboundBytes returns sent bytes.
func (*Stream) RTSPSStream ¶ added in v1.0.1
func (s *Stream) RTSPSStream(server *gortsplib.Server) *gortsplib.ServerStream
RTSPSStream returns the RTSPS stream.
func (*Stream) RTSPStream ¶
func (s *Stream) RTSPStream(server *gortsplib.Server) *gortsplib.ServerStream
RTSPStream returns the RTSP stream.
func (*Stream) RemoveReader ¶
RemoveReader removes a reader. Used by all protocols except RTSP.
func (*Stream) StartOfflineSubStream ¶ added in v1.16.0
StartOfflineSubStream starts the offline substream.
func (*Stream) WaitForReaders ¶ added in v1.16.0
func (s *Stream) WaitForReaders()
WaitForReaders waits for the stream to have at least one reader.
type SubStream ¶ added in v1.16.0
type SubStream struct {
Stream *Stream
CurDesc *description.Session
UseRTPPackets bool
// contains filtered or unexported fields
}
SubStream is a Stream without interruptions.
func (*SubStream) Initialize ¶ added in v1.16.0
Initialize initializes the SubStream.