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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Used to DCHECK that we are called on the correct thread. | 165 // Used to DCHECK that we are called on the correct thread. |
166 base::ThreadChecker thread_checker_; | 166 base::ThreadChecker thread_checker_; |
167 base::ThreadChecker audio_renderer_thread_checker_; | 167 base::ThreadChecker audio_renderer_thread_checker_; |
168 | 168 |
169 // Flag to keep track the state of the renderer. | 169 // Flag to keep track the state of the renderer. |
170 State state_; | 170 State state_; |
171 | 171 |
172 // media::AudioRendererSink::RenderCallback implementation. | 172 // media::AudioRendererSink::RenderCallback implementation. |
173 // These two methods are called on the AudioOutputDevice worker thread. | 173 // These two methods are called on the AudioOutputDevice worker thread. |
174 int Render(media::AudioBus* audio_bus, | 174 int Render(media::AudioBus* audio_bus, |
175 uint32_t audio_delay_milliseconds, | 175 uint32_t frames_delayed, |
176 uint32_t frames_skipped) override; | 176 uint32_t frames_skipped) override; |
177 void OnRenderError() override; | 177 void OnRenderError() override; |
178 | 178 |
179 // Called by AudioPullFifo when more data is necessary. | 179 // Called by AudioPullFifo when more data is necessary. |
180 // This method is called on the AudioOutputDevice worker thread. | 180 // This method is called on the AudioOutputDevice worker thread. |
181 void SourceCallback(int fifo_frame_delay, media::AudioBus* audio_bus); | 181 void SourceCallback(int fifo_frame_delay, media::AudioBus* audio_bus); |
182 | 182 |
183 // Goes through all renderers for the |source| and applies the proper | 183 // Goes through all renderers for the |source| and applies the proper |
184 // volume scaling for the source based on the volume(s) of the renderer(s). | 184 // volume scaling for the source based on the volume(s) of the renderer(s). |
185 void UpdateSourceVolume(webrtc::AudioSourceInterface* source); | 185 void UpdateSourceVolume(webrtc::AudioSourceInterface* source); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // Used for triggering new UMA histogram. Counts number of render | 264 // Used for triggering new UMA histogram. Counts number of render |
265 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. | 265 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. |
266 int render_callback_count_; | 266 int render_callback_count_; |
267 | 267 |
268 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); | 268 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); |
269 }; | 269 }; |
270 | 270 |
271 } // namespace content | 271 } // namespace content |
272 | 272 |
273 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 273 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
OLD | NEW |