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

Side by Side Diff: media/blink/webaudiosourceprovider_impl.cc

Issue 1942803002: Caching AudioOutputDevice instances in mixer manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make WebAudioSourceProvider to always return real sink info reguardless the client - to avoid behavior change. Created 4 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
« no previous file with comments | « media/base/mock_audio_renderer_sink.cc ('k') | media/blink/webmediaplayer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/blink/webaudiosourceprovider_impl.h" 5 #include "media/blink/webaudiosourceprovider_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 bool WebAudioSourceProviderImpl::SetVolume(double volume) { 195 bool WebAudioSourceProviderImpl::SetVolume(double volume) {
196 base::AutoLock auto_lock(sink_lock_); 196 base::AutoLock auto_lock(sink_lock_);
197 volume_ = volume; 197 volume_ = volume;
198 if (!client_) 198 if (!client_)
199 sink_->SetVolume(volume); 199 sink_->SetVolume(volume);
200 return true; 200 return true;
201 } 201 }
202 202
203 media::OutputDeviceInfo WebAudioSourceProviderImpl::GetOutputDeviceInfo() { 203 media::OutputDeviceInfo WebAudioSourceProviderImpl::GetOutputDeviceInfo() {
204 base::AutoLock auto_lock(sink_lock_); 204 base::AutoLock auto_lock(sink_lock_);
205 return client_ ? media::OutputDeviceInfo() : sink_->GetOutputDeviceInfo(); 205 return sink_->GetOutputDeviceInfo();
206 } 206 }
207 207
208 void WebAudioSourceProviderImpl::SwitchOutputDevice( 208 void WebAudioSourceProviderImpl::SwitchOutputDevice(
209 const std::string& device_id, 209 const std::string& device_id,
210 const url::Origin& security_origin, 210 const url::Origin& security_origin,
211 const OutputDeviceStatusCB& callback) { 211 const OutputDeviceStatusCB& callback) {
212 base::AutoLock auto_lock(sink_lock_); 212 base::AutoLock auto_lock(sink_lock_);
213 if (client_) 213 if (client_)
214 callback.Run(media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); 214 callback.Run(media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL);
215 else 215 else
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 271
272 return num_rendered_frames; 272 return num_rendered_frames;
273 } 273 }
274 274
275 void WebAudioSourceProviderImpl::TeeFilter::OnRenderError() { 275 void WebAudioSourceProviderImpl::TeeFilter::OnRenderError() {
276 renderer_->OnRenderError(); 276 renderer_->OnRenderError();
277 } 277 }
278 278
279 } // namespace media 279 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mock_audio_renderer_sink.cc ('k') | media/blink/webmediaplayer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698