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

Side by Side Diff: content/renderer/pepper/pepper_platform_audio_output_impl.cc

Issue 15979015: Reland 15721002: Hook up the device selection to the WebAudio live audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the comments. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h" 5 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 FROM_HERE, 131 FROM_HERE,
132 base::Bind(&PepperPlatformAudioOutputImpl::InitializeOnIOThread, 132 base::Bind(&PepperPlatformAudioOutputImpl::InitializeOnIOThread,
133 this, params)); 133 this, params));
134 return true; 134 return true;
135 } 135 }
136 136
137 void PepperPlatformAudioOutputImpl::InitializeOnIOThread( 137 void PepperPlatformAudioOutputImpl::InitializeOnIOThread(
138 const media::AudioParameters& params) { 138 const media::AudioParameters& params) {
139 DCHECK(ChildProcess::current()->io_message_loop_proxy()-> 139 DCHECK(ChildProcess::current()->io_message_loop_proxy()->
140 BelongsToCurrentThread()); 140 BelongsToCurrentThread());
141 const int kSessionId = 0;
141 if (ipc_) 142 if (ipc_)
142 ipc_->CreateStream(this, params); 143 ipc_->CreateStream(this, params, kSessionId);
143 } 144 }
144 145
145 void PepperPlatformAudioOutputImpl::StartPlaybackOnIOThread() { 146 void PepperPlatformAudioOutputImpl::StartPlaybackOnIOThread() {
146 DCHECK(ChildProcess::current()->io_message_loop_proxy()-> 147 DCHECK(ChildProcess::current()->io_message_loop_proxy()->
147 BelongsToCurrentThread()); 148 BelongsToCurrentThread());
148 if (ipc_) 149 if (ipc_)
149 ipc_->PlayStream(); 150 ipc_->PlayStream();
150 } 151 }
151 152
152 void PepperPlatformAudioOutputImpl::StopPlaybackOnIOThread() { 153 void PepperPlatformAudioOutputImpl::StopPlaybackOnIOThread() {
(...skipping 12 matching lines...) Expand all
165 return; 166 return;
166 167
167 ipc_->CloseStream(); 168 ipc_->CloseStream();
168 ipc_.reset(); 169 ipc_.reset();
169 170
170 Release(); // Release for the delegate, balances out the reference taken in 171 Release(); // Release for the delegate, balances out the reference taken in
171 // PepperPluginDelegateImpl::CreateAudio. 172 // PepperPluginDelegateImpl::CreateAudio.
172 } 173 }
173 174
174 } // namespace content 175 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698