stream

package
v1.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Package stream contains the Stream object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnDataFunc added in v1.15.2

type OnDataFunc func(*unit.Unit) error

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

func (r *Reader) Error() chan error

error returns whenever there's an error. It can be called only after stream.AddReader().

func (*Reader) Formats added in v1.15.2

func (r *Reader) Formats() []format.Format

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

func (r *Reader) OutboundFramesDiscarded() uint64

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) AddReader

func (s *Stream) AddReader(r *Reader)

AddReader adds a reader. Used by all protocols except RTSP.

func (*Stream) Close

func (s *Stream) Close()

Close closes all resources of the stream.

func (*Stream) InboundBytes added in v1.17.0

func (s *Stream) InboundBytes() uint64

InboundBytes returns received bytes.

func (*Stream) InboundFramesInError added in v1.17.0

func (s *Stream) InboundFramesInError() uint64

InboundFramesInError returns the number of frames received with processing errors.

func (*Stream) Initialize added in v1.12.0

func (s *Stream) Initialize() error

Initialize initializes a Stream.

func (*Stream) OutboundBytes added in v1.17.0

func (s *Stream) OutboundBytes() uint64

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

func (s *Stream) RemoveReader(r *Reader)

RemoveReader removes a reader. Used by all protocols except RTSP.

func (*Stream) StartOfflineSubStream added in v1.16.0

func (s *Stream) StartOfflineSubStream() error

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

func (ss *SubStream) Initialize() error

Initialize initializes the SubStream.

func (*SubStream) WriteUnit added in v1.16.0

func (ss *SubStream) WriteUnit(medi *description.Media, forma format.Format, u *unit.Unit)

WriteUnit writes a Unit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL