| Index: content/browser/renderer_host/media/audio_input_renderer_host.cc
|
| diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc
|
| index 149d4b8b12fd64f9a3f6913d8f75ed91a9567f27..e8c1d1ec4a7a8918b463946118333c0a0fe9715a 100644
|
| --- a/content/browser/renderer_host/media/audio_input_renderer_host.cc
|
| +++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
|
| @@ -174,7 +174,6 @@ bool AudioInputRendererHost::OnMessageReceived(const IPC::Message& message,
|
| IPC_MESSAGE_HANDLER(AudioInputHostMsg_CreateStream, OnCreateStream)
|
| IPC_MESSAGE_HANDLER(AudioInputHostMsg_RecordStream, OnRecordStream)
|
| IPC_MESSAGE_HANDLER(AudioInputHostMsg_CloseStream, OnCloseStream)
|
| - IPC_MESSAGE_HANDLER(AudioInputHostMsg_GetVolume, OnGetVolume)
|
| IPC_MESSAGE_HANDLER(AudioInputHostMsg_SetVolume, OnSetVolume)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP_EX()
|
| @@ -200,7 +199,8 @@ void AudioInputRendererHost::OnStartDevice(int stream_id, int session_id) {
|
|
|
| void AudioInputRendererHost::OnCreateStream(int stream_id,
|
| const AudioParameters& params,
|
| - const std::string& device_id) {
|
| + const std::string& device_id,
|
| + bool automatic_gain_control) {
|
| VLOG(1) << "AudioInputRendererHost::OnCreateStream(stream_id="
|
| << stream_id << ")";
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| @@ -214,9 +214,11 @@ void AudioInputRendererHost::OnCreateStream(int stream_id,
|
| // Create a new AudioEntry structure.
|
| scoped_ptr<AudioEntry> entry(new AudioEntry());
|
|
|
| + uint32 mem_size = sizeof(AudioInputBufferParameters) + packet_size;
|
| +
|
| // Create the shared memory and share it with the renderer process
|
| // using a new SyncWriter object.
|
| - if (!entry->shared_memory.CreateAndMapAnonymous(packet_size)) {
|
| + if (!entry->shared_memory.CreateAndMapAnonymous(mem_size)) {
|
| // If creation of shared memory failed then send an error message.
|
| SendErrorMessage(stream_id);
|
| return;
|
| @@ -248,6 +250,9 @@ void AudioInputRendererHost::OnCreateStream(int stream_id,
|
| return;
|
| }
|
|
|
| + // Set the initial AGC state for the audio input stream.
|
| + entry->controller->SetAutomaticGainControl(automatic_gain_control);
|
| +
|
| // If we have created the controller successfully create a entry and add it
|
| // to the map.
|
| entry->stream_id = stream_id;
|
| @@ -290,21 +295,7 @@ void AudioInputRendererHost::OnSetVolume(int stream_id, double volume) {
|
| return;
|
| }
|
|
|
| - // TODO(henrika): TBI.
|
| - NOTIMPLEMENTED();
|
| -}
|
| -
|
| -void AudioInputRendererHost::OnGetVolume(int stream_id) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| -
|
| - AudioEntry* entry = LookupById(stream_id);
|
| - if (!entry) {
|
| - SendErrorMessage(stream_id);
|
| - return;
|
| - }
|
| -
|
| - // TODO(henrika): TBI.
|
| - NOTIMPLEMENTED();
|
| + entry->controller->SetVolume(volume);
|
| }
|
|
|
| void AudioInputRendererHost::SendErrorMessage(int stream_id) {
|
|
|