| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |