Index: media/base/mime_util.cc |
diff --git a/media/base/mime_util.cc b/media/base/mime_util.cc |
index 73cddfdb7a3f9dff5c5fcff50e0cc707d0f462cc..63e97b73b3bc3037a129e88c28e9de8cd300e610 100644 |
--- a/media/base/mime_util.cc |
+++ b/media/base/mime_util.cc |
@@ -40,6 +40,11 @@ class MimeUtil { |
VP8, |
VP9, |
THEORA |
+#if defined(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
ddorwin
2015/11/25 22:24:08
Do we need to ifdef this? There are other propriet
servolk
2015/12/03 00:56:14
Done.
|
+ , |
+ AC3, |
ddorwin
2015/11/25 22:24:08
Regardless, keep similar types (at least audio) to
servolk
2015/12/03 00:56:15
Done.
|
+ EAC3 |
+#endif |
}; |
bool IsSupportedMediaMimeType(const std::string& mime_type) const; |
@@ -217,6 +222,13 @@ static bool IsCodecSupportedOnAndroid(MimeUtil::Codec codec) { |
// MPEG-2 variants of AAC are not supported on Android. |
return false; |
+#if defined(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
+ case MimeUtil::AC3: |
+ case MimeUtil::EAC3: |
+ // TODO(servolk): Revisit this for AC3/EAC3 support on AndroidTV |
+ return false; |
+#endif |
+ |
case MimeUtil::VP9: |
// VP9 is supported only in KitKat+ (API Level 19). |
return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; |
@@ -256,6 +268,11 @@ struct MediaFormatStrict { |
// avc1.6400xx - H.264 High |
static const char kMP4AudioCodecsExpression[] = |
"mp4a.66,mp4a.67,mp4a.68,mp4a.69,mp4a.6B,mp4a.40.2,mp4a.40.02,mp4a.40.5," |
+#if defined(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
+ "ac-3,ec-3," // Note: only one variant of eac codec string is sufficient |
ddorwin
2015/11/25 22:24:08
Same as the next comment.
servolk
2015/12/03 00:56:15
Done.
|
+ // here since these are converted into enums in |
+ // InitializeMimeTypeMaps |
+#endif |
"mp4a.40.05,mp4a.40.29"; |
static const char kMP4VideoCodecsExpression[] = |
// This is not a complete list of supported avc1 codecs. It is simply used |
@@ -271,6 +288,11 @@ static const char kMP4VideoCodecsExpression[] = |
"hev1.1.6.L93.B0," |
#endif |
"mp4a.66,mp4a.67,mp4a.68,mp4a.69,mp4a.6B,mp4a.40.2,mp4a.40.02,mp4a.40.5," |
+#if defined(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
+ "ac-3,ec-3," // Note: only one variant of eac codec string is sufficient |
ddorwin
2015/11/25 22:24:08
Here and above, be consistent with existing text a
servolk
2015/12/03 00:56:15
Done.
|
+ // here since these are converted into enums in |
+ // InitializeMimeTypeMaps |
+#endif |
"mp4a.40.05,mp4a.40.29"; |
// These containers are also included in |
@@ -327,6 +349,14 @@ static const CodecIDMappings kUnambiguousCodecStringMap[] = { |
{"mp4a.40.5", MimeUtil::MPEG4_AAC_SBR_v1}, |
{"mp4a.40.05", MimeUtil::MPEG4_AAC_SBR_v1}, |
{"mp4a.40.29", MimeUtil::MPEG4_AAC_SBR_PS_v2}, |
+#if defined(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
+ {"ac-3", MimeUtil::AC3}, |
+ {"ec-3", MimeUtil::EAC3}, |
ddorwin
2015/11/25 22:24:07
group the codecs together
servolk
2015/12/03 00:56:15
Done.
|
+ {"mp4a.a5", MimeUtil::AC3}, |
+ {"mp4a.A5", MimeUtil::AC3}, |
ddorwin
2015/11/25 22:24:08
Why both cases? Is one not "correct?" With everyth
servolk
2015/12/03 00:56:15
I've copied the comment from the unit test that re
|
+ {"mp4a.a6", MimeUtil::EAC3}, |
+ {"mp4a.A6", MimeUtil::EAC3}, |
+#endif |
{"vorbis", MimeUtil::VORBIS}, |
{"opus", MimeUtil::OPUS}, |
{"vp8", MimeUtil::VP8}, |
@@ -696,6 +726,10 @@ bool MimeUtil::IsCodecSupported(Codec codec) const { |
bool MimeUtil::IsCodecProprietary(Codec codec) const { |
switch (codec) { |
+#if defined(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
ddorwin
2015/11/25 22:24:08
ditto and match order of enum.
servolk
2015/12/03 00:56:15
Done.
|
+ case AC3: |
+ case EAC3: |
+#endif |
case INVALID_CODEC: |
case MP3: |
case MPEG2_AAC_LC: |