Index: content/renderer/media/audio_renderer_mixer_manager.cc |
diff --git a/content/renderer/media/audio_renderer_mixer_manager.cc b/content/renderer/media/audio_renderer_mixer_manager.cc |
index c96b83f60b316a42f8806c9869cc40d37e1d8739..61c2e1a6faebd4a2bcab67d2681ebe657027280f 100644 |
--- a/content/renderer/media/audio_renderer_mixer_manager.cc |
+++ b/content/renderer/media/audio_renderer_mixer_manager.cc |
@@ -17,6 +17,31 @@ |
namespace content { |
+// static |
+media::AudioParameters AudioRendererMixerManager::GetOutputHWParams( |
DaleCurtis
2016/02/10 23:25:33
Put this in function order relative to the header
o1ka
2016/02/11 17:18:23
Done.
|
+ int render_frame_id, |
+ int session_id, |
+ const std::string& device_id, |
+ const url::Origin& security_origin) { |
+ media::AudioParameters params; // Invalid parameters to return by default. |
+ |
+ // TODO(olka): first try to lookup an existing device (cached or belonging |
+ // to some mixer) and reuse it. |
DaleCurtis
2016/02/10 23:25:33
Can you file a bug and list it here too?
o1ka
2016/02/11 17:18:23
Done.
|
+ |
+ // AudioOutputDevice is the only interface we have to communicate with output |
+ // device via IPC. So, that's how we get the parameters when there is no |
+ // AudioOutputDevice: |
+ scoped_refptr<media::AudioOutputDevice> device = |
+ AudioDeviceFactory::NewOutputDevice(render_frame_id, session_id, |
+ device_id, security_origin); |
+ |
+ if (device->GetDeviceStatus() == media::OUTPUT_DEVICE_STATUS_OK) |
+ params = device->GetOutputParameters(); |
+ |
+ device->Stop(); // TODO(olka): temporary cash for future reuse. |
+ return params; |
+} |
+ |
AudioRendererMixerManager::AudioRendererMixerManager() |
: sink_for_testing_(nullptr) {} |
@@ -35,7 +60,10 @@ media::AudioRendererMixerInput* AudioRendererMixerManager::CreateInput( |
source_render_frame_id), |
base::Bind(&AudioRendererMixerManager::RemoveMixer, |
base::Unretained(this), source_render_frame_id), |
- device_id, security_origin); |
+ base::Bind(&AudioRendererMixerManager::GetOutputHWParams, |
+ source_render_frame_id, 0), // Session id is 0. |
+ device_id, |
+ security_origin); |
} |
void AudioRendererMixerManager::SetAudioRendererSinkForTesting( |