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

Side by Side Diff: content/renderer/pepper/pepper_platform_audio_input_impl.cc

Issue 9702019: Adds Analog Gain Control (AGC) to the WebRTC client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 9 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/pepper/pepper_platform_audio_input_impl.h" 5 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return; 120 return;
121 121
122 // Make sure we don't call init more than once. 122 // Make sure we don't call init more than once.
123 DCHECK_EQ(0, stream_id_); 123 DCHECK_EQ(0, stream_id_);
124 stream_id_ = filter_->AddDelegate(this); 124 stream_id_ = filter_->AddDelegate(this);
125 DCHECK_NE(0, stream_id_); 125 DCHECK_NE(0, stream_id_);
126 126
127 if (!session_id) { 127 if (!session_id) {
128 // We will be notified by OnStreamCreated(). 128 // We will be notified by OnStreamCreated().
129 filter_->Send(new AudioInputHostMsg_CreateStream( 129 filter_->Send(new AudioInputHostMsg_CreateStream(
130 stream_id_, params_, AudioManagerBase::kDefaultDeviceId)); 130 stream_id_, params_, AudioManagerBase::kDefaultDeviceId, false));
131 } else { 131 } else {
132 // We will be notified by OnDeviceReady(). 132 // We will be notified by OnDeviceReady().
133 filter_->Send(new AudioInputHostMsg_StartDevice(stream_id_, session_id)); 133 filter_->Send(new AudioInputHostMsg_StartDevice(stream_id_, session_id));
134 } 134 }
135 } 135 }
136 136
137 void PepperPlatformAudioInputImpl::StartCaptureOnIOThread() { 137 void PepperPlatformAudioInputImpl::StartCaptureOnIOThread() {
138 DCHECK(ChildProcess::current()->io_message_loop_proxy()-> 138 DCHECK(ChildProcess::current()->io_message_loop_proxy()->
139 BelongsToCurrentThread()); 139 BelongsToCurrentThread());
140 140
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return; 222 return;
223 223
224 if (device_id.empty()) { 224 if (device_id.empty()) {
225 main_message_loop_proxy_->PostTask( 225 main_message_loop_proxy_->PostTask(
226 FROM_HERE, 226 FROM_HERE,
227 base::Bind(&PepperPlatformAudioInputImpl::NotifyStreamCreationFailed, 227 base::Bind(&PepperPlatformAudioInputImpl::NotifyStreamCreationFailed,
228 this)); 228 this));
229 } else { 229 } else {
230 // We will be notified by OnStreamCreated(). 230 // We will be notified by OnStreamCreated().
231 filter_->Send(new AudioInputHostMsg_CreateStream(stream_id_, params_, 231 filter_->Send(new AudioInputHostMsg_CreateStream(stream_id_, params_,
232 device_id)); 232 device_id, false));
233 } 233 }
234 } 234 }
235 235
236 void PepperPlatformAudioInputImpl::OnDeviceOpened(int request_id, 236 void PepperPlatformAudioInputImpl::OnDeviceOpened(int request_id,
237 bool succeeded, 237 bool succeeded,
238 const std::string& label) { 238 const std::string& label) {
239 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); 239 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread());
240 240
241 if (succeeded && plugin_delegate_) { 241 if (succeeded && plugin_delegate_) {
242 DCHECK(!label.empty()); 242 DCHECK(!label.empty());
(...skipping 23 matching lines...) Expand all
266 label_.clear(); 266 label_.clear();
267 } 267 }
268 } 268 }
269 269
270 void PepperPlatformAudioInputImpl::NotifyStreamCreationFailed() { 270 void PepperPlatformAudioInputImpl::NotifyStreamCreationFailed() {
271 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); 271 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread());
272 272
273 if (client_) 273 if (client_)
274 client_->StreamCreationFailed(); 274 client_->StreamCreationFailed();
275 } 275 }
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_device_unittest.cc ('k') | media/audio/audio_input_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698