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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (it->Equals(error_cb)) { | 105 if (it->Equals(error_cb)) { |
106 error_callbacks_.erase(it); | 106 error_callbacks_.erase(it); |
107 return; | 107 return; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 // An error callback should always exist when called. | 111 // An error callback should always exist when called. |
112 NOTREACHED(); | 112 NOTREACHED(); |
113 } | 113 } |
114 | 114 |
115 OutputDevice* AudioRendererMixer::GetOutputDevice() { | 115 OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() { |
116 DVLOG(1) << __FUNCTION__; | 116 DVLOG(1) << __FUNCTION__; |
117 base::AutoLock auto_lock(lock_); | 117 base::AutoLock auto_lock(lock_); |
118 return audio_sink_->GetOutputDevice(); | 118 return audio_sink_->GetOutputDeviceInfo(); |
119 } | 119 } |
120 | 120 |
121 int AudioRendererMixer::Render(AudioBus* audio_bus, | 121 int AudioRendererMixer::Render(AudioBus* audio_bus, |
122 uint32_t frames_delayed, | 122 uint32_t frames_delayed, |
123 uint32_t frames_skipped) { | 123 uint32_t frames_skipped) { |
124 base::AutoLock auto_lock(lock_); | 124 base::AutoLock auto_lock(lock_); |
125 | 125 |
126 // 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 |
127 // 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 |
128 // in the pause state. | 128 // in the pause state. |
(...skipping 16 matching lines...) Expand all Loading... |
145 } | 145 } |
146 | 146 |
147 void AudioRendererMixer::OnRenderError() { | 147 void AudioRendererMixer::OnRenderError() { |
148 // Call each mixer input and signal an error. | 148 // Call each mixer input and signal an error. |
149 base::AutoLock auto_lock(lock_); | 149 base::AutoLock auto_lock(lock_); |
150 for (const auto& cb : error_callbacks_) | 150 for (const auto& cb : error_callbacks_) |
151 cb.Run(); | 151 cb.Run(); |
152 } | 152 } |
153 | 153 |
154 } // namespace media | 154 } // namespace media |
OLD | NEW |