1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #1405: Fix utest build failed, for parsing SPS/PPS.

This commit is contained in:
winlin 2022-09-02 11:37:05 +08:00
parent 84c96076a9
commit 77e1f81f91

View file

@ -3839,18 +3839,17 @@ VOID TEST(KernelCodecTest, VideoFormat)
EXPECT_EQ(1, f.video->frame_type); EXPECT_EQ(1, f.video->frame_type);
EXPECT_EQ(0, f.video->avc_packet_type); EXPECT_EQ(0, f.video->avc_packet_type);
// If force to ANNEXB, other format is failed to parse.
f.vcodec->payload_format = SrsAvcPayloadFormatAnnexb; f.vcodec->payload_format = SrsAvcPayloadFormatAnnexb;
HELPER_EXPECT_SUCCESS(f.on_video(0, (char*)rawIBMF, sizeof(rawIBMF))); HELPER_EXPECT_FAILED(f.on_video(0, (char*)rawIBMF, sizeof(rawIBMF)));
EXPECT_EQ(0, f.video->nb_samples);
HELPER_EXPECT_SUCCESS(f.on_video(0, (char*)rawAnnexb, sizeof(rawAnnexb)));
EXPECT_EQ(1, f.video->nb_samples); EXPECT_EQ(1, f.video->nb_samples);
// If IBMF format parsed, we couldn't parse annexb anymore. HELPER_EXPECT_FAILED(f.on_video(0, (char*)rawIBMF, sizeof(rawIBMF)));
// Maybe FFMPEG use annexb format for some packets, then switch to IBMF. EXPECT_EQ(0, f.video->nb_samples);
srs_error_t err = f.on_video(0, (char*)rawAnnexb, sizeof(rawAnnexb));
HELPER_EXPECT_FAILED(err);
HELPER_EXPECT_SUCCESS(f.on_video(0, (char*)rawIBMF, sizeof(rawIBMF)));
EXPECT_EQ(1, f.video->nb_samples);
} }
} }