| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 class PipelineImpl : public Pipeline, public FilterHost { | 94 class PipelineImpl : public Pipeline, public FilterHost { |
| 95 public: | 95 public: |
| 96 explicit PipelineImpl(MessageLoop* message_loop); | 96 explicit PipelineImpl(MessageLoop* message_loop); |
| 97 | 97 |
| 98 // Pipeline implementation. | 98 // Pipeline implementation. |
| 99 virtual void Init(PipelineStatusCallback* ended_callback, | 99 virtual void Init(PipelineStatusCallback* ended_callback, |
| 100 PipelineStatusCallback* error_callback, | 100 PipelineStatusCallback* error_callback, |
| 101 PipelineStatusCallback* network_callback); | 101 PipelineStatusCallback* network_callback); |
| 102 virtual bool Start(FilterCollection* filter_collection, | 102 virtual bool Start(FilterCollection* filter_collection, |
| 103 const std::string& uri, | 103 const std::string& uri, |
| 104 PipelineStatusCallback* start_callback); | 104 PipelineStatusCallback* start_callback, |
| 105 bool raw_video); |
| 105 virtual void Stop(PipelineStatusCallback* stop_callback); | 106 virtual void Stop(PipelineStatusCallback* stop_callback); |
| 106 virtual void Seek(base::TimeDelta time, | 107 virtual void Seek(base::TimeDelta time, |
| 107 PipelineStatusCallback* seek_callback); | 108 PipelineStatusCallback* seek_callback); |
| 108 virtual bool IsRunning() const; | 109 virtual bool IsRunning() const; |
| 109 virtual bool IsInitialized() const; | 110 virtual bool IsInitialized() const; |
| 110 virtual bool IsNetworkActive() const; | 111 virtual bool IsNetworkActive() const; |
| 111 virtual bool HasAudio() const; | 112 virtual bool HasAudio() const; |
| 112 virtual bool HasVideo() const; | 113 virtual bool HasVideo() const; |
| 113 virtual float GetPlaybackRate() const; | 114 virtual float GetPlaybackRate() const; |
| 114 virtual void SetPlaybackRate(float playback_rate); | 115 virtual void SetPlaybackRate(float playback_rate); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 void OnTeardownStateTransition(); | 216 void OnTeardownStateTransition(); |
| 216 | 217 |
| 217 // Callback executed by filters to update statistics. | 218 // Callback executed by filters to update statistics. |
| 218 void OnUpdateStatistics(const PipelineStatistics& stats); | 219 void OnUpdateStatistics(const PipelineStatistics& stats); |
| 219 | 220 |
| 220 // The following "task" methods correspond to the public methods, but these | 221 // The following "task" methods correspond to the public methods, but these |
| 221 // methods are run as the result of posting a task to the PipelineInternal's | 222 // methods are run as the result of posting a task to the PipelineInternal's |
| 222 // message loop. | 223 // message loop. |
| 223 void StartTask(FilterCollection* filter_collection, | 224 void StartTask(FilterCollection* filter_collection, |
| 224 const std::string& url, | 225 const std::string& url, |
| 225 PipelineStatusCallback* start_callback); | 226 PipelineStatusCallback* start_callback, |
| 227 bool raw_video); |
| 226 | 228 |
| 227 // InitializeTask() performs initialization in multiple passes. It is executed | 229 // InitializeTask() performs initialization in multiple passes. It is executed |
| 228 // as a result of calling Start() or InitializationComplete() that advances | 230 // as a result of calling Start() or InitializationComplete() that advances |
| 229 // initialization to the next state. It works as a hub of state transition for | 231 // initialization to the next state. It works as a hub of state transition for |
| 230 // initialization. | 232 // initialization. |
| 231 void InitializeTask(); | 233 void InitializeTask(); |
| 232 | 234 |
| 233 // Stops and destroys all filters, placing the pipeline in the kStopped state. | 235 // Stops and destroys all filters, placing the pipeline in the kStopped state. |
| 234 void StopTask(PipelineStatusCallback* stop_callback); | 236 void StopTask(PipelineStatusCallback* stop_callback); |
| 235 | 237 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 PipelineStatistics statistics_; | 457 PipelineStatistics statistics_; |
| 456 | 458 |
| 457 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); | 459 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); |
| 458 | 460 |
| 459 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 461 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
| 460 }; | 462 }; |
| 461 | 463 |
| 462 } // namespace media | 464 } // namespace media |
| 463 | 465 |
| 464 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 466 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
| OLD | NEW |