stream

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 13 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 ReadFunc added in v1.6.0

type ReadFunc func(unit.Unit) error

ReadFunc is the callback passed to AddReader().

type Reader added in v1.9.2

type Reader interface {
	logger.Writer
}

Reader is a stream reader.

type Stream

type Stream struct {
	WriteQueueSize     int
	RTPMaxPayloadSize  int
	Desc               *description.Session
	GenerateRTPPackets 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, converting it when needed.

func (*Stream) AddReader

func (s *Stream) AddReader(reader Reader, medi *description.Media, forma format.Format, cb ReadFunc)

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

func (*Stream) BytesReceived added in v1.1.0

func (s *Stream) BytesReceived() uint64

BytesReceived returns received bytes.

func (*Stream) BytesSent added in v1.3.0

func (s *Stream) BytesSent() uint64

BytesSent returns sent bytes.

func (*Stream) Close

func (s *Stream) Close()

Close closes all resources of the stream.

func (*Stream) Initialize added in v1.12.0

func (s *Stream) Initialize() error

Initialize initializes a Stream.

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) ReaderError added in v1.9.2

func (s *Stream) ReaderError(reader Reader) chan error

ReaderError returns whenever there's an error.

func (*Stream) ReaderFormats added in v1.9.2

func (s *Stream) ReaderFormats(reader Reader) []format.Format

ReaderFormats returns all formats that a reader is reading.

func (*Stream) RemoveReader

func (s *Stream) RemoveReader(reader Reader)

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

func (*Stream) StartReader added in v1.9.2

func (s *Stream) StartReader(reader Reader)

StartReader starts a reader. Used by all protocols except RTSP.

func (*Stream) WaitRunningReader added in v1.9.2

func (s *Stream) WaitRunningReader()

WaitRunningReader waits for a running reader.

func (*Stream) WriteRTPPacket

func (s *Stream) WriteRTPPacket(
	medi *description.Media,
	forma format.Format,
	pkt *rtp.Packet,
	ntp time.Time,
	pts int64,
)

WriteRTPPacket writes a RTP packet.

func (*Stream) WriteUnit

func (s *Stream) 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