Documentation ¶
Index ¶
- Constants
- Variables
- func AggregateRTPStats(statsList []*livekit.RTPStats) *livekit.RTPStats
- func GetActiveDecodeTargetBitmask(layer VideoLayer, decodeTargets []DependencyDescriptorDecodeTarget) *uint32
- func IsAV1KeyFrame(payload []byte) bool
- func IsH264KeyFrame(payload []byte) bool
- func IsVP9KeyFrame(payload []byte) bool
- func LayerPresenceFromTrackInfo(trackInfo *livekit.TrackInfo) *[livekit.VideoQuality_HIGH + 1]bool
- func RTPDriftToString(r *livekit.RTPDrift) string
- 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 VPxPictureIdSizeDiff(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
- 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) GetSenderReportData() (*RTCPSenderReportData, *RTCPSenderReportData)
- func (b *Buffer) GetStats() *livekit.RTPStats
- func (b *Buffer) GetTemporalLayerFpsForSpatial(layer int32) []float32
- func (b *Buffer) OnClose(fn func())
- func (b *Buffer) OnFinalRtpStats(fn func(*livekit.RTPStats))
- func (b *Buffer) OnFpsChanged(f func())
- func (b *Buffer) OnRtcpFeedback(fn func(fb []rtcp.Packet))
- func (b *Buffer) OnRtcpSenderReport(fn func())
- func (b *Buffer) Read(buff []byte) (n int, err error)
- func (b *Buffer) ReadExtended(buf []byte) (*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) SetPaused(paused bool)
- 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
- type DataStatsParam
- type DependencyDescriptorDecodeTarget
- type DependencyDescriptorParser
- type ExtDependencyDescriptor
- type ExtPacket
- type Factory
- type FactoryOfBufferFactory
- type FrameEntity
- type FrameIntegrityChecker
- type FrameRateCalculator
- type 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
- type FrameRateCalculatorForVP9Layer
- type FrameRateCalculatorVP8
- type FrameRateCalculatorVP9
- func (f *FrameRateCalculatorVP9) Completed() bool
- func (f *FrameRateCalculatorVP9) GetFrameRateCalculatorForSpatial(spatial int32) *FrameRateCalculatorForVP9Layer
- func (f *FrameRateCalculatorVP9) GetFrameRateForSpatial(spatial int32) []float32
- func (f *FrameRateCalculatorVP9) RecvPacket(ep *ExtPacket) bool
- type PacketHistory
- type RTCPReader
- type RTCPSenderReportData
- type RTPDeltaInfo
- type RTPFlowState
- type RTPStatsParams
- type RTPStatsReceiver
- func (r *RTPStatsReceiver) DeltaInfo(snapshotID uint32) *RTPDeltaInfo
- func (r *RTPStatsReceiver) GetRtcpReceptionReport(ssrc uint32, proxyFracLost uint8, snapshotID uint32) *rtcp.ReceptionReport
- func (r *RTPStatsReceiver) GetRtcpSenderReportData() (srFirst *RTCPSenderReportData, srNewest *RTCPSenderReportData)
- func (r RTPStatsReceiver) GetRtt() uint32
- func (r RTPStatsReceiver) IsActive() bool
- func (r RTPStatsReceiver) LastPli() time.Time
- func (r *RTPStatsReceiver) NewSnapshotId() uint32
- func (r RTPStatsReceiver) SetLogger(logger logger.Logger)
- func (r *RTPStatsReceiver) SetRtcpSenderReportData(srData *RTCPSenderReportData)
- func (r RTPStatsReceiver) Stop()
- func (r *RTPStatsReceiver) String() string
- func (r RTPStatsReceiver) TimeSinceLastPli() int64
- func (r *RTPStatsReceiver) ToProto() *livekit.RTPStats
- func (r *RTPStatsReceiver) Update(packetTime time.Time, sequenceNumber uint16, timestamp uint32, marker bool, ...) (flowState RTPFlowState)
- func (r RTPStatsReceiver) UpdateFir(firCount uint32)
- func (r RTPStatsReceiver) UpdateFirTime()
- func (r RTPStatsReceiver) UpdateKeyFrame(kfCount uint32)
- func (r RTPStatsReceiver) UpdateLayerLockPliAndTime(pliCount uint32)
- func (r RTPStatsReceiver) UpdateNack(nackCount uint32)
- func (r RTPStatsReceiver) UpdateNackProcessed(nackAckCount uint32, nackMissCount uint32, nackRepeatedCount uint32)
- func (r RTPStatsReceiver) UpdatePli(pliCount uint32)
- func (r RTPStatsReceiver) UpdatePliAndTime(pliCount uint32)
- func (r RTPStatsReceiver) UpdatePliTime()
- func (r RTPStatsReceiver) UpdateRtt(rtt uint32)
- type RTPStatsSender
- func (r *RTPStatsSender) DeltaInfo(snapshotID uint32) *RTPDeltaInfo
- func (r *RTPStatsSender) DeltaInfoSender(senderSnapshotID uint32) *RTPDeltaInfo
- func (r *RTPStatsSender) GetExpectedRTPTimestamp(at time.Time) (expectedTSExt uint64, err error)
- func (r *RTPStatsSender) GetRtcpSenderReport(ssrc uint32, calculatedClockRate uint32) *rtcp.SenderReport
- func (r RTPStatsSender) GetRtt() uint32
- func (r *RTPStatsSender) GetTotalPacketsPrimary() uint64
- func (r RTPStatsSender) IsActive() bool
- func (r RTPStatsSender) LastPli() time.Time
- func (r *RTPStatsSender) LastReceiverReportTime() time.Time
- func (r *RTPStatsSender) MaybeAdjustFirstPacketTime(ts uint32)
- func (r *RTPStatsSender) NewSenderSnapshotId() uint32
- func (r *RTPStatsSender) NewSnapshotId() uint32
- func (r *RTPStatsSender) Seed(from *RTPStatsSender)
- func (r RTPStatsSender) SetLogger(logger logger.Logger)
- func (r RTPStatsSender) Stop()
- func (r *RTPStatsSender) String() string
- func (r RTPStatsSender) TimeSinceLastPli() int64
- func (r *RTPStatsSender) ToProto() *livekit.RTPStats
- func (r *RTPStatsSender) Update(packetTime time.Time, extSequenceNumber uint64, extTimestamp uint64, ...)
- func (r RTPStatsSender) UpdateFir(firCount uint32)
- func (r RTPStatsSender) UpdateFirTime()
- func (r *RTPStatsSender) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt uint32, isRttChanged bool)
- func (r RTPStatsSender) UpdateKeyFrame(kfCount uint32)
- func (r RTPStatsSender) UpdateLayerLockPliAndTime(pliCount uint32)
- func (r RTPStatsSender) UpdateNack(nackCount uint32)
- func (r RTPStatsSender) UpdateNackProcessed(nackAckCount uint32, nackMissCount uint32, nackRepeatedCount uint32)
- func (r RTPStatsSender) UpdatePli(pliCount uint32)
- func (r RTPStatsSender) UpdatePliAndTime(pliCount uint32)
- func (r RTPStatsSender) UpdatePliTime()
- func (r RTPStatsSender) UpdateRtt(rtt uint32)
- type StreamStatsWithLayers
- type VP8
- type VideoLayer
Constants ¶
const ( InvalidLayerSpatial = int32(-1) InvalidLayerTemporal = int32(-1) DefaultMaxLayerSpatial = int32(2) DefaultMaxLayerTemporal = int32(3) )
const ( QuarterResolution = "q" HalfResolution = "h" FullResolution = "f" )
const (
ReportDelta = time.Second
)
Variables ¶
var ( ErrFrameEarlierThanKeyFrame = fmt.Errorf("frame is earlier than current keyframe") ErrDDStructureAttachedToNonFirstPacket = fmt.Errorf("dependency descriptor structure is attached to non-first packet of a frame") )
var ( InvalidLayer = VideoLayer{ Spatial: InvalidLayerSpatial, Temporal: InvalidLayerTemporal, } DefaultMaxLayer = VideoLayer{ Spatial: DefaultMaxLayerSpatial, Temporal: DefaultMaxLayerTemporal, } )
Functions ¶
func GetActiveDecodeTargetBitmask ¶
func GetActiveDecodeTargetBitmask(layer VideoLayer, decodeTargets []DependencyDescriptorDecodeTarget) *uint32
func IsAV1KeyFrame ¶
IsAV1KeyFrame detects if av1 payload is a keyframe taken from https://github.com/jech/galene/blob/master/codecs/codecs.go all credits belongs to Juliusz Chroboczek @jech and the awesome Galene SFU
func IsH264KeyFrame ¶
IsH264KeyFrame detects if h264 payload is a keyframe this code was taken from https://github.com/jech/galene/blob/codecs/rtpconn/rtpreader.go#L45 all credits belongs to Juliusz Chroboczek @jech and the awesome Galene SFU
func IsVP9KeyFrame ¶
IsVP9KeyFrame detects if vp9 payload is a keyframe taken from https://github.com/jech/galene/blob/master/codecs/codecs.go all credits belongs to Juliusz Chroboczek @jech and the awesome Galene SFU
func LayerPresenceFromTrackInfo ¶
func LayerPresenceFromTrackInfo(trackInfo *livekit.TrackInfo) *[livekit.VideoQuality_HIGH + 1]bool
SIMULCAST-CODEC-TODO: these need to be codec mime aware if and when each codec suppports different layers
func RTPDriftToString ¶
func SpatialLayerToVideoQuality ¶
func SpatialLayerToVideoQuality(layer int32, trackInfo *livekit.TrackInfo) livekit.VideoQuality
func VPxPictureIdSizeDiff ¶
func VideoQualityToRid ¶
func VideoQualityToRid(quality livekit.VideoQuality, trackInfo *livekit.TrackInfo) string
func VideoQualityToSpatialLayer ¶
func VideoQualityToSpatialLayer(quality livekit.VideoQuality, trackInfo *livekit.TrackInfo) int32
Types ¶
type Buffer ¶
Buffer contains all packets
func (*Buffer) Bind ¶
func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapability)
func (*Buffer) GetAudioLevel ¶
func (*Buffer) GetClockRate ¶
GetClockRate returns the RTP clock rate
func (*Buffer) GetDeltaStats ¶
func (b *Buffer) GetDeltaStats() *StreamStatsWithLayers
func (*Buffer) GetMediaSSRC ¶
GetMediaSSRC returns the associated SSRC of the RTP stream
func (*Buffer) GetSenderReportData ¶
func (b *Buffer) GetSenderReportData() (*RTCPSenderReportData, *RTCPSenderReportData)
func (*Buffer) GetTemporalLayerFpsForSpatial ¶
func (*Buffer) OnFinalRtpStats ¶
func (*Buffer) OnFpsChanged ¶
func (b *Buffer) OnFpsChanged(f func())
func (*Buffer) OnRtcpFeedback ¶
func (*Buffer) OnRtcpSenderReport ¶
func (b *Buffer) OnRtcpSenderReport(fn func())
func (*Buffer) SetAudioLevelParams ¶
func (b *Buffer) SetAudioLevelParams(audioLevelParams audio.AudioLevelParams)
func (*Buffer) SetLastFractionLostReport ¶
func (*Buffer) SetPLIThrottle ¶
func (*Buffer) SetSenderReportData ¶
type DataStats ¶
type DataStats struct {
// contains filtered or unexported fields
}
func NewDataStats ¶
func NewDataStats(params DataStatsParam) *DataStats
func (*DataStats) ToProtoActive ¶
func (*DataStats) ToProtoAggregateOnly ¶
type DataStatsParam ¶
type DependencyDescriptorDecodeTarget ¶
type DependencyDescriptorDecodeTarget struct { Target int Layer VideoLayer }
func ProcessFrameDependencyStructure ¶
func ProcessFrameDependencyStructure(structure *dd.FrameDependencyStructure) []DependencyDescriptorDecodeTarget
func (*DependencyDescriptorDecodeTarget) String ¶
func (dt *DependencyDescriptorDecodeTarget) String() string
type DependencyDescriptorParser ¶
type DependencyDescriptorParser struct {
// contains filtered or unexported fields
}
func (*DependencyDescriptorParser) Parse ¶
func (r *DependencyDescriptorParser) Parse(pkt *rtp.Packet) (*ExtDependencyDescriptor, VideoLayer, error)
type ExtDependencyDescriptor ¶
type ExtDependencyDescriptor struct { Descriptor *dd.DependencyDescriptor DecodeTargets []DependencyDescriptorDecodeTarget StructureUpdated bool ActiveDecodeTargetsUpdated bool Integrity bool ExtFrameNum uint64 // the frame number of the keyframe which the current frame depends on ExtKeyFrameNum uint64 }
type ExtPacket ¶
type ExtPacket struct { VideoLayer Arrival time.Time ExtSequenceNumber uint64 ExtTimestamp uint64 Packet *rtp.Packet Payload interface{} KeyFrame bool RawPacket []byte DependencyDescriptor *ExtDependencyDescriptor }
type Factory ¶
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 FactoryOfBufferFactory ¶
type FactoryOfBufferFactory struct {
// contains filtered or unexported fields
}
func NewFactoryOfBufferFactory ¶
func NewFactoryOfBufferFactory(trackingPackets int) *FactoryOfBufferFactory
func (*FactoryOfBufferFactory) CreateBufferFactory ¶
func (f *FactoryOfBufferFactory) CreateBufferFactory() *Factory
type FrameEntity ¶
type FrameEntity struct {
// contains filtered or unexported fields
}
func (*FrameEntity) AddPacket ¶
func (fe *FrameEntity) AddPacket(extSeq uint64, ddVal *dd.DependencyDescriptor)
func (*FrameEntity) Integrity ¶
func (fe *FrameEntity) Integrity() bool
func (*FrameEntity) Reset ¶
func (fe *FrameEntity) Reset()
type FrameIntegrityChecker ¶
type FrameIntegrityChecker struct {
// contains filtered or unexported fields
}
func NewFrameIntegrityChecker ¶
func NewFrameIntegrityChecker(frameCount, packetCount int) *FrameIntegrityChecker
func (*FrameIntegrityChecker) AddPacket ¶
func (fc *FrameIntegrityChecker) AddPacket(extSeq uint64, extFrameNum uint64, ddVal *dd.DependencyDescriptor)
func (*FrameIntegrityChecker) FrameIntegrity ¶
func (fc *FrameIntegrityChecker) FrameIntegrity(extFrameNum uint64) bool
type FrameRateCalculator ¶
type FrameRateCalculatorDD ¶
type FrameRateCalculatorDD struct {
// contains filtered or unexported fields
}
FrameRateCalculator based on Dependency descriptor
func NewFrameRateCalculatorDD ¶
func NewFrameRateCalculatorDD(clockRate uint32, logger logger.Logger) *FrameRateCalculatorDD
func (*FrameRateCalculatorDD) Completed ¶
func (f *FrameRateCalculatorDD) Completed() bool
func (*FrameRateCalculatorDD) GetFrameRateCalculatorForSpatial ¶
func (f *FrameRateCalculatorDD) GetFrameRateCalculatorForSpatial(spatial int32) *FrameRateCalculatorForDDLayer
func (*FrameRateCalculatorDD) GetFrameRateForSpatial ¶
func (f *FrameRateCalculatorDD) GetFrameRateForSpatial(spatial int32) []float32
func (*FrameRateCalculatorDD) RecvPacket ¶
func (f *FrameRateCalculatorDD) RecvPacket(ep *ExtPacket) bool
func (*FrameRateCalculatorDD) SetMaxLayer ¶
func (f *FrameRateCalculatorDD) SetMaxLayer(spatial, temporal int32)
type FrameRateCalculatorForDDLayer ¶
type FrameRateCalculatorForDDLayer struct { *FrameRateCalculatorDD // contains filtered or unexported fields }
func (*FrameRateCalculatorForDDLayer) GetFrameRate ¶
func (f *FrameRateCalculatorForDDLayer) GetFrameRate() []float32
type FrameRateCalculatorForVP9Layer ¶
type FrameRateCalculatorForVP9Layer struct { *FrameRateCalculatorVP9 // contains filtered or unexported fields }
func (*FrameRateCalculatorForVP9Layer) GetFrameRate ¶
func (f *FrameRateCalculatorForVP9Layer) GetFrameRate() []float32
type FrameRateCalculatorVP8 ¶
type FrameRateCalculatorVP8 struct {
// contains filtered or unexported fields
}
FrameRateCalculator based on PictureID in VP8
func NewFrameRateCalculatorVP8 ¶
func NewFrameRateCalculatorVP8(clockRate uint32, logger logger.Logger) *FrameRateCalculatorVP8
func (FrameRateCalculatorVP8) GetFrameRate ¶
func (f FrameRateCalculatorVP8) GetFrameRate() []float32
func (*FrameRateCalculatorVP8) RecvPacket ¶
func (f *FrameRateCalculatorVP8) RecvPacket(ep *ExtPacket) bool
type FrameRateCalculatorVP9 ¶
type FrameRateCalculatorVP9 struct {
// contains filtered or unexported fields
}
FrameRateCalculator based on PictureID in VP9
func NewFrameRateCalculatorVP9 ¶
func NewFrameRateCalculatorVP9(clockRate uint32, logger logger.Logger) *FrameRateCalculatorVP9
func (*FrameRateCalculatorVP9) Completed ¶
func (f *FrameRateCalculatorVP9) Completed() bool
func (*FrameRateCalculatorVP9) GetFrameRateCalculatorForSpatial ¶
func (f *FrameRateCalculatorVP9) GetFrameRateCalculatorForSpatial(spatial int32) *FrameRateCalculatorForVP9Layer
func (*FrameRateCalculatorVP9) GetFrameRateForSpatial ¶
func (f *FrameRateCalculatorVP9) GetFrameRateForSpatial(spatial int32) []float32
func (*FrameRateCalculatorVP9) RecvPacket ¶
func (f *FrameRateCalculatorVP9) RecvPacket(ep *ExtPacket) bool
type PacketHistory ¶
type PacketHistory struct {
// contains filtered or unexported fields
}
func NewPacketHistory ¶
func NewPacketHistory(packetCount int) *PacketHistory
func (*PacketHistory) AddPacket ¶
func (ph *PacketHistory) AddPacket(extSeq uint64)
func (*PacketHistory) PacketsConsecutive ¶
func (ph *PacketHistory) PacketsConsecutive(start, end uint64) bool
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))
type RTCPSenderReportData ¶
type RTCPSenderReportData struct { RTPTimestamp uint32 RTPTimestampExt uint64 NTPTimestamp mediatransportutil.NtpTime At time.Time }
func (*RTCPSenderReportData) ToString ¶
func (r *RTCPSenderReportData) ToString() string
type RTPDeltaInfo ¶
type RTPDeltaInfo struct { StartTime time.Time Duration time.Duration Packets uint32 Bytes uint64 HeaderBytes uint64 PacketsDuplicate uint32 BytesDuplicate uint64 HeaderBytesDuplicate uint64 PacketsPadding uint32 BytesPadding uint64 HeaderBytesPadding uint64 PacketsLost uint32 PacketsMissing uint32 PacketsOutOfOrder uint32 Frames uint32 RttMax uint32 JitterMax float64 Nacks uint32 Plis uint32 Firs uint32 }
func AggregateRTPDeltaInfo ¶
func AggregateRTPDeltaInfo(deltaInfoList []*RTPDeltaInfo) *RTPDeltaInfo
type RTPFlowState ¶
type RTPStatsParams ¶
type RTPStatsReceiver ¶
type RTPStatsReceiver struct {
// contains filtered or unexported fields
}
func NewRTPStatsReceiver ¶
func NewRTPStatsReceiver(params RTPStatsParams) *RTPStatsReceiver
func (*RTPStatsReceiver) DeltaInfo ¶
func (r *RTPStatsReceiver) DeltaInfo(snapshotID uint32) *RTPDeltaInfo
func (*RTPStatsReceiver) GetRtcpReceptionReport ¶
func (r *RTPStatsReceiver) GetRtcpReceptionReport(ssrc uint32, proxyFracLost uint8, snapshotID uint32) *rtcp.ReceptionReport
func (*RTPStatsReceiver) GetRtcpSenderReportData ¶
func (r *RTPStatsReceiver) GetRtcpSenderReportData() (srFirst *RTCPSenderReportData, srNewest *RTCPSenderReportData)
func (*RTPStatsReceiver) NewSnapshotId ¶
func (r *RTPStatsReceiver) NewSnapshotId() uint32
func (*RTPStatsReceiver) SetRtcpSenderReportData ¶
func (r *RTPStatsReceiver) SetRtcpSenderReportData(srData *RTCPSenderReportData)
func (*RTPStatsReceiver) String ¶
func (r *RTPStatsReceiver) String() string
func (RTPStatsReceiver) TimeSinceLastPli ¶
func (r RTPStatsReceiver) TimeSinceLastPli() int64
func (*RTPStatsReceiver) ToProto ¶
func (r *RTPStatsReceiver) ToProto() *livekit.RTPStats
func (*RTPStatsReceiver) Update ¶
func (r *RTPStatsReceiver) Update( packetTime time.Time, sequenceNumber uint16, timestamp uint32, marker bool, hdrSize int, payloadSize int, paddingSize int, ) (flowState RTPFlowState)
func (RTPStatsReceiver) UpdateFirTime ¶
func (r RTPStatsReceiver) UpdateFirTime()
func (RTPStatsReceiver) UpdateKeyFrame ¶
func (r RTPStatsReceiver) UpdateKeyFrame(kfCount uint32)
func (RTPStatsReceiver) UpdateLayerLockPliAndTime ¶
func (r RTPStatsReceiver) UpdateLayerLockPliAndTime(pliCount uint32)
func (RTPStatsReceiver) UpdateNack ¶
func (r RTPStatsReceiver) UpdateNack(nackCount uint32)
func (RTPStatsReceiver) UpdateNackProcessed ¶
func (RTPStatsReceiver) UpdatePliAndTime ¶
func (r RTPStatsReceiver) UpdatePliAndTime(pliCount uint32)
func (RTPStatsReceiver) UpdatePliTime ¶
func (r RTPStatsReceiver) UpdatePliTime()
type RTPStatsSender ¶
type RTPStatsSender struct {
// contains filtered or unexported fields
}
func NewRTPStatsSender ¶
func NewRTPStatsSender(params RTPStatsParams) *RTPStatsSender
func (*RTPStatsSender) DeltaInfo ¶
func (r *RTPStatsSender) DeltaInfo(snapshotID uint32) *RTPDeltaInfo
func (*RTPStatsSender) DeltaInfoSender ¶
func (r *RTPStatsSender) DeltaInfoSender(senderSnapshotID uint32) *RTPDeltaInfo
func (*RTPStatsSender) GetExpectedRTPTimestamp ¶
func (r *RTPStatsSender) GetExpectedRTPTimestamp(at time.Time) (expectedTSExt uint64, err error)
func (*RTPStatsSender) GetRtcpSenderReport ¶
func (r *RTPStatsSender) GetRtcpSenderReport(ssrc uint32, calculatedClockRate uint32) *rtcp.SenderReport
func (*RTPStatsSender) GetTotalPacketsPrimary ¶
func (r *RTPStatsSender) GetTotalPacketsPrimary() uint64
func (*RTPStatsSender) LastReceiverReportTime ¶
func (r *RTPStatsSender) LastReceiverReportTime() time.Time
func (*RTPStatsSender) MaybeAdjustFirstPacketTime ¶
func (r *RTPStatsSender) MaybeAdjustFirstPacketTime(ts uint32)
func (*RTPStatsSender) NewSenderSnapshotId ¶
func (r *RTPStatsSender) NewSenderSnapshotId() uint32
func (*RTPStatsSender) NewSnapshotId ¶
func (r *RTPStatsSender) NewSnapshotId() uint32
func (*RTPStatsSender) Seed ¶
func (r *RTPStatsSender) Seed(from *RTPStatsSender)
func (*RTPStatsSender) String ¶
func (r *RTPStatsSender) String() string
func (RTPStatsSender) TimeSinceLastPli ¶
func (r RTPStatsSender) TimeSinceLastPli() int64
func (*RTPStatsSender) ToProto ¶
func (r *RTPStatsSender) ToProto() *livekit.RTPStats
func (RTPStatsSender) UpdateFirTime ¶
func (r RTPStatsSender) UpdateFirTime()
func (*RTPStatsSender) UpdateFromReceiverReport ¶
func (r *RTPStatsSender) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt uint32, isRttChanged bool)
func (RTPStatsSender) UpdateKeyFrame ¶
func (r RTPStatsSender) UpdateKeyFrame(kfCount uint32)
func (RTPStatsSender) UpdateLayerLockPliAndTime ¶
func (r RTPStatsSender) UpdateLayerLockPliAndTime(pliCount uint32)
func (RTPStatsSender) UpdateNack ¶
func (r RTPStatsSender) UpdateNack(nackCount uint32)
func (RTPStatsSender) UpdateNackProcessed ¶
func (RTPStatsSender) UpdatePliAndTime ¶
func (r RTPStatsSender) UpdatePliAndTime(pliCount uint32)
func (RTPStatsSender) UpdatePliTime ¶
func (r RTPStatsSender) UpdatePliTime()
type StreamStatsWithLayers ¶
type StreamStatsWithLayers struct { RTPStats *RTPDeltaInfo Layers map[int32]*RTPDeltaInfo }
type VP8 ¶
type VP8 struct { FirstByte byte S bool I bool M bool PictureID uint16 /* 7 or 15 bits, picture ID */ L bool TL0PICIDX uint8 /* 8 bits temporal level zero index */ // Optional Header If either of the T or K bits are set to 1, // the TID/Y/KEYIDX extension field MUST be present. T bool TID uint8 /* 2 bits temporal layer idx */ Y bool K bool KEYIDX uint8 /* 5 bits of key frame idx */ HeaderSize int // IsKeyFrame is a helper to detect if current packet is a keyframe IsKeyFrame bool }
VP8 is a helper to get temporal data from VP8 packet header
VP8 Payload Descriptor 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |X|R|N|S|R| PID | (REQUIRED) |X|R|N|S|R| PID | (REQUIRED) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ X: |I|L|T|K| RSV | (OPTIONAL) X: |I|L|T|K| RSV | (OPTIONAL) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ I: |M| PictureID | (OPTIONAL) I: |M| PictureID | (OPTIONAL) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ L: | TL0PICIDX | (OPTIONAL) | PictureID | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ T/K:|TID|Y| KEYIDX | (OPTIONAL) L: | TL0PICIDX | (OPTIONAL) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ T/K:|TID|Y| KEYIDX | (OPTIONAL) +-+-+-+-+-+-+-+-+
type VideoLayer ¶
func (VideoLayer) GreaterThan ¶
func (v VideoLayer) GreaterThan(v2 VideoLayer) bool
func (VideoLayer) IsValid ¶
func (v VideoLayer) IsValid() bool
func (VideoLayer) SpatialGreaterThanOrEqual ¶
func (v VideoLayer) SpatialGreaterThanOrEqual(v2 VideoLayer) bool
func (VideoLayer) String ¶
func (v VideoLayer) String() string