| 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 // Implementation of Pipeline & PipelineStatusNotification (an async-to-sync | 5 // Implementation of Pipeline & PipelineStatusNotification (an async-to-sync |
| 6 // callback adapter). | 6 // callback adapter). |
| 7 | 7 |
| 8 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ | 8 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ |
| 9 #define MEDIA_BASE_PIPELINE_IMPL_H_ | 9 #define MEDIA_BASE_PIPELINE_IMPL_H_ |
| 10 | 10 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // DemuxerHost implementaion. | 201 // DemuxerHost implementaion. |
| 202 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; | 202 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; |
| 203 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; | 203 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; |
| 204 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; | 204 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; |
| 205 virtual void OnDemuxerError(PipelineStatus error) OVERRIDE; | 205 virtual void OnDemuxerError(PipelineStatus error) OVERRIDE; |
| 206 | 206 |
| 207 // FilterHost implementation. | 207 // FilterHost implementation. |
| 208 virtual void SetError(PipelineStatus error) OVERRIDE; | 208 virtual void SetError(PipelineStatus error) OVERRIDE; |
| 209 virtual base::TimeDelta GetTime() const OVERRIDE; | 209 virtual base::TimeDelta GetTime() const OVERRIDE; |
| 210 virtual base::TimeDelta GetDuration() const OVERRIDE; | 210 virtual base::TimeDelta GetDuration() const OVERRIDE; |
| 211 virtual void SetTime(base::TimeDelta time) OVERRIDE; | |
| 212 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; | 211 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; |
| 213 virtual void NotifyEnded() OVERRIDE; | 212 virtual void NotifyEnded() OVERRIDE; |
| 214 virtual void DisableAudioRenderer() OVERRIDE; | 213 virtual void DisableAudioRenderer() OVERRIDE; |
| 215 | 214 |
| 216 // Callbacks executed by filters upon completing initialization. | 215 // Callbacks executed by filters upon completing initialization. |
| 217 void OnFilterInitialize(PipelineStatus status); | 216 void OnFilterInitialize(PipelineStatus status); |
| 218 | 217 |
| 219 // Callback executed by filters upon completing Play(), Pause(), or Stop(). | 218 // Callback executed by filters upon completing Play(), Pause(), or Stop(). |
| 220 void OnFilterStateTransition(); | 219 void OnFilterStateTransition(); |
| 221 | 220 |
| 222 // Callback executed by filters upon completing Seek(). | 221 // Callback executed by filters upon completing Seek(). |
| 223 void OnFilterStateTransitionWithStatus(PipelineStatus status); | 222 void OnFilterStateTransitionWithStatus(PipelineStatus status); |
| 224 | 223 |
| 225 // Callback executed by filters when completing teardown operations. | 224 // Callback executed by filters when completing teardown operations. |
| 226 void OnTeardownStateTransition(); | 225 void OnTeardownStateTransition(); |
| 227 | 226 |
| 228 // Callback executed by filters to update statistics. | 227 // Callback executed by filters to update statistics. |
| 229 void OnUpdateStatistics(const PipelineStatistics& stats); | 228 void OnUpdateStatistics(const PipelineStatistics& stats); |
| 230 | 229 |
| 230 // Callback executed by audio renderer to update clock time. |
| 231 void OnAudioTimeUpdate(base::TimeDelta time, base::TimeDelta max_time); |
| 232 |
| 233 // Callback executed by video renderer to update clock time. |
| 234 void OnVideoTimeUpdate(base::TimeDelta max_time); |
| 235 |
| 231 // The following "task" methods correspond to the public methods, but these | 236 // The following "task" methods correspond to the public methods, but these |
| 232 // methods are run as the result of posting a task to the PipelineInternal's | 237 // methods are run as the result of posting a task to the PipelineInternal's |
| 233 // message loop. | 238 // message loop. |
| 234 void StartTask(FilterCollection* filter_collection, | 239 void StartTask(FilterCollection* filter_collection, |
| 235 const std::string& url, | 240 const std::string& url, |
| 236 const PipelineStatusCB& start_callback); | 241 const PipelineStatusCB& start_callback); |
| 237 | 242 |
| 238 // InitializeTask() performs initialization in multiple passes. It is executed | 243 // InitializeTask() performs initialization in multiple passes. It is executed |
| 239 // as a result of calling Start() or InitializationComplete() that advances | 244 // as a result of calling Start() or InitializationComplete() that advances |
| 240 // initialization to the next state. It works as a hub of state transition for | 245 // 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... |
| 371 | 376 |
| 372 // Whether or not the pipeline is perform a stop operation. | 377 // Whether or not the pipeline is perform a stop operation. |
| 373 bool tearing_down_; | 378 bool tearing_down_; |
| 374 | 379 |
| 375 // Whether or not an error triggered the teardown. | 380 // Whether or not an error triggered the teardown. |
| 376 bool error_caused_teardown_; | 381 bool error_caused_teardown_; |
| 377 | 382 |
| 378 // Whether or not a playback rate change should be done once seeking is done. | 383 // Whether or not a playback rate change should be done once seeking is done. |
| 379 bool playback_rate_change_pending_; | 384 bool playback_rate_change_pending_; |
| 380 | 385 |
| 381 // Duration of the media in microseconds. Set by filters. | |
| 382 base::TimeDelta duration_; | |
| 383 | |
| 384 // Amount of available buffered data in microseconds. Set by filters. | 386 // Amount of available buffered data in microseconds. Set by filters. |
| 385 base::TimeDelta buffered_time_; | 387 base::TimeDelta buffered_time_; |
| 386 | 388 |
| 387 // Amount of available buffered data. Set by filters. | 389 // Amount of available buffered data. Set by filters. |
| 388 int64 buffered_bytes_; | 390 int64 buffered_bytes_; |
| 389 | 391 |
| 390 // Total size of the media. Set by filters. | 392 // Total size of the media. Set by filters. |
| 391 int64 total_bytes_; | 393 int64 total_bytes_; |
| 392 | 394 |
| 393 // Video's natural width and height. Set by filters. | 395 // Video's natural width and height. Set by filters. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 bool is_downloading_data_; | 505 bool is_downloading_data_; |
| 504 | 506 |
| 505 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); | 507 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); |
| 506 | 508 |
| 507 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 509 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
| 508 }; | 510 }; |
| 509 | 511 |
| 510 } // namespace media | 512 } // namespace media |
| 511 | 513 |
| 512 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 514 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
| OLD | NEW |