mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
HEVC: Support DVR HEVC stream to MP4. v6.0.14 (#3360)
* DVR: Support mp4 blackbox test based on hooks. * HEVC: Support DASH HEVC stream * Refine blackbox test. v6.0.14 Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com> Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
5ee528677b
commit
edba2c25f1
9 changed files with 587 additions and 43 deletions
|
@ -5441,6 +5441,7 @@ VOID TEST(KernelMP4Test, CoverMP4CodecSingleFrame)
|
|||
}
|
||||
|
||||
enc.acodec = SrsAudioCodecIdAAC;
|
||||
enc.vcodec = SrsVideoCodecIdAVC;
|
||||
|
||||
HELPER_EXPECT_SUCCESS(enc.flush());
|
||||
//mock_print_mp4(string(f.data(), f.filesize()));
|
||||
|
@ -5557,6 +5558,7 @@ VOID TEST(KernelMP4Test, CoverMP4MultipleVideos)
|
|||
}
|
||||
|
||||
enc.acodec = SrsAudioCodecIdAAC;
|
||||
enc.vcodec = SrsVideoCodecIdAVC;
|
||||
|
||||
// Flush encoder.
|
||||
HELPER_EXPECT_SUCCESS(enc.flush());
|
||||
|
@ -5657,6 +5659,7 @@ VOID TEST(KernelMP4Test, CoverMP4MultipleCTTs)
|
|||
}
|
||||
|
||||
enc.acodec = SrsAudioCodecIdAAC;
|
||||
enc.vcodec = SrsVideoCodecIdAVC;
|
||||
|
||||
// Flush encoder.
|
||||
HELPER_EXPECT_SUCCESS(enc.flush());
|
||||
|
@ -5771,6 +5774,7 @@ VOID TEST(KernelMP4Test, CoverMP4MultipleAVs)
|
|||
}
|
||||
|
||||
enc.acodec = SrsAudioCodecIdAAC;
|
||||
enc.vcodec = SrsVideoCodecIdAVC;
|
||||
|
||||
// Flush encoder.
|
||||
HELPER_EXPECT_SUCCESS(enc.flush());
|
||||
|
@ -5889,6 +5893,7 @@ VOID TEST(KernelMP4Test, CoverMP4MultipleAVsWithMp3)
|
|||
}
|
||||
|
||||
enc.acodec = SrsAudioCodecIdMP3;
|
||||
enc.vcodec = SrsVideoCodecIdAVC;
|
||||
|
||||
// Flush encoder.
|
||||
HELPER_EXPECT_SUCCESS(enc.flush());
|
||||
|
|
|
@ -1322,7 +1322,7 @@ VOID TEST(KernelMp4Test, SampleDescBox)
|
|||
SrsBuffer b(buf, sizeof(buf));
|
||||
|
||||
if (true) {
|
||||
SrsMp4VisualSampleEntry box;
|
||||
SrsMp4VisualSampleEntry box = SrsMp4VisualSampleEntry(SrsMp4BoxTypeAVC1);
|
||||
box.data_reference_index = 1;
|
||||
EXPECT_EQ((int)sizeof(buf), (int)box.nb_bytes());
|
||||
HELPER_EXPECT_SUCCESS(box.encode(&b));
|
||||
|
@ -1337,7 +1337,7 @@ VOID TEST(KernelMp4Test, SampleDescBox)
|
|||
|
||||
if (true) {
|
||||
b.skip(-1 * b.pos());
|
||||
SrsMp4VisualSampleEntry box;
|
||||
SrsMp4VisualSampleEntry box = SrsMp4VisualSampleEntry(SrsMp4BoxTypeAVC1);
|
||||
HELPER_EXPECT_SUCCESS(box.decode(&b));
|
||||
}
|
||||
}
|
||||
|
@ -1366,6 +1366,55 @@ VOID TEST(KernelMp4Test, SampleDescBox)
|
|||
}
|
||||
}
|
||||
|
||||
if (true) {
|
||||
char buf[8+8+70];
|
||||
SrsBuffer b(buf, sizeof(buf));
|
||||
|
||||
if (true) {
|
||||
SrsMp4VisualSampleEntry box = SrsMp4VisualSampleEntry(SrsMp4BoxTypeHEV1);
|
||||
box.data_reference_index = 1;
|
||||
EXPECT_EQ((int)sizeof(buf), (int)box.nb_bytes());
|
||||
HELPER_EXPECT_SUCCESS(box.encode(&b));
|
||||
|
||||
stringstream ss;
|
||||
SrsMp4DumpContext dc;
|
||||
box.dumps(ss, dc);
|
||||
|
||||
string v = ss.str();
|
||||
EXPECT_STREQ("hev1, 86B, refs#1, size=0x0\n", v.c_str());
|
||||
}
|
||||
|
||||
if (true) {
|
||||
b.skip(-1 * b.pos());
|
||||
SrsMp4VisualSampleEntry box = SrsMp4VisualSampleEntry(SrsMp4BoxTypeHEV1);
|
||||
HELPER_EXPECT_SUCCESS(box.decode(&b));
|
||||
}
|
||||
}
|
||||
|
||||
if (true) {
|
||||
char buf[8];
|
||||
SrsBuffer b(buf, sizeof(buf));
|
||||
|
||||
if (true) {
|
||||
SrsMp4HvcCBox box;
|
||||
EXPECT_EQ((int)sizeof(buf), (int)box.nb_bytes());
|
||||
HELPER_EXPECT_SUCCESS(box.encode(&b));
|
||||
|
||||
stringstream ss;
|
||||
SrsMp4DumpContext dc;
|
||||
box.dumps(ss, dc);
|
||||
|
||||
string v = ss.str();
|
||||
EXPECT_STREQ("hvcC, 8B, HEVC Config: 0B\n \n", v.c_str());
|
||||
}
|
||||
|
||||
if (true) {
|
||||
b.skip(-1 * b.pos());
|
||||
SrsMp4HvcCBox box;
|
||||
HELPER_EXPECT_SUCCESS(box.decode(&b));
|
||||
}
|
||||
}
|
||||
|
||||
if (true) {
|
||||
char buf[8+8+20];
|
||||
SrsBuffer b(buf, sizeof(buf));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue