buffer

package
v1.8.2-0...-8e26108 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLaterTimestamp

func IsLaterTimestamp(timestamp1 uint32, timestamp2 uint32) bool

IsLaterTimestamp returns true if timestamp1 is later in time than timestamp2 factoring in timestamp wrap-around

func IsTimestampWrapAround

func IsTimestampWrapAround(timestamp1 uint32, timestamp2 uint32) bool

IsTimestampWrapAround returns true if wrap around happens from timestamp1 to timestamp2

Types

type Bucket

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

func NewBucket

func NewBucket(buf []byte, nack bool) *Bucket

type Buffer

type Buffer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Buffer contains all packets

func NewBuffer

func NewBuffer(ssrc uint32, vp, ap *sync.Pool) *Buffer

NewBuffer constructs a new Buffer

func (*Buffer) Bind

func (b *Buffer) Bind(params webrtc.RTPParameters, o Options)

func (*Buffer) Close

func (b *Buffer) Close() error

func (*Buffer) GetClockRate

func (b *Buffer) GetClockRate() uint32

GetClockRate returns the RTP clock rate

func (*Buffer) GetLatestTimestamp

func (b *Buffer) GetLatestTimestamp() (latestTimestamp uint32, latestTimestampTimeInNanosSinceEpoch int64)

GetLatestTimestamp returns the latest RTP timestamp factoring in potential RTP timestamp wrap-around

func (*Buffer) GetMediaSSRC

func (b *Buffer) GetMediaSSRC() uint32

GetMediaSSRC returns the associated SSRC of the RTP stream

func (*Buffer) GetPacket

func (b *Buffer) GetPacket(buff []byte, sn uint16) (int, error)

func (*Buffer) GetSenderReportData

func (b *Buffer) GetSenderReportData() (rtpTime uint32, ntpTime uint64, lastReceivedTimeInNanosSinceEpoch int64)

GetSenderReportData returns the rtp, ntp and nanos of the last sender report

func (*Buffer) GetStats

func (b *Buffer) GetStats() (stats Stats)

GetStats returns the raw statistics about a particular buffer state

func (*Buffer) OnClose

func (b *Buffer) OnClose(fn func())

func (*Buffer) OnFeedback

func (b *Buffer) OnFeedback(fn func(fb []rtcp.Packet))

func (*Buffer) OnTransportWideCC

func (b *Buffer) OnTransportWideCC(fn func(sn uint16, timeNS int64, marker bool))

func (*Buffer) PacketChan

func (b *Buffer) PacketChan() chan rtp.Packet

func (*Buffer) Read

func (b *Buffer) Read(buff []byte) (n int, err error)

func (*Buffer) SetSenderReportData

func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64)

func (*Buffer) Write

func (b *Buffer) Write(pkt []byte) (n int, err error)

Write adds a RTP Packet, out of order, new packet may be arrived later

type Factory

type Factory struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewBufferFactory

func NewBufferFactory() *Factory

func (*Factory) GetBuffer

func (f *Factory) GetBuffer(ssrc uint32) *Buffer

func (*Factory) GetBufferPair

func (f *Factory) GetBufferPair(ssrc uint32) (*Buffer, *RTCPReader)

func (*Factory) GetOrNew

func (f *Factory) GetOrNew(packetType packetio.BufferPacketType, ssrc uint32) io.ReadWriteCloser

func (*Factory) GetRTCPReader

func (f *Factory) GetRTCPReader(ssrc uint32) *RTCPReader

type Options

type Options struct {
	BufferTime int
	MaxBitRate uint64
}

BufferOptions provides configuration options for the buffer

type RTCPReader

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

func NewRTCPReader

func NewRTCPReader(ssrc uint32) *RTCPReader

func (*RTCPReader) Close

func (r *RTCPReader) Close() error

func (*RTCPReader) OnClose

func (r *RTCPReader) OnClose(fn func())

func (*RTCPReader) OnPacket

func (r *RTCPReader) OnPacket(f func([]byte))

func (*RTCPReader) Read

func (r *RTCPReader) Read(_ []byte) (n int, err error)

func (*RTCPReader) Write

func (r *RTCPReader) Write(p []byte) (n int, err error)

type Stats

type Stats struct {
	LastExpected uint32
	LastReceived uint32
	LostRate     float32
	PacketCount  uint32  // Number of packets received from this source.
	Jitter       float64 // An estimate of the statistical variance of the RTP data packet inter-arrival time.
	TotalByte    uint64
}

Jump to

Keyboard shortcuts

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