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