Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3926)

Unified Diff: media/filters/stream_parser_factory.cc

Issue 14641006: Support EAC3 (Dolby Digital Plus) codec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Aaron's comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/stream_parser_factory.cc
diff --git a/media/filters/stream_parser_factory.cc b/media/filters/stream_parser_factory.cc
index 93b0e8b3d53da4e02feb345497dbbe4aea075216..8f4a55fe79de9b2f431fc751d9032ebd05cea39e 100644
--- a/media/filters/stream_parser_factory.cc
+++ b/media/filters/stream_parser_factory.cc
@@ -108,6 +108,12 @@ static const CodecInfo kMPEG2AACLCCodecInfo = {
"mp4a.67", CodecInfo::AUDIO, NULL
};
+#if defined(ENABLE_EAC3_PLAYBACK)
+static const CodecInfo kEAC3CodecInfo = {
+ "mp4a.a6", CodecInfo::AUDIO, NULL
+};
+#endif
+
static const CodecInfo* kVideoMP4Codecs[] = {
&kH264CodecInfo,
&kMPEG4AACCodecInfo,
@@ -118,6 +124,9 @@ static const CodecInfo* kVideoMP4Codecs[] = {
static const CodecInfo* kAudioMP4Codecs[] = {
&kMPEG4AACCodecInfo,
&kMPEG2AACLCCodecInfo,
+#if defined(ENABLE_EAC3_PLAYBACK)
+ &kEAC3CodecInfo,
+#endif
NULL
};
@@ -125,6 +134,10 @@ static media::StreamParser* BuildMP4Parser(
const std::vector<std::string>& codecs, const media::LogCB& log_cb) {
std::set<int> audio_object_types;
bool has_sbr = false;
+#if defined(ENABLE_EAC3_PLAYBACK)
+ bool enable_eac3 = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableEac3Playback);
+#endif
for (size_t i = 0; i < codecs.size(); ++i) {
std::string codec_id = codecs[i];
if (MatchPattern(codec_id, kMPEG2AACLCCodecInfo.pattern)) {
@@ -139,6 +152,10 @@ static media::StreamParser* BuildMP4Parser(
has_sbr = true;
break;
}
+#if defined(ENABLE_EAC3_PLAYBACK)
+ } else if (enable_eac3 && MatchPattern(codec_id, kEAC3CodecInfo.pattern)) {
+ audio_object_types.insert(media::mp4::kEAC3);
+#endif
}
}
@@ -204,6 +221,12 @@ static bool IsSupported(const std::string& type,
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
switch (codec_type) {
case CodecInfo::AUDIO:
+#if defined(ENABLE_EAC3_PLAYBACK)
+ if (MatchPattern(codec_id, kEAC3CodecInfo.pattern) &&
+ !cmd_line->HasSwitch(switches::kEnableEac3Playback)) {
+ return false;
+ }
+#endif
*has_audio = true;
break;
case CodecInfo::VIDEO:
« no previous file with comments | « media/base/media_switches.cc ('k') | media/media.gyp » ('j') | media/mp4/mp4_stream_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698