| 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.h" | 5 #include "media/base/audio_renderer_mixer.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 return; | 108 return; |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 // An error callback should always exist when called. | 112 // An error callback should always exist when called. |
| 113 NOTREACHED(); | 113 NOTREACHED(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() { | 116 OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() { |
| 117 DVLOG(1) << __FUNCTION__; | 117 DVLOG(1) << __FUNCTION__; |
| 118 base::AutoLock auto_lock(lock_); | |
| 119 return audio_sink_->GetOutputDeviceInfo(); | 118 return audio_sink_->GetOutputDeviceInfo(); |
| 120 } | 119 } |
| 121 | 120 |
| 122 int AudioRendererMixer::Render(AudioBus* audio_bus, | 121 int AudioRendererMixer::Render(AudioBus* audio_bus, |
| 123 uint32_t frames_delayed, | 122 uint32_t frames_delayed, |
| 124 uint32_t frames_skipped) { | 123 uint32_t frames_skipped) { |
| 125 base::AutoLock auto_lock(lock_); | 124 base::AutoLock auto_lock(lock_); |
| 126 | 125 |
| 127 // If there are no mixer inputs and we haven't seen one for a while, pause the | 126 // If there are no mixer inputs and we haven't seen one for a while, pause the |
| 128 // sink to avoid wasting resources when media elements are present but remain | 127 // sink to avoid wasting resources when media elements are present but remain |
| (...skipping 11 matching lines...) Expand all Loading... |
| 140 } | 139 } |
| 141 | 140 |
| 142 void AudioRendererMixer::OnRenderError() { | 141 void AudioRendererMixer::OnRenderError() { |
| 143 // Call each mixer input and signal an error. | 142 // Call each mixer input and signal an error. |
| 144 base::AutoLock auto_lock(lock_); | 143 base::AutoLock auto_lock(lock_); |
| 145 for (const auto& cb : error_callbacks_) | 144 for (const auto& cb : error_callbacks_) |
| 146 cb.Run(); | 145 cb.Run(); |
| 147 } | 146 } |
| 148 | 147 |
| 149 } // namespace media | 148 } // namespace media |
| OLD | NEW |