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 // Audio rendering unit utilizing an AudioRendererSink to output data. | 5 // Audio rendering unit utilizing an AudioRendererSink to output data. |
6 // | 6 // |
7 // This class lives inside three threads during it's lifetime, namely: | 7 // This class lives inside three threads during it's lifetime, namely: |
8 // 1. Render thread | 8 // 1. Render thread |
9 // Where the object is created. | 9 // Where the object is created. |
10 // 2. Media thread (provided via constructor) | 10 // 2. Media thread (provided via constructor) |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 279 |
280 // Set every Render() and used to provide an interpolated time value to | 280 // Set every Render() and used to provide an interpolated time value to |
281 // CurrentMediaTimeForSyncingVideo(). | 281 // CurrentMediaTimeForSyncingVideo(). |
282 base::TimeTicks last_render_time_; | 282 base::TimeTicks last_render_time_; |
283 | 283 |
284 // Set to the value of |last_render_time_| when StopRendering_Locked() is | 284 // Set to the value of |last_render_time_| when StopRendering_Locked() is |
285 // called for any reason. Cleared by the next successful Render() call after | 285 // called for any reason. Cleared by the next successful Render() call after |
286 // being used to adjust for lost time between the last call. | 286 // being used to adjust for lost time between the last call. |
287 base::TimeTicks stop_rendering_time_; | 287 base::TimeTicks stop_rendering_time_; |
288 | 288 |
| 289 // Set when SetMediaTime() is called and used to record the amount of time it |
| 290 // took from seeking to rendering the first frame. |
| 291 base::TimeTicks start_rendering_time_; |
| 292 |
289 // Set upon receipt of the first decoded buffer after a StartPlayingFrom(). | 293 // Set upon receipt of the first decoded buffer after a StartPlayingFrom(). |
290 // Used to determine how long to delay playback. | 294 // Used to determine how long to delay playback. |
291 base::TimeDelta first_packet_timestamp_; | 295 base::TimeDelta first_packet_timestamp_; |
292 | 296 |
293 // Set by OnSuspend() and OnResume() to indicate when the system is about to | 297 // Set by OnSuspend() and OnResume() to indicate when the system is about to |
294 // suspend/is suspended and when it resumes. | 298 // suspend/is suspended and when it resumes. |
295 bool is_suspending_; | 299 bool is_suspending_; |
296 | 300 |
297 // End variables which must be accessed under |lock_|. ---------------------- | 301 // End variables which must be accessed under |lock_|. ---------------------- |
298 | 302 |
299 // NOTE: Weak pointers must be invalidated before all other member variables. | 303 // NOTE: Weak pointers must be invalidated before all other member variables. |
300 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 304 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
301 | 305 |
302 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 306 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
303 }; | 307 }; |
304 | 308 |
305 } // namespace media | 309 } // namespace media |
306 | 310 |
307 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ | 311 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ |
OLD | NEW |