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 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(*RTPStats))
- 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) OnRtcpSenderReport(fn func(srData *RTCPSenderReportData))
- 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 DependencyDescriptorWithDecodeTarget
- type ExtPacket
- type Factory
- type FactoryOfBufferFactory
- 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 IntervalStats
- type PIDController
- func (p *PIDController) SetDerivativeLPF(tau float64)
- func (p *PIDController) SetGains(kp, ki, kd float64)
- func (p *PIDController) SetIntegralLimits(min, max float64)
- func (p *PIDController) SetLogger(logger logger.Logger)
- func (p *PIDController) SetOutputLimits(min, max float64)
- func (p *PIDController) Update(setpoint, measurement float64, at time.Time) float64
- type RTCPReader
- type RTCPSenderReportData
- type RTPDeltaInfo
- type RTPFlowState
- type RTPStats
- func (r *RTPStats) DeltaInfo(snapshotId uint32) *RTPDeltaInfo
- func (r *RTPStats) DeltaInfoOverridden(snapshotId uint32) *RTPDeltaInfo
- func (r *RTPStats) GetExpectedRTPTimestamp(at time.Time) (uint32, uint64, error)
- func (r *RTPStats) GetRtcpSenderReport(ssrc uint32, srFirst *RTCPSenderReportData, srNewest *RTCPSenderReportData) (*rtcp.SenderReport, float64)
- func (r *RTPStats) GetRtcpSenderReportData() (srFirst *RTCPSenderReportData, srNewest *RTCPSenderReportData)
- func (r *RTPStats) GetRtt() uint32
- func (r *RTPStats) GetTotalPacketsPrimary() uint32
- func (r *RTPStats) IsActive() bool
- func (r *RTPStats) LastPli() time.Time
- func (r *RTPStats) LastReceiverReport() 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(srData *RTCPSenderReportData)
- 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 time.Time) (flowState RTPFlowState)
- func (r *RTPStats) UpdateFir(firCount uint32)
- func (r *RTPStats) UpdateFirTime()
- func (r *RTPStats) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt uint32, isRttChanged bool)
- 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
- type SnInfo
- type Snapshot
- type StreamStatsWithLayers
- type VP8
- type VideoLayer
Constants ¶
const ( GapHistogramNumBins = 101 NumSequenceNumbers = 65536 FirstSnapshotId = 1 SnInfoSize = 8192 SnInfoMask = SnInfoSize - 1 MeasurementWindowSecondsMin = float64(5.0) )
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 ( InvalidLayer = VideoLayer{ Spatial: InvalidLayerSpatial, Temporal: InvalidLayerTemporal, } DefaultMaxLayer = VideoLayer{ Spatial: DefaultMaxLayerSpatial, Temporal: DefaultMaxLayerTemporal, } )
Functions ¶
func AggregateRTPStats ¶ added in v0.15.6
func GetActiveDecodeTargetBitmask ¶ added in v1.4.2
func GetActiveDecodeTargetBitmask(layer VideoLayer, decodeTargets []DependencyDescriptorDecodeTarget) *uint32
func IsAV1KeyFrame ¶ added in v1.4.2
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 ¶ added in v1.4.2
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 ¶ added in v1.4.2
func LayerPresenceFromTrackInfo ¶ added in v1.2.1
func LayerPresenceFromTrackInfo(trackInfo *livekit.TrackInfo) *[livekit.VideoQuality_HIGH + 1]bool
func RidToSpatialLayer ¶ added in v1.2.1
func SpatialLayerToRid ¶ added in v1.2.1
func SpatialLayerToVideoQuality ¶ added in v1.2.1
func SpatialLayerToVideoQuality(layer int32, trackInfo *livekit.TrackInfo) livekit.VideoQuality
func VPxPictureIdSizeDiff ¶ added in v1.4.2
func VideoQualityToRid ¶ added in v1.2.1
func VideoQualityToRid(quality livekit.VideoQuality, trackInfo *livekit.TrackInfo) string
func VideoQualityToSpatialLayer ¶ added in v1.2.1
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 ¶ added in v0.15.7
func (*Buffer) GetClockRate ¶
GetClockRate returns the RTP clock rate
func (*Buffer) GetDeltaStats ¶ added in v0.15.7
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 ¶ added in v1.3.0
func (*Buffer) OnFinalRtpStats ¶ added in v1.4.0
func (*Buffer) OnFpsChanged ¶ added in v1.3.0
func (b *Buffer) OnFpsChanged(f func())
func (*Buffer) OnMaxLayerChanged ¶ added in v1.0.0
DD-TODO : now we rely on stream tracker for layer change, dependency still work for that too. Do we keep it unchanged or use both methods?
func (*Buffer) OnRtcpFeedback ¶ added in v0.15.7
func (*Buffer) OnRtcpSenderReport ¶ added in v1.3.3
func (b *Buffer) OnRtcpSenderReport(fn func(srData *RTCPSenderReportData))
func (*Buffer) SetAudioLevelParams ¶ added in v0.15.7
func (b *Buffer) SetAudioLevelParams(audioLevelParams audio.AudioLevelParams)
func (*Buffer) SetLastFractionLostReport ¶
func (*Buffer) SetPLIThrottle ¶ added in v0.15.4
func (*Buffer) SetSenderReportData ¶
type DataStats ¶ added in v0.15.6
type DataStats struct {
// contains filtered or unexported fields
}
func NewDataStats ¶ added in v0.15.6
func NewDataStats(params DataStatsParam) *DataStats
func (*DataStats) ToProtoActive ¶ added in v0.15.6
func (*DataStats) ToProtoAggregateOnly ¶ added in v0.15.6
type DataStatsParam ¶ added in v0.15.6
type DependencyDescriptorDecodeTarget ¶ added in v1.4.2
type DependencyDescriptorDecodeTarget struct { Target int Layer VideoLayer }
func ProcessFrameDependencyStructure ¶ added in v1.4.2
func ProcessFrameDependencyStructure(structure *dd.FrameDependencyStructure) []DependencyDescriptorDecodeTarget
type DependencyDescriptorParser ¶ added in v1.0.0
type DependencyDescriptorParser struct {
// contains filtered or unexported fields
}
func NewDependencyDescriptorParser ¶ added in v1.0.0
func (*DependencyDescriptorParser) Parse ¶ added in v1.0.0
func (r *DependencyDescriptorParser) Parse(pkt *rtp.Packet) (*DependencyDescriptorWithDecodeTarget, VideoLayer, error)
type DependencyDescriptorWithDecodeTarget ¶ added in v1.4.2
type DependencyDescriptorWithDecodeTarget struct { Descriptor *dd.DependencyDescriptor DecodeTargets []DependencyDescriptorDecodeTarget }
type ExtPacket ¶
type ExtPacket struct { VideoLayer Arrival time.Time Packet *rtp.Packet Payload interface{} KeyFrame bool RawPacket []byte DependencyDescriptor *DependencyDescriptorWithDecodeTarget }
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 ¶ added in v1.3.2
type FactoryOfBufferFactory struct {
// contains filtered or unexported fields
}
func NewFactoryOfBufferFactory ¶ added in v1.3.2
func NewFactoryOfBufferFactory(trackingPackets int) *FactoryOfBufferFactory
func (*FactoryOfBufferFactory) CreateBufferFactory ¶ added in v1.3.2
func (f *FactoryOfBufferFactory) CreateBufferFactory() *Factory
type FrameRateCalculator ¶ added in v1.3.0
type FrameRateCalculatorDD ¶ added in v1.3.0
type FrameRateCalculatorDD struct {
// contains filtered or unexported fields
}
FrameRateCalculator based on Dependency descriptor
func NewFrameRateCalculatorDD ¶ added in v1.3.0
func NewFrameRateCalculatorDD(clockRate uint32, logger logger.Logger) *FrameRateCalculatorDD
func (*FrameRateCalculatorDD) Completed ¶ added in v1.3.0
func (f *FrameRateCalculatorDD) Completed() bool
func (*FrameRateCalculatorDD) GetFrameRateCalculatorForSpatial ¶ added in v1.3.0
func (f *FrameRateCalculatorDD) GetFrameRateCalculatorForSpatial(spatial int32) *FrameRateCalculatorForDDLayer
func (*FrameRateCalculatorDD) GetFrameRateForSpatial ¶ added in v1.3.0
func (f *FrameRateCalculatorDD) GetFrameRateForSpatial(spatial int32) []float32
func (*FrameRateCalculatorDD) RecvPacket ¶ added in v1.3.0
func (f *FrameRateCalculatorDD) RecvPacket(ep *ExtPacket) bool
func (*FrameRateCalculatorDD) SetMaxLayer ¶ added in v1.3.0
func (f *FrameRateCalculatorDD) SetMaxLayer(spatial, temporal int32)
type FrameRateCalculatorForDDLayer ¶ added in v1.3.0
type FrameRateCalculatorForDDLayer struct { *FrameRateCalculatorDD // contains filtered or unexported fields }
func (*FrameRateCalculatorForDDLayer) GetFrameRate ¶ added in v1.3.0
func (f *FrameRateCalculatorForDDLayer) GetFrameRate() []float32
type FrameRateCalculatorForVP9Layer ¶ added in v1.4.2
type FrameRateCalculatorForVP9Layer struct { *FrameRateCalculatorVP9 // contains filtered or unexported fields }
func (*FrameRateCalculatorForVP9Layer) GetFrameRate ¶ added in v1.4.2
func (f *FrameRateCalculatorForVP9Layer) GetFrameRate() []float32
type FrameRateCalculatorVP8 ¶ added in v1.3.0
type FrameRateCalculatorVP8 struct {
// contains filtered or unexported fields
}
FrameRateCalculator based on PictureID in VP8
func NewFrameRateCalculatorVP8 ¶ added in v1.3.0
func NewFrameRateCalculatorVP8(clockRate uint32, logger logger.Logger) *FrameRateCalculatorVP8
func (FrameRateCalculatorVP8) Completed ¶ added in v1.3.0
func (f FrameRateCalculatorVP8) Completed() bool
func (FrameRateCalculatorVP8) GetFrameRate ¶ added in v1.3.0
func (f FrameRateCalculatorVP8) GetFrameRate() []float32
func (*FrameRateCalculatorVP8) RecvPacket ¶ added in v1.3.0
func (f *FrameRateCalculatorVP8) RecvPacket(ep *ExtPacket) bool
type FrameRateCalculatorVP9 ¶ added in v1.4.2
type FrameRateCalculatorVP9 struct {
// contains filtered or unexported fields
}
FrameRateCalculator based on PictureID in VP9
func NewFrameRateCalculatorVP9 ¶ added in v1.4.2
func NewFrameRateCalculatorVP9(clockRate uint32, logger logger.Logger) *FrameRateCalculatorVP9
func (*FrameRateCalculatorVP9) Completed ¶ added in v1.4.2
func (f *FrameRateCalculatorVP9) Completed() bool
func (*FrameRateCalculatorVP9) GetFrameRateCalculatorForSpatial ¶ added in v1.4.2
func (f *FrameRateCalculatorVP9) GetFrameRateCalculatorForSpatial(spatial int32) *FrameRateCalculatorForVP9Layer
func (*FrameRateCalculatorVP9) GetFrameRateForSpatial ¶ added in v1.4.2
func (f *FrameRateCalculatorVP9) GetFrameRateForSpatial(spatial int32) []float32
func (*FrameRateCalculatorVP9) RecvPacket ¶ added in v1.4.2
func (f *FrameRateCalculatorVP9) RecvPacket(ep *ExtPacket) bool
type IntervalStats ¶ added in v1.2.0
type IntervalStats struct {
// contains filtered or unexported fields
}
type PIDController ¶ added in v1.4.2
type PIDController struct {
// contains filtered or unexported fields
}
func NewPIDController ¶ added in v1.4.2
func NewPIDController(logger logger.Logger) *PIDController
func (*PIDController) SetDerivativeLPF ¶ added in v1.4.2
func (p *PIDController) SetDerivativeLPF(tau float64)
func (*PIDController) SetGains ¶ added in v1.4.2
func (p *PIDController) SetGains(kp, ki, kd float64)
func (*PIDController) SetIntegralLimits ¶ added in v1.4.2
func (p *PIDController) SetIntegralLimits(min, max float64)
func (*PIDController) SetLogger ¶ added in v1.4.2
func (p *PIDController) SetLogger(logger logger.Logger)
func (*PIDController) SetOutputLimits ¶ added in v1.4.2
func (p *PIDController) SetOutputLimits(min, max float64)
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 ¶ added in v1.3.3
type RTPDeltaInfo ¶ added in v0.15.7
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 Frames uint32 RttMax uint32 JitterMax float64 Nacks uint32 Plis uint32 Firs uint32 }
func AggregateRTPDeltaInfo ¶ added in v1.4.0
func AggregateRTPDeltaInfo(deltaInfoList []*RTPDeltaInfo) *RTPDeltaInfo
type RTPFlowState ¶ added in v0.15.6
type RTPStats ¶ added in v0.15.6
type RTPStats struct {
// contains filtered or unexported fields
}
func NewRTPStats ¶ added in v0.15.6
func NewRTPStats(params RTPStatsParams) *RTPStats
func (*RTPStats) DeltaInfo ¶ added in v0.15.7
func (r *RTPStats) DeltaInfo(snapshotId uint32) *RTPDeltaInfo
func (*RTPStats) DeltaInfoOverridden ¶ added in v1.4.2
func (r *RTPStats) DeltaInfoOverridden(snapshotId uint32) *RTPDeltaInfo
func (*RTPStats) GetExpectedRTPTimestamp ¶ added in v1.4.2
func (*RTPStats) GetRtcpSenderReport ¶ added in v0.15.6
func (r *RTPStats) GetRtcpSenderReport(ssrc uint32, srFirst *RTCPSenderReportData, srNewest *RTCPSenderReportData) (*rtcp.SenderReport, float64)
func (*RTPStats) GetRtcpSenderReportData ¶ added in v1.3.3
func (r *RTPStats) GetRtcpSenderReportData() (srFirst *RTCPSenderReportData, srNewest *RTCPSenderReportData)
func (*RTPStats) GetTotalPacketsPrimary ¶ added in v0.15.6
func (*RTPStats) LastReceiverReport ¶ added in v1.4.2
func (*RTPStats) NewSnapshotId ¶ added in v0.15.6
func (*RTPStats) ResyncOnNextPacket ¶ added in v1.2.1
func (r *RTPStats) ResyncOnNextPacket()
func (*RTPStats) SetRtcpSenderReportData ¶ added in v0.15.6
func (r *RTPStats) SetRtcpSenderReportData(srData *RTCPSenderReportData)
func (*RTPStats) SnapshotRtcpReceptionReport ¶ added in v0.15.6
func (*RTPStats) TimeSinceLastPli ¶ added in v0.15.6
func (*RTPStats) UpdateFirTime ¶ added in v0.15.6
func (r *RTPStats) UpdateFirTime()
func (*RTPStats) UpdateFromReceiverReport ¶ added in v0.15.7
func (r *RTPStats) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt uint32, isRttChanged bool)
func (*RTPStats) UpdateKeyFrame ¶ added in v0.15.6
func (*RTPStats) UpdateLayerLockPliAndTime ¶ added in v0.15.6
func (*RTPStats) UpdateNack ¶ added in v0.15.6
func (*RTPStats) UpdateNackProcessed ¶ added in v1.0.0
func (*RTPStats) UpdatePliAndTime ¶ added in v0.15.6
func (*RTPStats) UpdatePliTime ¶ added in v0.15.6
func (r *RTPStats) UpdatePliTime()
type RTPStatsParams ¶ added in v0.15.6
type StreamStatsWithLayers ¶ added in v0.15.4
type StreamStatsWithLayers struct { RTPStats *RTPDeltaInfo Layers map[int32]*RTPDeltaInfo }
type VP8 ¶
type VP8 struct { FirstByte byte S bool I bool M bool PictureID uint16 /* 8 or 16 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 ¶ added in v1.0.0
func (VideoLayer) GreaterThan ¶ added in v1.0.0
func (v VideoLayer) GreaterThan(v2 VideoLayer) bool
func (VideoLayer) IsValid ¶ added in v1.0.0
func (v VideoLayer) IsValid() bool
func (VideoLayer) SpatialGreaterThanOrEqual ¶ added in v1.0.0
func (v VideoLayer) SpatialGreaterThanOrEqual(v2 VideoLayer) bool
func (VideoLayer) String ¶ added in v1.0.0
func (v VideoLayer) String() string