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 16 matching lines...) Expand all Loading... |
27 class TimeDelta; | 27 class TimeDelta; |
28 } | 28 } |
29 | 29 |
30 namespace media { | 30 namespace media { |
31 | 31 |
32 class FilterCollection; | 32 class FilterCollection; |
33 class MediaLog; | 33 class MediaLog; |
34 class TextRenderer; | 34 class TextRenderer; |
35 class TextTrackConfig; | 35 class TextTrackConfig; |
36 class TimeDeltaInterpolator; | 36 class TimeDeltaInterpolator; |
| 37 class TimeSource; |
37 class VideoRenderer; | 38 class VideoRenderer; |
38 | 39 |
39 // Metadata describing a pipeline once it has been initialized. | 40 // Metadata describing a pipeline once it has been initialized. |
40 struct PipelineMetadata { | 41 struct PipelineMetadata { |
41 PipelineMetadata() | 42 PipelineMetadata() |
42 : has_audio(false), has_video(false), video_rotation(VIDEO_ROTATION_0) {} | 43 : has_audio(false), has_video(false), video_rotation(VIDEO_ROTATION_0) {} |
43 | 44 |
44 bool has_audio; | 45 bool has_audio; |
45 bool has_video; | 46 bool has_video; |
46 gfx::Size natural_size; | 47 gfx::Size natural_size; |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // - A waiting to non-waiting transition indicates preroll has completed | 311 // - A waiting to non-waiting transition indicates preroll has completed |
311 // and StartPlayback() should be called | 312 // and StartPlayback() should be called |
312 // - A non-waiting to waiting transition indicates underflow has occurred | 313 // - A non-waiting to waiting transition indicates underflow has occurred |
313 // and PausePlayback() should be called | 314 // and PausePlayback() should be called |
314 void BufferingStateChanged(BufferingState* buffering_state, | 315 void BufferingStateChanged(BufferingState* buffering_state, |
315 BufferingState new_buffering_state); | 316 BufferingState new_buffering_state); |
316 bool WaitingForEnoughData() const; | 317 bool WaitingForEnoughData() const; |
317 void PausePlayback(); | 318 void PausePlayback(); |
318 void StartPlayback(); | 319 void StartPlayback(); |
319 | 320 |
320 void PauseClockAndStopRendering_Locked(); | 321 void PauseClockAndStopTicking_Locked(); |
321 void StartClockIfWaitingForTimeUpdate_Locked(); | 322 void StartClockIfWaitingForTimeUpdate_Locked(); |
322 | 323 |
323 // Task runner used to execute pipeline tasks. | 324 // Task runner used to execute pipeline tasks. |
324 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 325 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
325 | 326 |
326 // MediaLog to which to log events. | 327 // MediaLog to which to log events. |
327 scoped_refptr<MediaLog> media_log_; | 328 scoped_refptr<MediaLog> media_log_; |
328 | 329 |
329 // Lock used to serialize access for the following data members. | 330 // Lock used to serialize access for the following data members. |
330 mutable base::Lock lock_; | 331 mutable base::Lock lock_; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 414 |
414 // Holds the initialized demuxer. Used for seeking. Owned by client. | 415 // Holds the initialized demuxer. Used for seeking. Owned by client. |
415 Demuxer* demuxer_; | 416 Demuxer* demuxer_; |
416 | 417 |
417 // Holds the initialized renderers. Used for setting the volume, | 418 // Holds the initialized renderers. Used for setting the volume, |
418 // playback rate, and determining when playback has finished. | 419 // playback rate, and determining when playback has finished. |
419 scoped_ptr<AudioRenderer> audio_renderer_; | 420 scoped_ptr<AudioRenderer> audio_renderer_; |
420 scoped_ptr<VideoRenderer> video_renderer_; | 421 scoped_ptr<VideoRenderer> video_renderer_; |
421 scoped_ptr<TextRenderer> text_renderer_; | 422 scoped_ptr<TextRenderer> text_renderer_; |
422 | 423 |
| 424 // Renderer-provided time source used to control playback. |
| 425 TimeSource* time_source_; |
| 426 |
423 PipelineStatistics statistics_; | 427 PipelineStatistics statistics_; |
424 | 428 |
425 scoped_ptr<SerialRunner> pending_callbacks_; | 429 scoped_ptr<SerialRunner> pending_callbacks_; |
426 | 430 |
427 bool underflow_disabled_for_testing_; | 431 bool underflow_disabled_for_testing_; |
428 | 432 |
429 base::ThreadChecker thread_checker_; | 433 base::ThreadChecker thread_checker_; |
430 | 434 |
431 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 435 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
432 }; | 436 }; |
433 | 437 |
434 } // namespace media | 438 } // namespace media |
435 | 439 |
436 #endif // MEDIA_BASE_PIPELINE_H_ | 440 #endif // MEDIA_BASE_PIPELINE_H_ |
OLD | NEW |