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

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

Issue 11359196: Associate audio streams with their source/destination RenderView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Plus, removed CalledOnValidThread DCHECK from sampleRate() call since nothing mutates. Created 8 years 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
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 94b9e922ce74af4840c8a0e5b6ab575c48e22221..c1545798f14e8af4603a55439300bdd2a608e96d 100644
--- a/content/renderer/pepper/pepper_platform_audio_input_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_input_impl.cc
@@ -10,6 +10,7 @@
#include "build/build_config.h"
#include "content/common/child_process.h"
#include "content/common/media/audio_messages.h"
+#include "content/renderer/media/audio_input_message_filter.h"
#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "media/audio/audio_manager_base.h"
@@ -138,6 +139,7 @@ PepperPlatformAudioInputImpl::~PepperPlatformAudioInputImpl() {
PepperPlatformAudioInputImpl::PepperPlatformAudioInputImpl()
: client_(NULL),
stream_id_(0),
+ render_view_id_(MSG_ROUTING_NONE),
main_message_loop_proxy_(base::MessageLoopProxy::current()),
shutdown_called_(false) {
ipc_ = RenderThreadImpl::current()->audio_input_message_filter();
@@ -155,6 +157,7 @@ bool PepperPlatformAudioInputImpl::Initialize(
return false;
plugin_delegate_ = plugin_delegate;
+ render_view_id_ = plugin_delegate_->GetRoutingID();
client_ = client;
params_.Reset(media::AudioParameters::AUDIO_PCM_LINEAR,
@@ -202,8 +205,10 @@ void PepperPlatformAudioInputImpl::StartCaptureOnIOThread() {
DCHECK(ChildProcess::current()->io_message_loop_proxy()->
BelongsToCurrentThread());
- if (stream_id_)
+ if (stream_id_) {
+ ipc_->AssociateStreamWithConsumer(stream_id_, render_view_id_);
ipc_->RecordStream(stream_id_);
+ }
}
void PepperPlatformAudioInputImpl::StopCaptureOnIOThread() {

Powered by Google App Engine
This is Rietveld 408576698