Index: media/tools/player_x11/player_x11.cc |
=================================================================== |
--- media/tools/player_x11/player_x11.cc (revision 87792) |
+++ media/tools/player_x11/player_x11.cc (working copy) |
@@ -26,6 +26,7 @@ |
#include "media/filters/ffmpeg_video_decoder.h" |
#include "media/filters/file_data_source_factory.h" |
#include "media/filters/null_audio_renderer.h" |
+#include "media/filters/omx_video_decoder.h" |
// TODO(jiesun): implement different video decode contexts according to |
// these flags. e.g. |
@@ -94,6 +95,14 @@ |
scoped_refptr<media::PipelineImpl>* pipeline, |
MessageLoop* paint_message_loop, |
media::MessageLoopFactory* message_loop_factory) { |
+ // Initialize OpenMAX. |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableOpenMax) && |
+ !media::InitializeOpenMaxLibrary(FilePath())) { |
+ std::cout << "Unable to initialize OpenMAX library."<< std::endl; |
+ return false; |
+ } |
+ |
// Load media libraries. |
if (!media::InitializeMediaLibrary(FilePath())) { |
std::cout << "Unable to initialize the media library." << std::endl; |
@@ -109,9 +118,16 @@ |
new media::FileDataSourceFactory(), message_loop))); |
collection->AddAudioDecoder(new media::FFmpegAudioDecoder( |
message_loop_factory->GetMessageLoop("AudioDecoderThread"))); |
- collection->AddVideoDecoder(new media::FFmpegVideoDecoder( |
- message_loop_factory->GetMessageLoop("VideoDecoderThread"), |
- NULL)); |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableOpenMax)) { |
+ collection->AddVideoDecoder(new media::OmxVideoDecoder( |
+ message_loop_factory->GetMessageLoop("VideoDecoderThread"), |
+ NULL)); |
+ } else { |
+ collection->AddVideoDecoder(new media::FFmpegVideoDecoder( |
+ message_loop_factory->GetMessageLoop("VideoDecoderThread"), |
+ NULL)); |
+ } |
collection->AddVideoRenderer(new Renderer(g_display, |
g_window, |
paint_message_loop)); |
@@ -218,6 +234,7 @@ |
std::cout << "Usage: " << argv[0] << " --file=FILE" << std::endl |
<< std::endl |
<< "Optional arguments:" << std::endl |
+ << " [--enable-openmax]" |
<< " [--audio]" |
<< " [--alsa-device=DEVICE]" << std::endl |
<< " Press [ESC] to stop" << std::endl |