diff options
author | dalecurtis <dalecurtis@chromium.org> | 2014-10-29 16:16:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-29 23:16:43 +0000 |
commit | 36c378b881b6a481294800ca1de5390a6136059d (patch) | |
tree | 4bc692379a9f31915cbbb7c78aa022334834e945 /media/mojo | |
parent | df2f025c834e2141ed1cb28a32f40b167dadaa57 (diff) | |
download | chromium_src-36c378b881b6a481294800ca1de5390a6136059d.zip chromium_src-36c378b881b6a481294800ca1de5390a6136059d.tar.gz chromium_src-36c378b881b6a481294800ca1de5390a6136059d.tar.bz2 |
Add documentation to the RendererConfig interface.
Whoops, forgot to add this before submitting the last patch.
BUG=410451
TEST=none
Review URL: https://codereview.chromium.org/645373005
Cr-Commit-Position: refs/heads/master@{#301971}
Diffstat (limited to 'media/mojo')
-rw-r--r-- | media/mojo/services/renderer_config.h | 16 | ||||
-rw-r--r-- | media/mojo/services/renderer_config_default.cc | 7 |
2 files changed, 23 insertions, 0 deletions
diff --git a/media/mojo/services/renderer_config.h b/media/mojo/services/renderer_config.h index e64dd87..409e79c 100644 --- a/media/mojo/services/renderer_config.h +++ b/media/mojo/services/renderer_config.h @@ -15,21 +15,37 @@ namespace media { +// Interface class which clients will extend to override (at compile time) the +// default audio or video rendering configurations for MojoRendererService. class PlatformRendererConfig { public: virtual ~PlatformRendererConfig() {}; + // The list of audio decoders for use with the AudioRenderer. Ownership of + // the decoders is passed to the caller. The methods on each decoder will + // only be called on |media_task_runner|. |media_log_cb| should be used to + // log errors or important status information. virtual ScopedVector<AudioDecoder> GetAudioDecoders( const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, const LogCB& media_log_cb) = 0; + + // The audio output sink used for rendering audio. virtual scoped_refptr<AudioRendererSink> GetAudioRendererSink() = 0; + + // The platform's audio hardware configuration. Note, this must remain + // constant for the lifetime of the PlatformRendererConfig. virtual const AudioHardwareConfig& GetAudioHardwareConfig() = 0; + + // TODO(dalecurtis): Expose methods for retrieving the video decoders. }; class RendererConfig { public: + // Returns an instance of the RenderConfig object. Only one instance will + // exist per process. static RendererConfig* Get(); + // Copy of the PlatformRendererConfig interface. ScopedVector<AudioDecoder> GetAudioDecoders( const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, const LogCB& media_log_cb); diff --git a/media/mojo/services/renderer_config_default.cc b/media/mojo/services/renderer_config_default.cc index ccae590..0d7215f 100644 --- a/media/mojo/services/renderer_config_default.cc +++ b/media/mojo/services/renderer_config_default.cc @@ -19,12 +19,19 @@ namespace internal { class DefaultRendererConfig : public PlatformRendererConfig { public: DefaultRendererConfig() { + // TODO(dalecurtis): This will not work if the process is sandboxed... if (!media::IsMediaLibraryInitialized()) { base::FilePath module_dir; CHECK(PathService::Get(base::DIR_EXE, &module_dir)); CHECK(media::InitializeMediaLibrary(module_dir)); } + // TODO(dalecurtis): We should find a single owner per process for the audio + // manager or make it a lazy instance. It's not safe to call Get()/Create() + // across multiple threads... + // + // TODO(dalecurtis): Eventually we'll want something other than a fake audio + // log factory here too. We should probably at least DVLOG() such info. AudioManager* audio_manager = AudioManager::Get(); if (!audio_manager) audio_manager = media::AudioManager::Create(&fake_audio_log_factory_); |