mkvmuxer: Set doctype to matroska when muxing non-WebM codecs.

Also, add some constants for WebVTT codec ID strings so they
won't cause doctype to incorrectly change to matroska.

Change-Id: I4740a3e45b28a22e462601b9ce051aa01817dace
This commit is contained in:
Tom Finegan
2016-04-27 13:50:20 -07:00
parent e3c9576716
commit 9a235e0bc9
5 changed files with 85 additions and 6 deletions

View File

@@ -723,6 +723,24 @@ TEST_F(MuxerTest, UseFixedSizeClusterTimecode) {
filename_));
}
TEST_F(MuxerTest, DocTypeWebm) {
EXPECT_TRUE(SegmentInit(false, false, false));
AddVideoTrack();
Track* const vid_track = segment_.GetTrackByNumber(kVideoTrackNumber);
vid_track->set_codec_id(kVP9CodecId);
AddDummyFrameAndFinalize(kVideoTrackNumber);
EXPECT_TRUE(CompareFiles(GetTestFilePath("webm_doctype.webm"), filename_));
}
TEST_F(MuxerTest, DocTypeMatroska) {
EXPECT_TRUE(SegmentInit(false, false, false));
AddVideoTrack();
Track* const vid_track = segment_.GetTrackByNumber(kVideoTrackNumber);
vid_track->set_codec_id("V_SOMETHING_NOT_IN_WEBM");
AddDummyFrameAndFinalize(kVideoTrackNumber);
EXPECT_TRUE(CompareFiles(GetTestFilePath("matroska_doctype.mkv"), filename_));
}
} // namespace test
int main(int argc, char* argv[]) {

BIN
testing/testdata/matroska_doctype.mkv vendored Normal file

Binary file not shown.

BIN
testing/testdata/webm_doctype.webm vendored Normal file

Binary file not shown.