Allow CMAF file extensions

Extensions cmfv, cmfa, cmft are now supported and recognized as
CONTAINER_MOV.

Fixes #574.

Change-Id: I728feefaba91f862966af49c780bbac8068722f2
This commit is contained in:
KongQun Yang 2019-03-26 12:27:42 -07:00
parent 26bc55503d
commit fa7a6d967a
2 changed files with 10 additions and 4 deletions

View File

@ -1736,11 +1736,14 @@ MediaContainerName DetermineContainerFromFormatName(
return CONTAINER_EAC3; return CONTAINER_EAC3;
} else if (base::EqualsCaseInsensitiveASCII(format_name, "webm")) { } else if (base::EqualsCaseInsensitiveASCII(format_name, "webm")) {
return CONTAINER_WEBM; return CONTAINER_WEBM;
} else if (base::EqualsCaseInsensitiveASCII(format_name, "m4a") || } else if (base::EqualsCaseInsensitiveASCII(format_name, "cmfa") ||
base::EqualsCaseInsensitiveASCII(format_name, "m4v") || base::EqualsCaseInsensitiveASCII(format_name, "cmft") ||
base::EqualsCaseInsensitiveASCII(format_name, "cmfv") ||
base::EqualsCaseInsensitiveASCII(format_name, "m4a") ||
base::EqualsCaseInsensitiveASCII(format_name, "m4s") || base::EqualsCaseInsensitiveASCII(format_name, "m4s") ||
base::EqualsCaseInsensitiveASCII(format_name, "mp4") || base::EqualsCaseInsensitiveASCII(format_name, "m4v") ||
base::EqualsCaseInsensitiveASCII(format_name, "mov")) { base::EqualsCaseInsensitiveASCII(format_name, "mov") ||
base::EqualsCaseInsensitiveASCII(format_name, "mp4")) {
return CONTAINER_MOV; return CONTAINER_MOV;
} else if (base::EqualsCaseInsensitiveASCII(format_name, "ts") || } else if (base::EqualsCaseInsensitiveASCII(format_name, "ts") ||
base::EqualsCaseInsensitiveASCII(format_name, "mpeg2ts")) { base::EqualsCaseInsensitiveASCII(format_name, "mpeg2ts")) {

View File

@ -92,6 +92,9 @@ TEST(ContainerNamesTest, FromFormatName) {
EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("mov")); EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("mov"));
EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("mp4")); EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("mp4"));
EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("Mp4")); EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("Mp4"));
EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("cmfa"));
EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("cmft"));
EXPECT_EQ(CONTAINER_MOV, DetermineContainerFromFormatName("cmfv"));
EXPECT_EQ(CONTAINER_MPEG2TS, DetermineContainerFromFormatName("ts")); EXPECT_EQ(CONTAINER_MPEG2TS, DetermineContainerFromFormatName("ts"));
EXPECT_EQ(CONTAINER_MPEG2TS, DetermineContainerFromFormatName("mpeg2ts")); EXPECT_EQ(CONTAINER_MPEG2TS, DetermineContainerFromFormatName("mpeg2ts"));
EXPECT_EQ(CONTAINER_UNKNOWN, DetermineContainerFromFormatName("cat")); EXPECT_EQ(CONTAINER_UNKNOWN, DetermineContainerFromFormatName("cat"));