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 | |
314 // Collection of callback methods and helpers for tracking changes in | 312 // Collection of callback methods and helpers for tracking changes in |
315 // buffering state and transition from paused/underflow states and playing | 313 // buffering state and transition from paused/underflow states and playing |
316 // states. | 314 // states. |
317 // | 315 // |
318 // While in the kPlaying state: | 316 // While in the kPlaying state: |
319 // - A waiting to non-waiting transition indicates preroll has completed | 317 // - A waiting to non-waiting transition indicates preroll has completed |
320 // and StartPlayback() should be called | 318 // and StartPlayback() should be called |
321 // - A non-waiting to waiting transition indicates underflow has occurred | 319 // - A non-waiting to waiting transition indicates underflow has occurred |
322 // and StartWaitingForEnoughData() should be called | 320 // and PausePlayback() should be called |
323 void BufferingStateChanged(BufferingState* buffering_state, | 321 void BufferingStateChanged(BufferingState* buffering_state, |
324 BufferingState new_buffering_state); | 322 BufferingState new_buffering_state); |
325 bool WaitingForEnoughData() const; | 323 bool WaitingForEnoughData() const; |
326 void StartWaitingForEnoughData(); | 324 void TransitionToWaiting(); |
| 325 void TransitionToNonWaiting(); |
| 326 void PausePlayback(); |
327 void StartPlayback(); | 327 void StartPlayback(); |
328 | 328 |
329 void StartClockIfWaitingForTimeUpdate_Locked(); | 329 void StartClockIfWaitingForTimeUpdate_Locked(); |
330 | 330 |
331 // Task runner used to execute pipeline tasks. | 331 // Task runner used to execute pipeline tasks. |
332 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 332 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
333 | 333 |
334 // MediaLog to which to log events. | 334 // MediaLog to which to log events. |
335 scoped_refptr<MediaLog> media_log_; | 335 scoped_refptr<MediaLog> media_log_; |
336 | 336 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 scoped_ptr<SerialRunner> pending_callbacks_; | 424 scoped_ptr<SerialRunner> pending_callbacks_; |
425 | 425 |
426 base::ThreadChecker thread_checker_; | 426 base::ThreadChecker thread_checker_; |
427 | 427 |
428 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 428 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
429 }; | 429 }; |
430 | 430 |
431 } // namespace media | 431 } // namespace media |
432 | 432 |
433 #endif // MEDIA_BASE_PIPELINE_H_ | 433 #endif // MEDIA_BASE_PIPELINE_H_ |
OLD | NEW |