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

Unified Diff: content/renderer/pepper/pepper_platform_audio_output_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_output_impl.cc
diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.cc b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
index ffed20ad081da7e2073b7f794771f1b00e666d5a..ecb833a0475c59bbc835dd678254ef767216aad9 100644
--- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
@@ -22,10 +22,12 @@ namespace content {
PepperPlatformAudioOutputImpl* PepperPlatformAudioOutputImpl::Create(
int sample_rate,
int frames_per_buffer,
+ int source_render_view_id,
webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) {
scoped_refptr<PepperPlatformAudioOutputImpl> audio_output(
new PepperPlatformAudioOutputImpl());
- if (audio_output->Initialize(sample_rate, frames_per_buffer, client)) {
+ if (audio_output->Initialize(sample_rate, frames_per_buffer,
+ source_render_view_id, client)) {
// Balanced by Release invoked in
// PepperPlatformAudioOutputImpl::ShutDownOnIOThread().
return audio_output.release();
@@ -114,11 +116,9 @@ PepperPlatformAudioOutputImpl::PepperPlatformAudioOutputImpl()
bool PepperPlatformAudioOutputImpl::Initialize(
int sample_rate,
int frames_per_buffer,
+ int source_render_view_id,
webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) {
DCHECK(client);
- // Make sure we don't call init more than once.
- DCHECK_EQ(0, stream_id_);
-
client_ = client;
media::AudioParameters::Format format;
@@ -145,14 +145,19 @@ bool PepperPlatformAudioOutputImpl::Initialize(
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&PepperPlatformAudioOutputImpl::InitializeOnIOThread,
- this, params));
+ this, params, source_render_view_id));
return true;
}
void PepperPlatformAudioOutputImpl::InitializeOnIOThread(
- const media::AudioParameters& params) {
+ const media::AudioParameters& params, int source_render_view_id) {
+ // Make sure we don't call init more than once.
+ DCHECK_EQ(0, stream_id_);
stream_id_ = ipc_->AddDelegate(this);
+ DCHECK_NE(0, stream_id_);
+
ipc_->CreateStream(stream_id_, params, 0);
+ ipc_->AssociateStreamWithProducer(stream_id_, source_render_view_id);
}
void PepperPlatformAudioOutputImpl::StartPlaybackOnIOThread() {
« no previous file with comments | « content/renderer/pepper/pepper_platform_audio_output_impl.h ('k') | content/renderer/pepper/pepper_plugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698