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 // Callbacks executed by filters upon completing initialization. | 209 // Callback executed by filters upon completing initialization. |
210 void OnFilterInitialize(PipelineStatus status); | 210 void OnFilterInitialize(); |
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. One stage communicates its status to the next through | 234 // initialization. |
235 // |last_stage_status|. | 235 void InitializeTask(); |
236 void InitializeTask(PipelineStatus last_stage_status); | |
237 | 236 |
238 // Stops and destroys all filters, placing the pipeline in the kStopped state. | 237 // Stops and destroys all filters, placing the pipeline in the kStopped state. |
239 void StopTask(const PipelineStatusCB& stop_callback); | 238 void StopTask(const PipelineStatusCB& stop_callback); |
240 | 239 |
241 // Carries out stopping and destroying all filters, placing the pipeline in | 240 // Carries out stopping and destroying all filters, placing the pipeline in |
242 // the kError state. | 241 // the kError state. |
243 void ErrorChangedTask(PipelineStatus error); | 242 void ErrorChangedTask(PipelineStatus error); |
244 | 243 |
245 // Carries out notifying filters that the playback rate has changed. | 244 // Carries out notifying filters that the playback rate has changed. |
246 void PlaybackRateChangedTask(float playback_rate); | 245 void PlaybackRateChangedTask(float playback_rate); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 bool is_downloading_data_; | 493 bool is_downloading_data_; |
495 | 494 |
496 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); | 495 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); |
497 | 496 |
498 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 497 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
499 }; | 498 }; |
500 | 499 |
501 } // namespace media | 500 } // namespace media |
502 | 501 |
503 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 502 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
OLD | NEW |