stream

package
v0.0.0-...-0558441 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 10 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 Stream

type Stream struct {
	// contains filtered or unexported fields
}

Stream is a media stream. It stores tracks, readers and allow to write data to readers.

func New

func New(
	udpMaxPayloadSize int,
	medias media.Medias,
	generateRTPPackets bool,
	bytesReceived *uint64,
	source logger.Writer,
) (*Stream, error)

New allocates a Stream.

func (*Stream) AddReader

func (s *Stream) AddReader(r interface{}, medi *media.Media, forma formats.Format, cb func(unit.Unit))

AddReader adds a reader.

func (*Stream) Close

func (s *Stream) Close()

Close closes all resources of the stream.

func (*Stream) Medias

func (s *Stream) Medias() media.Medias

Medias returns medias of the stream.

func (*Stream) RTSPStream

func (s *Stream) RTSPStream() *gortsplib.ServerStream

RTSPStream returns the RTSP stream.

func (*Stream) RemoveReader

func (s *Stream) RemoveReader(r interface{})

RemoveReader removes a reader.

func (*Stream) WriteRTPPacket

func (s *Stream) WriteRTPPacket(medi *media.Media, forma formats.Format, pkt *rtp.Packet, ntp time.Time)

WriteRTPPacket writes a RTP packet.

func (*Stream) WriteUnit

func (s *Stream) WriteUnit(medi *media.Media, forma formats.Format, data unit.Unit)

WriteUnit writes a Unit.

Jump to

Keyboard shortcuts

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