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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 SourcePlayingStates; | 153 SourcePlayingStates; |
154 | 154 |
155 // Used to DCHECK that we are called on the correct thread. | 155 // Used to DCHECK that we are called on the correct thread. |
156 base::ThreadChecker thread_checker_; | 156 base::ThreadChecker thread_checker_; |
157 | 157 |
158 // Flag to keep track the state of the renderer. | 158 // Flag to keep track the state of the renderer. |
159 State state_; | 159 State state_; |
160 | 160 |
161 // media::AudioRendererSink::RenderCallback implementation. | 161 // media::AudioRendererSink::RenderCallback implementation. |
162 // These two methods are called on the AudioOutputDevice worker thread. | 162 // These two methods are called on the AudioOutputDevice worker thread. |
163 int Render(base::TimeDelta delay, | 163 int Render(media::AudioBus* audio_bus, |
164 base::TimeTicks delay_timestamp, | 164 uint32_t frames_delayed, |
165 int prior_frames_skipped, | 165 uint32_t frames_skipped) override; |
166 media::AudioBus* audio_bus) override; | |
167 void OnRenderError() override; | 166 void OnRenderError() override; |
168 | 167 |
169 // Called by AudioPullFifo when more data is necessary. | 168 // Called by AudioPullFifo when more data is necessary. |
170 // This method is called on the AudioOutputDevice worker thread. | 169 // This method is called on the AudioOutputDevice worker thread. |
171 void SourceCallback(int fifo_frame_delay, media::AudioBus* audio_bus); | 170 void SourceCallback(int fifo_frame_delay, media::AudioBus* audio_bus); |
172 | 171 |
173 // Goes through all renderers for the |source| and applies the proper | 172 // Goes through all renderers for the |source| and applies the proper |
174 // volume scaling for the source based on the volume(s) of the renderer(s). | 173 // volume scaling for the source based on the volume(s) of the renderer(s). |
175 void UpdateSourceVolume(webrtc::AudioSourceInterface* source); | 174 void UpdateSourceVolume(webrtc::AudioSourceInterface* source); |
176 | 175 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 221 |
223 // Ref count for the MediaPlayers which have called Start() but not Stop(). | 222 // Ref count for the MediaPlayers which have called Start() but not Stop(). |
224 int start_ref_count_; | 223 int start_ref_count_; |
225 | 224 |
226 // Used to buffer data between the client and the output device in cases where | 225 // Used to buffer data between the client and the output device in cases where |
227 // the client buffer size is not the same as the output device buffer size. | 226 // the client buffer size is not the same as the output device buffer size. |
228 std::unique_ptr<media::AudioPullFifo> audio_fifo_; | 227 std::unique_ptr<media::AudioPullFifo> audio_fifo_; |
229 | 228 |
230 // Contains the accumulated delay estimate which is provided to the WebRTC | 229 // Contains the accumulated delay estimate which is provided to the WebRTC |
231 // AEC. | 230 // AEC. |
232 base::TimeDelta audio_delay_; | 231 int audio_delay_milliseconds_; |
233 | 232 |
234 base::TimeDelta current_time_; | 233 base::TimeDelta current_time_; |
235 | 234 |
236 // Saved volume and playing state of the root renderer. | 235 // Saved volume and playing state of the root renderer. |
237 PlayingState playing_state_; | 236 PlayingState playing_state_; |
238 | 237 |
239 // Audio params used by the sink of the renderer. | 238 // Audio params used by the sink of the renderer. |
240 media::AudioParameters sink_params_; | 239 media::AudioParameters sink_params_; |
241 | 240 |
242 // The preferred device id of the output device or empty for the default | 241 // The preferred device id of the output device or empty for the default |
(...skipping 11 matching lines...) Expand all Loading... |
254 // Stores the maximum time spent waiting for render data from the source. Used | 253 // Stores the maximum time spent waiting for render data from the source. Used |
255 // for logging UMA data. Logged and reset when Stop() is called. | 254 // for logging UMA data. Logged and reset when Stop() is called. |
256 base::TimeDelta max_render_time_; | 255 base::TimeDelta max_render_time_; |
257 | 256 |
258 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); | 257 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); |
259 }; | 258 }; |
260 | 259 |
261 } // namespace content | 260 } // namespace content |
262 | 261 |
263 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 262 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
OLD | NEW |