Versions in this module Expand all Collapse all v1 v1.3.0 Nov 30, 2022 Changes in this version + const DefaultMaxLayerSpatial + const DefaultMaxLayerTemporal + const FirstSnapshotId + const FullResolution + const GapHistogramNumBins + const HalfResolution + const InvalidLayerSpatial + const InvalidLayerTemporal + const NumSequenceNumbers + const QuarterResolution + const ReportDelta + const SnInfoMask + const SnInfoSize + var InvalidLayers = VideoLayer + func AggregateRTPStats(statsList []*livekit.RTPStats) *livekit.RTPStats + func IsAV1Keyframe(payload []byte) bool + func IsH264Keyframe(payload []byte) bool + func LayerPresenceFromTrackInfo(trackInfo *livekit.TrackInfo) *[livekit.VideoQuality_HIGH + 1]bool + func RidToSpatialLayer(rid string, trackInfo *livekit.TrackInfo) int32 + func SpatialLayerToRid(layer int32, trackInfo *livekit.TrackInfo) string + func SpatialLayerToVideoQuality(layer int32, trackInfo *livekit.TrackInfo) livekit.VideoQuality + func VP8PictureIdSizeDiff(mBit1 bool, mBit2 bool) int + func VideoQualityToRid(quality livekit.VideoQuality, trackInfo *livekit.TrackInfo) string + func VideoQualityToSpatialLayer(quality livekit.VideoQuality, trackInfo *livekit.TrackInfo) int32 + type Buffer struct + func NewBuffer(ssrc uint32, vp, ap *sync.Pool) *Buffer + func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapability) + func (b *Buffer) Close() error + func (b *Buffer) GetAudioLevel() (float64, bool) + func (b *Buffer) GetClockRate() uint32 + func (b *Buffer) GetDeltaStats() *StreamStatsWithLayers + func (b *Buffer) GetMediaSSRC() uint32 + func (b *Buffer) GetPacket(buff []byte, sn uint16) (int, error) + func (b *Buffer) GetStats() *livekit.RTPStats + func (b *Buffer) GetTemporalLayerFpsForSpatial(layer int32) []float32 + func (b *Buffer) OnClose(fn func()) + func (b *Buffer) OnFpsChanged(f func()) + func (b *Buffer) OnMaxLayerChanged(fn func(int32, int32)) + func (b *Buffer) OnRtcpFeedback(fn func(fb []rtcp.Packet)) + func (b *Buffer) Read(buff []byte) (n int, err error) + func (b *Buffer) ReadExtended() (*ExtPacket, error) + func (b *Buffer) SendPLI(force bool) + func (b *Buffer) SetAudioLevelParams(audioLevelParams audio.AudioLevelParams) + func (b *Buffer) SetLastFractionLostReport(lost uint8) + func (b *Buffer) SetLogger(logger logger.Logger) + func (b *Buffer) SetPLIThrottle(duration int64) + func (b *Buffer) SetRTT(rtt uint32) + func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64) + func (b *Buffer) SetTWCC(twcc *twcc.Responder) + func (b *Buffer) Write(pkt []byte) (n int, err error) + type DataStats struct + func NewDataStats(params DataStatsParam) *DataStats + func (s *DataStats) Stop() + func (s *DataStats) ToProtoActive() *livekit.RTPStats + func (s *DataStats) ToProtoAggregateOnly() *livekit.RTPStats + func (s *DataStats) Update(bytes int, time int64) + type DataStatsParam struct + WindowDuration time.Duration + type DependencyDescriptorParser struct + func NewDependencyDescriptorParser(ddExt uint8, logger logger.Logger, onMaxLayerChanged func(int32, int32)) *DependencyDescriptorParser + func (r *DependencyDescriptorParser) Parse(pkt *rtp.Packet) (*dd.DependencyDescriptor, VideoLayer, error) + type ExtPacket struct + Arrival int64 + DependencyDescriptor *dd.DependencyDescriptor + KeyFrame bool + Packet *rtp.Packet + Payload interface{} + RawPacket []byte + type Factory struct + func NewBufferFactory(trackingPackets int) *Factory + func (f *Factory) GetBuffer(ssrc uint32) *Buffer + func (f *Factory) GetBufferPair(ssrc uint32) (*Buffer, *RTCPReader) + func (f *Factory) GetOrNew(packetType packetio.BufferPacketType, ssrc uint32) io.ReadWriteCloser + func (f *Factory) GetRTCPReader(ssrc uint32) *RTCPReader + type FrameRateCalculator interface + Completed func() bool + GetFrameRate func() []float32 + RecvPacket func(ep *ExtPacket) bool + type FrameRateCalculatorDD struct + func NewFrameRateCalculatorDD(clockRate uint32, logger logger.Logger) *FrameRateCalculatorDD + func (f *FrameRateCalculatorDD) Completed() bool + func (f *FrameRateCalculatorDD) GetFrameRateCalculatorForSpatial(spatial int32) *FrameRateCalculatorForDDLayer + func (f *FrameRateCalculatorDD) GetFrameRateForSpatial(spatial int32) []float32 + func (f *FrameRateCalculatorDD) RecvPacket(ep *ExtPacket) bool + func (f *FrameRateCalculatorDD) SetMaxLayer(spatial, temporal int32) + type FrameRateCalculatorForDDLayer struct + func (f *FrameRateCalculatorForDDLayer) GetFrameRate() []float32 + type FrameRateCalculatorVP8 struct + func NewFrameRateCalculatorVP8(clockRate uint32, logger logger.Logger) *FrameRateCalculatorVP8 + func (f *FrameRateCalculatorVP8) Completed() bool + func (f *FrameRateCalculatorVP8) GetFrameRate() []float32 + func (f *FrameRateCalculatorVP8) RecvPacket(ep *ExtPacket) bool + type IntervalStats struct + type Options struct + MaxBitRate uint64 + type RTCPReader struct + func NewRTCPReader(ssrc uint32) *RTCPReader + func (r *RTCPReader) Close() error + func (r *RTCPReader) OnClose(fn func()) + func (r *RTCPReader) OnPacket(f func([]byte)) + func (r *RTCPReader) Read(_ []byte) (n int, err error) + func (r *RTCPReader) Write(p []byte) (n int, err error) + type RTPDeltaInfo struct + Bytes uint64 + BytesDuplicate uint64 + BytesPadding uint64 + Duration time.Duration + Firs uint32 + Frames uint32 + HeaderBytes uint64 + HeaderBytesDuplicate uint64 + HeaderBytesPadding uint64 + JitterMax float64 + Nacks uint32 + Packets uint32 + PacketsDuplicate uint32 + PacketsLost uint32 + PacketsPadding uint32 + Plis uint32 + RttMax uint32 + type RTPFlowState struct + HasLoss bool + LossEndExclusive uint16 + LossStartInclusive uint16 + type RTPStats struct + func NewRTPStats(params RTPStatsParams) *RTPStats + func (r *RTPStats) DeltaInfo(snapshotId uint32) *RTPDeltaInfo + func (r *RTPStats) GetRtcpSenderReport(ssrc uint32) *rtcp.SenderReport + func (r *RTPStats) GetRtt() uint32 + func (r *RTPStats) GetTotalPacketsPrimary() uint32 + func (r *RTPStats) IsActive() bool + func (r *RTPStats) LastPli() time.Time + func (r *RTPStats) NewSnapshotId() uint32 + func (r *RTPStats) ResyncOnNextPacket() + func (r *RTPStats) Seed(from *RTPStats) + func (r *RTPStats) SetLogger(logger logger.Logger) + func (r *RTPStats) SetRtcpSenderReportData(rtpTS uint32, ntpTS mediatransportutil.NtpTime, arrival time.Time) + func (r *RTPStats) SnapshotRtcpReceptionReport(ssrc uint32, proxyFracLost uint8, snapshotId uint32) *rtcp.ReceptionReport + func (r *RTPStats) Stop() + func (r *RTPStats) TimeSinceLastPli() int64 + func (r *RTPStats) ToProto() *livekit.RTPStats + func (r *RTPStats) ToString() string + func (r *RTPStats) Update(rtph *rtp.Header, payloadSize int, paddingSize int, packetTime int64) (flowState RTPFlowState) + func (r *RTPStats) UpdateFir(firCount uint32) + func (r *RTPStats) UpdateFirTime() + func (r *RTPStats) UpdateFromReceiverReport(rr rtcp.ReceptionReport, rtt uint32) + func (r *RTPStats) UpdateKeyFrame(kfCount uint32) + func (r *RTPStats) UpdateLayerLockPliAndTime(pliCount uint32) + func (r *RTPStats) UpdateNack(nackCount uint32) + func (r *RTPStats) UpdateNackProcessed(nackAckCount uint32, nackMissCount uint32, nackRepeatedCount uint32) + func (r *RTPStats) UpdatePli(pliCount uint32) + func (r *RTPStats) UpdatePliAndTime(pliCount uint32) + func (r *RTPStats) UpdatePliTime() + func (r *RTPStats) UpdateRtt(rtt uint32) + type RTPStatsParams struct + ClockRate uint32 + IsReceiverReportDriven bool + Logger logger.Logger + type SnInfo struct + type Snapshot struct + type StreamStatsWithLayers struct + Layers map[int32]*RTPDeltaInfo + RTPStats *RTPDeltaInfo + type VP8 struct + FirstByte byte + HeaderSize int + IsKeyFrame bool + KEYIDX uint8 + KEYIDXPresent int + MBit bool + PictureID uint16 + PictureIDPresent int + TID uint8 + TIDPresent int + TL0PICIDX uint8 + TL0PICIDXPresent int + Y uint8 + func (v *VP8) MarshalTo(buf []byte) error + func (v *VP8) Unmarshal(payload []byte) error + type VideoLayer struct + Spatial int32 + Temporal int32 + func (v VideoLayer) GreaterThan(v2 VideoLayer) bool + func (v VideoLayer) IsValid() bool + func (v VideoLayer) SpatialGreaterThanOrEqual(v2 VideoLayer) bool + func (v VideoLayer) String() string