summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 19:56:14 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 19:56:14 +0000
commit963ab9193e807a07463767c3bdb76c1393dd761e (patch)
treea45a94c4659539ca61063c3dbc3bd09793ca17c4 /media
parentb0b567bf6e3b7d1270bbd4b21bd39cdcb8d4c9da (diff)
downloadchromium_src-963ab9193e807a07463767c3bdb76c1393dd761e.zip
chromium_src-963ab9193e807a07463767c3bdb76c1393dd761e.tar.gz
chromium_src-963ab9193e807a07463767c3bdb76c1393dd761e.tar.bz2
Switches to enable OpenMAX for video decoding in Chrome
Added a --enable-openmax switch to enable OpenMAX for video decoding. Review URL: http://codereview.chromium.org/555046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36883 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/media_switches.cc3
-rw-r--r--media/base/media_switches.h3
-rw-r--r--media/filters/ffmpeg_demuxer.cc4
-rw-r--r--media/tools/player_x11/player_x11.cc4
4 files changed, 9 insertions, 5 deletions
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index 1295eb2..1179f03 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -11,6 +11,7 @@ namespace switches {
const char kAlsaDevice[] = "alsa-device";
#endif
-const char kVideoH264Annexb[] = "video-h264-annexb";
+const char kEnableH264AnnexbFilter[] = "enable-h264-annexb-filter";
+const char kEnableOpenMax[] = "enable-openmax";
} // namespace switches
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
index 86773bd..e99ba27 100644
--- a/media/base/media_switches.h
+++ b/media/base/media_switches.h
@@ -15,7 +15,8 @@ namespace switches {
extern const char kAlsaDevice[];
#endif
-extern const char kVideoH264Annexb[];
+extern const char kEnableH264AnnexbFilter[];
+extern const char kEnableOpenMax[];
} // namespace switches
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 6e1c1fb..5b48cbd 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -491,11 +491,11 @@ void FFmpegDemuxer::DemuxTask() {
DCHECK_LT(packet->stream_index, static_cast<int>(packet_streams_.size()));
FFmpegDemuxerStream* demuxer_stream = packet_streams_[packet->stream_index];
if (demuxer_stream) {
- using switches::kVideoH264Annexb;
+ using switches::kEnableH264AnnexbFilter;
AVCodecContext* stream_context =
format_context_->streams[packet->stream_index]->codec;
if (stream_context->codec_id == CODEC_ID_H264 &&
- CommandLine::ForCurrentProcess()->HasSwitch(kVideoH264Annexb)) {
+ CommandLine::ForCurrentProcess()->HasSwitch(kEnableH264AnnexbFilter)) {
// TODO(ajwong): Unittest this branch of the if statement.
// Also, move this code into the FFmpegDemuxerStream, so that the decoder
// can enable a filter in the stream as needed.
diff --git a/media/tools/player_x11/player_x11.cc b/media/tools/player_x11/player_x11.cc
index a734574..53aefea 100644
--- a/media/tools/player_x11/player_x11.cc
+++ b/media/tools/player_x11/player_x11.cc
@@ -12,6 +12,7 @@
#include "base/scoped_ptr.h"
#include "base/thread.h"
#include "media/base/media.h"
+#include "media/base/media_switches.h"
#include "media/base/pipeline_impl.h"
#include "media/filters/audio_renderer_impl.h"
#include "media/filters/ffmpeg_audio_decoder.h"
@@ -65,7 +66,8 @@ bool InitPipeline(MessageLoop* message_loop,
factories->AddFactory(media::FileDataSource::CreateFactory());
factories->AddFactory(media::FFmpegAudioDecoder::CreateFactory());
factories->AddFactory(media::FFmpegDemuxer::CreateFilterFactory());
- if (CommandLine::ForCurrentProcess()->HasSwitch("use-omx")) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableOpenMax)) {
factories->AddFactory(media::OmxVideoDecoder::CreateFactory());
}
factories->AddFactory(media::FFmpegVideoDecoder::CreateFactory());