Check for pictureID existence in VP8 and VP9 (#4721)
* Check for pictureID existence in VP8 and VP9 * test
This commit is contained in:
@@ -215,6 +215,10 @@ func (f *FrameRateCalculatorVP8) RecvPacket(ep *ExtPacket) bool {
|
|||||||
f.logger.Debugw("no vp8 payload", "sn", ep.Packet.SequenceNumber)
|
f.logger.Debugw("no vp8 payload", "sn", ep.Packet.SequenceNumber)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !vp8.I {
|
||||||
|
f.logger.Debugw("no vp8 pictureID", "sn", ep.Packet.SequenceNumber)
|
||||||
|
return false
|
||||||
|
}
|
||||||
success := f.frameRateCalculatorVPx.RecvPacket(ep, vp8.PictureID)
|
success := f.frameRateCalculatorVPx.RecvPacket(ep, vp8.PictureID)
|
||||||
|
|
||||||
if f.frameRateCalculatorVPx.Completed() {
|
if f.frameRateCalculatorVPx.Completed() {
|
||||||
@@ -262,7 +266,10 @@ func (f *FrameRateCalculatorVP9) RecvPacket(ep *ExtPacket) bool {
|
|||||||
f.logger.Debugw("no vp9 payload", "sn", ep.Packet.SequenceNumber)
|
f.logger.Debugw("no vp9 payload", "sn", ep.Packet.SequenceNumber)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !vp9.I {
|
||||||
|
f.logger.Debugw("no vp9 pictureID", "sn", ep.Packet.SequenceNumber)
|
||||||
|
return false
|
||||||
|
}
|
||||||
if ep.Spatial < 0 || ep.Spatial >= int32(len(f.frameRateCalculatorsVPx)) || f.frameRateCalculatorsVPx[ep.Spatial] == nil {
|
if ep.Spatial < 0 || ep.Spatial >= int32(len(f.frameRateCalculatorsVPx)) || f.frameRateCalculatorsVPx[ep.Spatial] == nil {
|
||||||
f.logger.Debugw("invalid spatial layer", "sn", ep.Packet.SequenceNumber, "spatial", ep.Spatial)
|
f.logger.Debugw("invalid spatial layer", "sn", ep.Packet.SequenceNumber, "spatial", ep.Spatial)
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ func (f *testFrameInfo) toVP8() *ExtPacket {
|
|||||||
return &ExtPacket{
|
return &ExtPacket{
|
||||||
Packet: &rtp.Packet{Header: f.header},
|
Packet: &rtp.Packet{Header: f.header},
|
||||||
Payload: codec.VP8{
|
Payload: codec.VP8{
|
||||||
|
I: true,
|
||||||
PictureID: f.framenumber,
|
PictureID: f.framenumber,
|
||||||
},
|
},
|
||||||
VideoLayer: VideoLayer{Spatial: InvalidLayerSpatial, Temporal: int32(f.temporal)},
|
VideoLayer: VideoLayer{Spatial: InvalidLayerSpatial, Temporal: int32(f.temporal)},
|
||||||
|
|||||||
Reference in New Issue
Block a user