| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; | 199 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; |
| 200 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; | 200 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; |
| 201 virtual void SetBufferedBytes(int64 buffered_bytes) OVERRIDE; | 201 virtual void SetBufferedBytes(int64 buffered_bytes) OVERRIDE; |
| 202 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; | 202 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; |
| 203 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE; | 203 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE; |
| 204 virtual void NotifyEnded() OVERRIDE; | 204 virtual void NotifyEnded() OVERRIDE; |
| 205 virtual void DisableAudioRenderer() OVERRIDE; | 205 virtual void DisableAudioRenderer() OVERRIDE; |
| 206 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; | 206 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; |
| 207 virtual int64 GetCurrentReadPosition() OVERRIDE; | 207 virtual int64 GetCurrentReadPosition() OVERRIDE; |
| 208 | 208 |
| 209 // Callback executed by filters upon completing initialization. | 209 // Callbacks executed by filters upon completing initialization. |
| 210 void OnFilterInitialize(); | 210 void OnFilterInitialize(PipelineStatus status); |
| 211 | 211 |
| 212 // Callback executed by filters upon completing Play(), Pause(), or Stop(). | 212 // Callback executed by filters upon completing Play(), Pause(), or Stop(). |
| 213 void OnFilterStateTransition(); | 213 void OnFilterStateTransition(); |
| 214 | 214 |
| 215 // Callback executed by filters upon completing Seek(). | 215 // Callback executed by filters upon completing Seek(). |
| 216 void OnFilterStateTransitionWithStatus(PipelineStatus status); | 216 void OnFilterStateTransitionWithStatus(PipelineStatus status); |
| 217 | 217 |
| 218 // Callback executed by filters when completing teardown operations. | 218 // Callback executed by filters when completing teardown operations. |
| 219 void OnTeardownStateTransition(); | 219 void OnTeardownStateTransition(); |
| 220 | 220 |
| 221 // Callback executed by filters to update statistics. | 221 // Callback executed by filters to update statistics. |
| 222 void OnUpdateStatistics(const PipelineStatistics& stats); | 222 void OnUpdateStatistics(const PipelineStatistics& stats); |
| 223 | 223 |
| 224 // The following "task" methods correspond to the public methods, but these | 224 // The following "task" methods correspond to the public methods, but these |
| 225 // methods are run as the result of posting a task to the PipelineInternal's | 225 // methods are run as the result of posting a task to the PipelineInternal's |
| 226 // message loop. | 226 // message loop. |
| 227 void StartTask(FilterCollection* filter_collection, | 227 void StartTask(FilterCollection* filter_collection, |
| 228 const std::string& url, | 228 const std::string& url, |
| 229 const PipelineStatusCB& start_callback); | 229 const PipelineStatusCB& start_callback); |
| 230 | 230 |
| 231 // InitializeTask() performs initialization in multiple passes. It is executed | 231 // InitializeTask() performs initialization in multiple passes. It is executed |
| 232 // as a result of calling Start() or InitializationComplete() that advances | 232 // as a result of calling Start() or InitializationComplete() that advances |
| 233 // initialization to the next state. It works as a hub of state transition for | 233 // initialization to the next state. It works as a hub of state transition for |
| 234 // initialization. | 234 // initialization. One stage communicates its status to the next through |
| 235 void InitializeTask(); | 235 // |last_stage_status|. |
| 236 void InitializeTask(PipelineStatus last_stage_status); |
| 236 | 237 |
| 237 // Stops and destroys all filters, placing the pipeline in the kStopped state. | 238 // Stops and destroys all filters, placing the pipeline in the kStopped state. |
| 238 void StopTask(const PipelineStatusCB& stop_callback); | 239 void StopTask(const PipelineStatusCB& stop_callback); |
| 239 | 240 |
| 240 // Carries out stopping and destroying all filters, placing the pipeline in | 241 // Carries out stopping and destroying all filters, placing the pipeline in |
| 241 // the kError state. | 242 // the kError state. |
| 242 void ErrorChangedTask(PipelineStatus error); | 243 void ErrorChangedTask(PipelineStatus error); |
| 243 | 244 |
| 244 // Carries out notifying filters that the playback rate has changed. | 245 // Carries out notifying filters that the playback rate has changed. |
| 245 void PlaybackRateChangedTask(float playback_rate); | 246 void PlaybackRateChangedTask(float playback_rate); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 bool is_downloading_data_; | 494 bool is_downloading_data_; |
| 494 | 495 |
| 495 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); | 496 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); |
| 496 | 497 |
| 497 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 498 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
| 498 }; | 499 }; |
| 499 | 500 |
| 500 } // namespace media | 501 } // namespace media |
| 501 | 502 |
| 502 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 503 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
| OLD | NEW |