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

Unified Diff: content/renderer/pepper/pepper_platform_audio_input_impl.cc

Issue 12440027: Do not pass the string device_id via IPC message to create an audio input stream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Per's comments. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/pepper_platform_audio_input_impl.h ('k') | media/audio/audio_input_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4534f337bb8214bd474c6d097fc43ff124eba793..f71b64299001fa48636eb03275e37debbfaa1b10 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;
}
@@ -168,19 +150,13 @@ bool PepperPlatformAudioInputImpl::Initialize(
media::CHANNEL_LAYOUT_MONO, 1, 0,
sample_rate, 16, frames_per_buffer);
- if (device_id.empty()) {
- // Use the default device.
- ChildProcess::current()->io_message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread,
- this, 0));
- } else {
- // We need to open the device and obtain the label and session ID before
- // initializing.
- plugin_delegate_->OpenDevice(
- PP_DEVICETYPE_DEV_AUDIOCAPTURE, device_id,
- base::Bind(&PepperPlatformAudioInputImpl::OnDeviceOpened, this));
- }
+ // We need to open the device and obtain the label and session ID before
+ // initializing.
+ plugin_delegate_->OpenDevice(
+ PP_DEVICETYPE_DEV_AUDIOCAPTURE,
+ device_id.empty() ? media::AudioManagerBase::kDefaultDeviceId : device_id,
+ base::Bind(&PepperPlatformAudioInputImpl::OnDeviceOpened, this));
+
return true;
}
@@ -196,14 +172,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() {
« no previous file with comments | « content/renderer/pepper/pepper_platform_audio_input_impl.h ('k') | media/audio/audio_input_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698