Skip to content

Commit

Permalink
For #1405: Fix utest build failed, for parsing SPS/PPS.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Sep 2, 2022
1 parent 84c9607 commit 77e1f81
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions trunk/src/utest/srs_utest_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3838,19 +3838,18 @@ VOID TEST(KernelCodecTest, VideoFormat)
HELPER_EXPECT_SUCCESS(f.on_video(0, (char*)spspps, sizeof(spspps)));
EXPECT_EQ(1, f.video->frame_type);
EXPECT_EQ(0, f.video->avc_packet_type);


// If force to ANNEXB, other format is failed to parse.
f.vcodec->payload_format = SrsAvcPayloadFormatAnnexb;

HELPER_EXPECT_SUCCESS(f.on_video(0, (char*)rawIBMF, sizeof(rawIBMF)));
EXPECT_EQ(1, f.video->nb_samples);

// If IBMF format parsed, we couldn't parse annexb anymore.
// Maybe FFMPEG use annexb format for some packets, then switch to IBMF.
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)));

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);

HELPER_EXPECT_FAILED(f.on_video(0, (char*)rawIBMF, sizeof(rawIBMF)));
EXPECT_EQ(0, f.video->nb_samples);
}
}

Expand Down

0 comments on commit 77e1f81

Please sign in to comment.