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 MEDIA_BASE_PIPELINE_H_ | 5 #ifndef MEDIA_BASE_PIPELINE_H_ |
6 #define MEDIA_BASE_PIPELINE_H_ | 6 #define MEDIA_BASE_PIPELINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // TODO(scherkus): Prerolling should be separate from seeking so we can report | 302 // TODO(scherkus): Prerolling should be separate from seeking so we can report |
303 // finer grained ready states (HAVE_CURRENT_DATA vs. HAVE_FUTURE_DATA) | 303 // finer grained ready states (HAVE_CURRENT_DATA vs. HAVE_FUTURE_DATA) |
304 // indepentent from seeking. | 304 // indepentent from seeking. |
305 void DoSeek(base::TimeDelta seek_timestamp, const PipelineStatusCB& done_cb); | 305 void DoSeek(base::TimeDelta seek_timestamp, const PipelineStatusCB& done_cb); |
306 | 306 |
307 // Initiates an asynchronous pause-flush-stop call sequence executing | 307 // Initiates an asynchronous pause-flush-stop call sequence executing |
308 // |done_cb| when completed. | 308 // |done_cb| when completed. |
309 void DoStop(const PipelineStatusCB& done_cb); | 309 void DoStop(const PipelineStatusCB& done_cb); |
310 void OnStopCompleted(PipelineStatus status); | 310 void OnStopCompleted(PipelineStatus status); |
311 | 311 |
| 312 void OnAudioUnderflow(); |
| 313 |
312 // Collection of callback methods and helpers for tracking changes in | 314 // Collection of callback methods and helpers for tracking changes in |
313 // buffering state and transition from paused/underflow states and playing | 315 // buffering state and transition from paused/underflow states and playing |
314 // states. | 316 // states. |
315 // | 317 // |
316 // While in the kPlaying state: | 318 // While in the kPlaying state: |
317 // - A waiting to non-waiting transition indicates preroll has completed | 319 // - A waiting to non-waiting transition indicates preroll has completed |
318 // and StartPlayback() should be called | 320 // and StartPlayback() should be called |
319 // - A non-waiting to waiting transition indicates underflow has occurred | 321 // - A non-waiting to waiting transition indicates underflow has occurred |
320 // and PausePlayback() should be called | 322 // and StartWaitingForEnoughData() should be called |
321 void BufferingStateChanged(BufferingState* buffering_state, | 323 void BufferingStateChanged(BufferingState* buffering_state, |
322 BufferingState new_buffering_state); | 324 BufferingState new_buffering_state); |
323 bool WaitingForEnoughData() const; | 325 bool WaitingForEnoughData() const; |
324 void PausePlayback(); | 326 void StartWaitingForEnoughData(); |
325 void StartPlayback(); | 327 void StartPlayback(); |
326 | 328 |
327 void PauseClockAndStopRendering_Locked(); | 329 void PauseClockAndStopRendering_Locked(); |
328 void StartClockIfWaitingForTimeUpdate_Locked(); | 330 void StartClockIfWaitingForTimeUpdate_Locked(); |
329 | 331 |
330 // Task runner used to execute pipeline tasks. | 332 // Task runner used to execute pipeline tasks. |
331 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 333 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
332 | 334 |
333 // MediaLog to which to log events. | 335 // MediaLog to which to log events. |
334 scoped_refptr<MediaLog> media_log_; | 336 scoped_refptr<MediaLog> media_log_; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 scoped_ptr<SerialRunner> pending_callbacks_; | 433 scoped_ptr<SerialRunner> pending_callbacks_; |
432 | 434 |
433 base::ThreadChecker thread_checker_; | 435 base::ThreadChecker thread_checker_; |
434 | 436 |
435 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 437 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
436 }; | 438 }; |
437 | 439 |
438 } // namespace media | 440 } // namespace media |
439 | 441 |
440 #endif // MEDIA_BASE_PIPELINE_H_ | 442 #endif // MEDIA_BASE_PIPELINE_H_ |
OLD | NEW |