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

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: fixed the nits. 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..808a5df3ada00731d6760ac673a96abd2357eb38 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 creates a stream using the
+ // default device. Remove it once Pepper completely switches to
+ // OpenDevice().
yzshen1 2013/03/15 18:21:03 What do you mean by "Pepper completely switches to
no longer working on chromium 2013/03/15 19:16:48 We don't want clients to be able to open the defau
yzshen1 2013/03/15 21:47:48 Just out of curiosity: Do we have a way to specify
no longer working on chromium 2013/03/15 21:57:43 Yes, just pass AudioManagerBase::kDefaultDeviceId
yzshen1 2013/03/15 22:06:04 Either way. It sounds good if you change it direc
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);
yzshen1 2013/03/15 18:21:03 This ignores |session_id| if it comes from OnDevic
no longer working on chromium 2013/03/15 19:16:48 We don't ignore the session_id, it is just moved t
yzshen1 2013/03/15 21:47:48 I see. :) Sorry for not reading carefully enough.
no longer working on chromium 2013/03/15 21:57:43 No problem.
}
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