mirror of
https://github.com/aler9/gortsplib
synced 2025-10-15 03:30:47 +08:00
codecs/h265: support SPS with long_term_ref_pics_present_flag (#197)
Fixes https://github.com/aler9/rtsp-simple-server/issues/1441
This commit is contained in:
@@ -789,7 +789,14 @@ func (s *SPS) Unmarshal(buf []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if s.LongTermRefPicsPresentFlag {
|
if s.LongTermRefPicsPresentFlag {
|
||||||
return fmt.Errorf("LongTermRefPicsPresentFlag not supported yet")
|
numLongTermRefPicsSPS, err := bits.ReadGolombUnsigned(buf, &pos)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if numLongTermRefPicsSPS > 0 {
|
||||||
|
return fmt.Errorf("long term ref pics inside SPS are not supported yet")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.TemporalMvpEnabledFlag, err = bits.ReadFlag(buf, &pos)
|
s.TemporalMvpEnabledFlag, err = bits.ReadFlag(buf, &pos)
|
||||||
|
@@ -373,6 +373,58 @@ func TestSPSUnmarshal(t *testing.T) {
|
|||||||
1728,
|
1728,
|
||||||
17,
|
17,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"long_term_ref_pics_present_flag",
|
||||||
|
[]byte{
|
||||||
|
0x42, 0x01, 0x01, 0x01, 0x60, 0x00, 0x00, 0x03,
|
||||||
|
0x00, 0xb0, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03,
|
||||||
|
0x00, 0x5d, 0xa0, 0x02, 0x80, 0x80, 0x2d, 0x16,
|
||||||
|
0x36, 0xb9, 0x24, 0xcb, 0xf0, 0x08, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x08, 0x00, 0x00, 0x03, 0x01, 0x95,
|
||||||
|
0x08,
|
||||||
|
},
|
||||||
|
SPS{
|
||||||
|
TemporalIDNestingFlag: true,
|
||||||
|
ProfileTierLevel: SPS_ProfileTierLevel{
|
||||||
|
GeneralProfileIdc: 1,
|
||||||
|
GeneralProfileCompatibilityFlag: [32]bool{
|
||||||
|
false, true, true, false, false, false, false, false,
|
||||||
|
false, false, false, false, false, false, false, false,
|
||||||
|
false, false, false, false, false, false, false, false,
|
||||||
|
false, false, false, false, false, false, false, false,
|
||||||
|
},
|
||||||
|
GeneralProgressiveSourceFlag: true,
|
||||||
|
GeneralNonPackedConstraintFlag: true,
|
||||||
|
GeneralFrameOnlyConstraintFlag: true,
|
||||||
|
GeneralLevelIdc: 93,
|
||||||
|
},
|
||||||
|
ChromaFormatIdc: 1,
|
||||||
|
PicWidthInLumaSamples: 1280,
|
||||||
|
PicHeightInLumaSamples: 720,
|
||||||
|
Log2MaxPicOrderCntLsbMinus4: 12,
|
||||||
|
SubLayerOrderingInfoPresentFlag: true,
|
||||||
|
MaxDecPicBufferingMinus1: []uint32{1},
|
||||||
|
MaxNumReorderPics: []uint32{0},
|
||||||
|
MaxLatencyIncreasePlus1: []uint32{0},
|
||||||
|
Log2DiffMaxMinLumaCodingBlockSize: 3,
|
||||||
|
Log2DiffMaxMinLumaTransformBlockSize: 3,
|
||||||
|
SampleAdaptiveOffsetEnabledFlag: true,
|
||||||
|
LongTermRefPicsPresentFlag: true,
|
||||||
|
TemporalMvpEnabledFlag: true,
|
||||||
|
StrongIntraSmoothingEnabledFlag: true,
|
||||||
|
VUI: &SPS_VUI{
|
||||||
|
TimingInfo: &SPS_TimingInfo{
|
||||||
|
NumUnitsInTick: 1,
|
||||||
|
TimeScale: 50,
|
||||||
|
POCProportionalToTimingFlag: true,
|
||||||
|
NumTicksPOCDiffOneMinus1: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
1280,
|
||||||
|
720,
|
||||||
|
50,
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
t.Run(ca.name, func(t *testing.T) {
|
t.Run(ca.name, func(t *testing.T) {
|
||||||
var sps SPS
|
var sps SPS
|
||||||
|
@@ -0,0 +1,2 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("000000000000000\xf571*07")
|
@@ -0,0 +1,2 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("00000000000000000%00000000A$0")
|
Reference in New Issue
Block a user