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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // DemuxerHost implementaion. | 327 // DemuxerHost implementaion. |
328 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; | 328 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; |
329 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; | 329 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; |
330 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; | 330 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; |
331 virtual void OnDemuxerError(PipelineStatus error) OVERRIDE; | 331 virtual void OnDemuxerError(PipelineStatus error) OVERRIDE; |
332 | 332 |
333 // FilterHost implementation. | 333 // FilterHost implementation. |
334 virtual void SetError(PipelineStatus error) OVERRIDE; | 334 virtual void SetError(PipelineStatus error) OVERRIDE; |
335 virtual base::TimeDelta GetTime() const OVERRIDE; | 335 virtual base::TimeDelta GetTime() const OVERRIDE; |
336 virtual base::TimeDelta GetDuration() const OVERRIDE; | 336 virtual base::TimeDelta GetDuration() const OVERRIDE; |
337 virtual void SetTime(base::TimeDelta time) OVERRIDE; | |
338 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; | 337 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; |
339 virtual void NotifyEnded() OVERRIDE; | 338 virtual void NotifyEnded() OVERRIDE; |
340 virtual void DisableAudioRenderer() OVERRIDE; | 339 virtual void DisableAudioRenderer() OVERRIDE; |
341 | 340 |
342 // Callbacks executed by filters upon completing initialization. | 341 // Callbacks executed by filters upon completing initialization. |
343 void OnFilterInitialize(PipelineStatus status); | 342 void OnFilterInitialize(PipelineStatus status); |
344 | 343 |
345 // Callback executed by filters upon completing Play(), Pause(), or Stop(). | 344 // Callback executed by filters upon completing Play(), Pause(), or Stop(). |
346 void OnFilterStateTransition(); | 345 void OnFilterStateTransition(); |
347 | 346 |
348 // Callback executed by filters upon completing Seek(). | 347 // Callback executed by filters upon completing Seek(). |
349 void OnFilterStateTransitionWithStatus(PipelineStatus status); | 348 void OnFilterStateTransitionWithStatus(PipelineStatus status); |
350 | 349 |
351 // Callback executed by filters when completing teardown operations. | 350 // Callback executed by filters when completing teardown operations. |
352 void OnTeardownStateTransition(); | 351 void OnTeardownStateTransition(); |
353 | 352 |
354 // Callback executed by filters to update statistics. | 353 // Callback executed by filters to update statistics. |
355 void OnUpdateStatistics(const PipelineStatistics& stats); | 354 void OnUpdateStatistics(const PipelineStatistics& stats); |
356 | 355 |
| 356 // Callback executed by audio renderer to update clock time. |
| 357 void OnAudioTimeUpdate(base::TimeDelta time, base::TimeDelta max_time); |
| 358 |
| 359 // Callback executed by video renderer to update clock time. |
| 360 void OnVideoTimeUpdate(base::TimeDelta max_time); |
| 361 |
357 // The following "task" methods correspond to the public methods, but these | 362 // The following "task" methods correspond to the public methods, but these |
358 // methods are run as the result of posting a task to the PipelineInternal's | 363 // methods are run as the result of posting a task to the PipelineInternal's |
359 // message loop. | 364 // message loop. |
360 void StartTask(scoped_ptr<FilterCollection> filter_collection, | 365 void StartTask(scoped_ptr<FilterCollection> filter_collection, |
361 const std::string& url, | 366 const std::string& url, |
362 const PipelineStatusCB& start_callback); | 367 const PipelineStatusCB& start_callback); |
363 | 368 |
364 // InitializeTask() performs initialization in multiple passes. It is executed | 369 // InitializeTask() performs initialization in multiple passes. It is executed |
365 // as a result of calling Start() or InitializationComplete() that advances | 370 // as a result of calling Start() or InitializationComplete() that advances |
366 // initialization to the next state. It works as a hub of state transition for | 371 // initialization to the next state. It works as a hub of state transition for |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 502 |
498 // Whether or not the pipeline is perform a stop operation. | 503 // Whether or not the pipeline is perform a stop operation. |
499 bool tearing_down_; | 504 bool tearing_down_; |
500 | 505 |
501 // Whether or not an error triggered the teardown. | 506 // Whether or not an error triggered the teardown. |
502 bool error_caused_teardown_; | 507 bool error_caused_teardown_; |
503 | 508 |
504 // Whether or not a playback rate change should be done once seeking is done. | 509 // Whether or not a playback rate change should be done once seeking is done. |
505 bool playback_rate_change_pending_; | 510 bool playback_rate_change_pending_; |
506 | 511 |
507 // Duration of the media in microseconds. Set by filters. | |
508 base::TimeDelta duration_; | |
509 | |
510 // Amount of available buffered data in microseconds. Set by filters. | 512 // Amount of available buffered data in microseconds. Set by filters. |
511 base::TimeDelta buffered_time_; | 513 base::TimeDelta buffered_time_; |
512 | 514 |
513 // Amount of available buffered data. Set by filters. | 515 // Amount of available buffered data. Set by filters. |
514 int64 buffered_bytes_; | 516 int64 buffered_bytes_; |
515 | 517 |
516 // Total size of the media. Set by filters. | 518 // Total size of the media. Set by filters. |
517 int64 total_bytes_; | 519 int64 total_bytes_; |
518 | 520 |
519 // Video's natural width and height. Set by filters. | 521 // Video's natural width and height. Set by filters. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 635 |
634 // True if the pipeline is actively downloading bytes, false otherwise. | 636 // True if the pipeline is actively downloading bytes, false otherwise. |
635 bool is_downloading_data_; | 637 bool is_downloading_data_; |
636 | 638 |
637 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 639 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
638 }; | 640 }; |
639 | 641 |
640 } // namespace media | 642 } // namespace media |
641 | 643 |
642 #endif // MEDIA_BASE_PIPELINE_H_ | 644 #endif // MEDIA_BASE_PIPELINE_H_ |
OLD | NEW |