| OLD | NEW |
| 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 "media/base/audio_renderer_mixer_input.h" | 5 #include "media/base/audio_renderer_mixer_input.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo() { | 118 OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo() { |
| 119 return mixer_ | 119 return mixer_ |
| 120 ? mixer_->GetOutputDeviceInfo() | 120 ? mixer_->GetOutputDeviceInfo() |
| 121 : mixer_pool_->GetOutputDeviceInfo(owner_id_, 0 /* session_id */, | 121 : mixer_pool_->GetOutputDeviceInfo(owner_id_, 0 /* session_id */, |
| 122 device_id_, security_origin_); | 122 device_id_, security_origin_); |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool AudioRendererMixerInput::CurrentThreadIsRenderingThread() { | 125 bool AudioRendererMixerInput::CurrentThreadIsRenderingThread() { |
| 126 NOTIMPLEMENTED(); | 126 return mixer_->CurrentThreadIsRenderingThread(); |
| 127 return false; | |
| 128 } | 127 } |
| 129 | 128 |
| 130 void AudioRendererMixerInput::SwitchOutputDevice( | 129 void AudioRendererMixerInput::SwitchOutputDevice( |
| 131 const std::string& device_id, | 130 const std::string& device_id, |
| 132 const url::Origin& security_origin, | 131 const url::Origin& security_origin, |
| 133 const OutputDeviceStatusCB& callback) { | 132 const OutputDeviceStatusCB& callback) { |
| 134 if (!mixer_) { | 133 if (!mixer_) { |
| 135 if (pending_switch_callback_.is_null()) { | 134 if (pending_switch_callback_.is_null()) { |
| 136 pending_switch_callback_ = callback; | 135 pending_switch_callback_ = callback; |
| 137 pending_switch_device_id_ = device_id; | 136 pending_switch_device_id_ = device_id; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 base::AutoLock auto_lock(volume_lock_); | 187 base::AutoLock auto_lock(volume_lock_); |
| 189 return frames_filled > 0 ? volume_ : 0; | 188 return frames_filled > 0 ? volume_ : 0; |
| 190 } | 189 } |
| 191 } | 190 } |
| 192 | 191 |
| 193 void AudioRendererMixerInput::OnRenderError() { | 192 void AudioRendererMixerInput::OnRenderError() { |
| 194 callback_->OnRenderError(); | 193 callback_->OnRenderError(); |
| 195 } | 194 } |
| 196 | 195 |
| 197 } // namespace media | 196 } // namespace media |
| OLD | NEW |