Index: content/renderer/pepper/pepper_platform_audio_input_impl.cc |
diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.cc b/content/renderer/pepper/pepper_platform_audio_input_impl.cc |
index 6351768d4b664b750a78c5e25fc073a05cfb2b98..03047ae9f5c844659ac91c45774e474439a93c48 100644 |
--- a/content/renderer/pepper/pepper_platform_audio_input_impl.cc |
+++ b/content/renderer/pepper/pepper_platform_audio_input_impl.cc |
@@ -106,24 +106,6 @@ void PepperPlatformAudioInputImpl::OnStateChanged( |
media::AudioInputIPCDelegate::State state) { |
} |
-void PepperPlatformAudioInputImpl::OnDeviceReady(const std::string& device_id) { |
- DCHECK(ChildProcess::current()->io_message_loop_proxy()-> |
- BelongsToCurrentThread()); |
- |
- if (shutdown_called_) |
- return; |
- |
- if (device_id.empty()) { |
- main_message_loop_proxy_->PostTask( |
- FROM_HERE, |
- base::Bind(&PepperPlatformAudioInputImpl::NotifyStreamCreationFailed, |
- this)); |
- } else { |
- // We will be notified by OnStreamCreated(). |
- ipc_->CreateStream(stream_id_, params_, device_id, false, 1); |
- } |
-} |
- |
void PepperPlatformAudioInputImpl::OnIPCClosed() { |
ipc_ = NULL; |
} |
@@ -169,11 +151,13 @@ bool PepperPlatformAudioInputImpl::Initialize( |
sample_rate, 16, frames_per_buffer); |
if (device_id.empty()) { |
- // Use the default device. |
+ // TODO(xians): this bypasses the permission and create a stream using the |
palmer
2013/03/14 21:05:14
NIT: Grammar and punctuation.
"This bypasses... a
no longer working on chromium
2013/03/15 14:52:11
Done.
|
+ // default device, we should remove it once Pepper completely switches to |
+ // OpenDevice(). |
ChildProcess::current()->io_message_loop()->PostTask( |
FROM_HERE, |
base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread, |
- this, 0)); |
+ this, 1)); |
} else { |
// We need to open the device and obtain the label and session ID before |
// initializing. |
@@ -196,14 +180,8 @@ void PepperPlatformAudioInputImpl::InitializeOnIOThread(int session_id) { |
stream_id_ = ipc_->AddDelegate(this); |
DCHECK_NE(0, stream_id_); |
- if (!session_id) { |
- // We will be notified by OnStreamCreated(). |
- ipc_->CreateStream(stream_id_, params_, |
- media::AudioManagerBase::kDefaultDeviceId, false, 1); |
- } else { |
- // We will be notified by OnDeviceReady(). |
- ipc_->StartDevice(stream_id_, session_id); |
- } |
+ // We will be notified by OnStreamCreated(). |
+ ipc_->CreateStream(stream_id_, session_id, params_, false, 1); |
} |
void PepperPlatformAudioInputImpl::StartCaptureOnIOThread() { |