| OLD | NEW |
| 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 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. | 5 // Implementation of Pipeline. |
| 6 | 6 |
| 7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ | 7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ |
| 8 #define MEDIA_BASE_PIPELINE_IMPL_H_ | 8 #define MEDIA_BASE_PIPELINE_IMPL_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 virtual float GetPlaybackRate() const; | 74 virtual float GetPlaybackRate() const; |
| 75 virtual void SetPlaybackRate(float playback_rate); | 75 virtual void SetPlaybackRate(float playback_rate); |
| 76 virtual float GetVolume() const; | 76 virtual float GetVolume() const; |
| 77 virtual void SetVolume(float volume); | 77 virtual void SetVolume(float volume); |
| 78 virtual base::TimeDelta GetCurrentTime() const; | 78 virtual base::TimeDelta GetCurrentTime() const; |
| 79 virtual base::TimeDelta GetBufferedTime() const; | 79 virtual base::TimeDelta GetBufferedTime() const; |
| 80 virtual base::TimeDelta GetDuration() const; | 80 virtual base::TimeDelta GetDuration() const; |
| 81 virtual int64 GetBufferedBytes() const; | 81 virtual int64 GetBufferedBytes() const; |
| 82 virtual int64 GetTotalBytes() const; | 82 virtual int64 GetTotalBytes() const; |
| 83 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; | 83 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; |
| 84 virtual bool IsStreaming() const; |
| 84 virtual PipelineError GetError() const; | 85 virtual PipelineError GetError() const; |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 // Pipeline states, as described above. | 88 // Pipeline states, as described above. |
| 88 enum State { | 89 enum State { |
| 89 kCreated, | 90 kCreated, |
| 90 kInitDataSource, | 91 kInitDataSource, |
| 91 kInitDemuxer, | 92 kInitDemuxer, |
| 92 kInitAudioDecoder, | 93 kInitAudioDecoder, |
| 93 kInitAudioRenderer, | 94 kInitAudioRenderer, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 122 | 123 |
| 123 // FilterHost implementation. | 124 // FilterHost implementation. |
| 124 virtual void SetError(PipelineError error); | 125 virtual void SetError(PipelineError error); |
| 125 virtual base::TimeDelta GetTime() const; | 126 virtual base::TimeDelta GetTime() const; |
| 126 virtual void SetTime(base::TimeDelta time); | 127 virtual void SetTime(base::TimeDelta time); |
| 127 virtual void SetDuration(base::TimeDelta duration); | 128 virtual void SetDuration(base::TimeDelta duration); |
| 128 virtual void SetBufferedTime(base::TimeDelta buffered_time); | 129 virtual void SetBufferedTime(base::TimeDelta buffered_time); |
| 129 virtual void SetTotalBytes(int64 total_bytes); | 130 virtual void SetTotalBytes(int64 total_bytes); |
| 130 virtual void SetBufferedBytes(int64 buffered_bytes); | 131 virtual void SetBufferedBytes(int64 buffered_bytes); |
| 131 virtual void SetVideoSize(size_t width, size_t height); | 132 virtual void SetVideoSize(size_t width, size_t height); |
| 133 virtual void SetStreaming(bool streamed); |
| 132 | 134 |
| 133 // Method called during initialization to insert a mime type into the | 135 // Method called during initialization to insert a mime type into the |
| 134 // |rendered_mime_types_| set. | 136 // |rendered_mime_types_| set. |
| 135 void InsertRenderedMimeType(const std::string& major_mime_type); | 137 void InsertRenderedMimeType(const std::string& major_mime_type); |
| 136 | 138 |
| 137 // Method called during initialization to determine if we rendered anything. | 139 // Method called during initialization to determine if we rendered anything. |
| 138 bool HasRenderedMimeTypes() const; | 140 bool HasRenderedMimeTypes() const; |
| 139 | 141 |
| 140 // Callback executed by filters upon completing initialization. | 142 // Callback executed by filters upon completing initialization. |
| 141 void OnFilterInitialize(); | 143 void OnFilterInitialize(); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // Amount of available buffered data. Set by filters. | 262 // Amount of available buffered data. Set by filters. |
| 261 int64 buffered_bytes_; | 263 int64 buffered_bytes_; |
| 262 | 264 |
| 263 // Total size of the media. Set by filters. | 265 // Total size of the media. Set by filters. |
| 264 int64 total_bytes_; | 266 int64 total_bytes_; |
| 265 | 267 |
| 266 // Video width and height. Set by filters. | 268 // Video width and height. Set by filters. |
| 267 size_t video_width_; | 269 size_t video_width_; |
| 268 size_t video_height_; | 270 size_t video_height_; |
| 269 | 271 |
| 272 // Sets by the filters to indicate whether the data source is a streaming |
| 273 // source. |
| 274 bool streaming_; |
| 275 |
| 270 // Current volume level (from 0.0f to 1.0f). This value is set immediately | 276 // Current volume level (from 0.0f to 1.0f). This value is set immediately |
| 271 // via SetVolume() and a task is dispatched on the message loop to notify the | 277 // via SetVolume() and a task is dispatched on the message loop to notify the |
| 272 // filters. | 278 // filters. |
| 273 float volume_; | 279 float volume_; |
| 274 | 280 |
| 275 // Current playback rate (>= 0.0f). This value is set immediately via | 281 // Current playback rate (>= 0.0f). This value is set immediately via |
| 276 // SetPlaybackRate() and a task is dispatched on the message loop to notify | 282 // SetPlaybackRate() and a task is dispatched on the message loop to notify |
| 277 // the filters. | 283 // the filters. |
| 278 float playback_rate_; | 284 float playback_rate_; |
| 279 | 285 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 // Vector of threads owned by the pipeline and being used by filters. | 335 // Vector of threads owned by the pipeline and being used by filters. |
| 330 typedef std::vector<base::Thread*> FilterThreadVector; | 336 typedef std::vector<base::Thread*> FilterThreadVector; |
| 331 FilterThreadVector filter_threads_; | 337 FilterThreadVector filter_threads_; |
| 332 | 338 |
| 333 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 339 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
| 334 }; | 340 }; |
| 335 | 341 |
| 336 } // namespace media | 342 } // namespace media |
| 337 | 343 |
| 338 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 344 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
| OLD | NEW |