Index: content/browser/renderer_host/media/audio_renderer_host.cc |
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc |
index 1e1065aca5e225a3d75ca4f006553ece32771cff..704db645947677620b53e42944822c14c30943b4 100644 |
--- a/content/browser/renderer_host/media/audio_renderer_host.cc |
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc |
@@ -36,6 +36,7 @@ class AudioRendererHost::AudioEntry |
int stream_id, |
int render_view_id, |
const media::AudioParameters& params, |
+ const std::string& output_device_id, |
const std::string& input_device_id, |
scoped_ptr<base::SharedMemory> shared_memory, |
scoped_ptr<media::AudioOutputController::SyncReader> reader); |
@@ -88,6 +89,7 @@ class AudioRendererHost::AudioEntry |
AudioRendererHost::AudioEntry::AudioEntry( |
AudioRendererHost* host, int stream_id, int render_view_id, |
const media::AudioParameters& params, |
+ const std::string& output_device_id, |
const std::string& input_device_id, |
scoped_ptr<base::SharedMemory> shared_memory, |
scoped_ptr<media::AudioOutputController::SyncReader> reader) |
@@ -95,8 +97,7 @@ AudioRendererHost::AudioEntry::AudioEntry( |
stream_id_(stream_id), |
render_view_id_(render_view_id), |
controller_(media::AudioOutputController::Create( |
- // TODO(tommi): Feed in the proper output device id. |
- host->audio_manager_, this, params, std::string(), |
+ host->audio_manager_, this, params, output_device_id, |
input_device_id, reader.get())), |
shared_memory_(shared_memory.Pass()), |
reader_(reader.Pass()) { |
@@ -303,10 +304,13 @@ void AudioRendererHost::OnCreateStream( |
// When the |input_channels| is valid, clients are trying to create a unified |
// IO stream which opens an input device mapping to the |session_id|. |
- std::string input_device_id; |
+ std::string input_device_id, output_device_id; |
Jói
2013/09/06 14:49:26
output_device_id will be empty if there is no info
tommi (sloooow) - chröme
2013/09/06 16:56:54
Yes, that's intentional. Added comments to explain
|
+ const StreamDeviceInfo* info = media_stream_manager_-> |
+ audio_input_device_manager()->GetOpenedDeviceInfoById(session_id); |
+ if (info) |
+ output_device_id = info->device.matched_output_device_id; |
+ |
if (input_channels > 0) { |
- const StreamDeviceInfo* info = media_stream_manager_-> |
- audio_input_device_manager()->GetOpenedDeviceInfoById(session_id); |
if (!info) { |
SendErrorMessage(stream_id); |
DLOG(WARNING) << "No permission has been granted to input stream with " |
@@ -348,8 +352,8 @@ void AudioRendererHost::OnCreateStream( |
media_observer->OnCreatingAudioStream(render_process_id_, render_view_id); |
scoped_ptr<AudioEntry> entry(new AudioEntry( |
- this, stream_id, render_view_id, params, input_device_id, |
- shared_memory.Pass(), |
+ this, stream_id, render_view_id, params, output_device_id, |
+ input_device_id, shared_memory.Pass(), |
reader.PassAs<media::AudioOutputController::SyncReader>())); |
if (mirroring_manager_) { |
mirroring_manager_->AddDiverter( |