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