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

Side by Side Diff: media/mojo/services/renderer_config_default.cc

Issue 684963003: Add support for external video renderers in mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_config
Patch Set: More MSVC... Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « media/mojo/services/renderer_config.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mojo/services/renderer_config.h" 5 #include "media/mojo/services/renderer_config.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "media/audio/audio_manager_base.h" 9 #include "media/audio/audio_manager_base.h"
10 #include "media/audio/audio_output_stream_sink.h" 10 #include "media/audio/audio_output_stream_sink.h"
11 #include "media/audio/fake_audio_log_factory.h" 11 #include "media/audio/fake_audio_log_factory.h"
12 #include "media/base/media.h" 12 #include "media/base/media.h"
13 #include "media/filters/opus_audio_decoder.h"
14
15 #if !defined(OS_ANDROID)
13 #include "media/filters/ffmpeg_audio_decoder.h" 16 #include "media/filters/ffmpeg_audio_decoder.h"
14 #include "media/filters/opus_audio_decoder.h" 17 #include "media/filters/ffmpeg_video_decoder.h"
18 #endif
19
20 #if !defined(MEDIA_DISABLE_LIBVPX)
21 #include "media/filters/vpx_video_decoder.h"
22 #endif
15 23
16 namespace media { 24 namespace media {
17 namespace internal { 25 namespace internal {
18 26
19 class DefaultRendererConfig : public PlatformRendererConfig { 27 class DefaultRendererConfig : public PlatformRendererConfig {
20 public: 28 public:
21 DefaultRendererConfig() { 29 DefaultRendererConfig() {
22 // TODO(dalecurtis): This will not work if the process is sandboxed... 30 // TODO(dalecurtis): This will not work if the process is sandboxed...
23 if (!media::IsMediaLibraryInitialized()) { 31 if (!media::IsMediaLibraryInitialized()) {
24 base::FilePath module_dir; 32 base::FilePath module_dir;
(...skipping 24 matching lines...) Expand all
49 57
50 #if !defined(OS_ANDROID) 58 #if !defined(OS_ANDROID)
51 audio_decoders.push_back( 59 audio_decoders.push_back(
52 new FFmpegAudioDecoder(media_task_runner, media_log_cb)); 60 new FFmpegAudioDecoder(media_task_runner, media_log_cb));
53 audio_decoders.push_back(new OpusAudioDecoder(media_task_runner)); 61 audio_decoders.push_back(new OpusAudioDecoder(media_task_runner));
54 #endif 62 #endif
55 63
56 return audio_decoders.Pass(); 64 return audio_decoders.Pass();
57 } 65 }
58 66
67 ScopedVector<VideoDecoder> GetVideoDecoders(
68 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
69 const LogCB& media_log_cb) override {
70 ScopedVector<VideoDecoder> video_decoders;
71
72 // TODO(dalecurtis): If we ever need GPU video decoders, we'll need to
73 // figure out how to retrieve the GpuVideoAcceleratorFactories...
74
75 #if !defined(MEDIA_DISABLE_LIBVPX)
76 video_decoders.push_back(new VpxVideoDecoder(media_task_runner));
77 #endif // !defined(MEDIA_DISABLE_LIBVPX)
78
79 #if !defined(OS_ANDROID)
80 video_decoders.push_back(new FFmpegVideoDecoder(media_task_runner));
81 #endif
82
83 return video_decoders.Pass();
84 }
85
59 scoped_refptr<AudioRendererSink> GetAudioRendererSink() override { 86 scoped_refptr<AudioRendererSink> GetAudioRendererSink() override {
60 return new AudioOutputStreamSink(); 87 return new AudioOutputStreamSink();
61 } 88 }
62 89
63 const AudioHardwareConfig& GetAudioHardwareConfig() override { 90 const AudioHardwareConfig& GetAudioHardwareConfig() override {
64 return *audio_hardware_config_; 91 return *audio_hardware_config_;
65 } 92 }
66 93
67 private: 94 private:
68 FakeAudioLogFactory fake_audio_log_factory_; 95 FakeAudioLogFactory fake_audio_log_factory_;
69 scoped_ptr<AudioHardwareConfig> audio_hardware_config_; 96 scoped_ptr<AudioHardwareConfig> audio_hardware_config_;
70 97
71 DISALLOW_COPY_AND_ASSIGN(DefaultRendererConfig); 98 DISALLOW_COPY_AND_ASSIGN(DefaultRendererConfig);
72 }; 99 };
73 100
74 scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig() { 101 scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig() {
75 return make_scoped_ptr(new DefaultRendererConfig()); 102 return make_scoped_ptr(new DefaultRendererConfig());
76 } 103 }
77 104
78 } // namespace internal 105 } // namespace internal
79 } // namespace media 106 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/renderer_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698