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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 virtual float GetVolume() const OVERRIDE; | 119 virtual float GetVolume() const OVERRIDE; |
120 virtual void SetVolume(float volume) OVERRIDE; | 120 virtual void SetVolume(float volume) OVERRIDE; |
121 virtual void SetPreload(Preload preload) OVERRIDE; | 121 virtual void SetPreload(Preload preload) OVERRIDE; |
122 virtual base::TimeDelta GetCurrentTime() const OVERRIDE; | 122 virtual base::TimeDelta GetCurrentTime() const OVERRIDE; |
123 virtual base::TimeDelta GetBufferedTime() OVERRIDE; | 123 virtual base::TimeDelta GetBufferedTime() OVERRIDE; |
124 virtual base::TimeDelta GetMediaDuration() const OVERRIDE; | 124 virtual base::TimeDelta GetMediaDuration() const OVERRIDE; |
125 virtual int64 GetBufferedBytes() const OVERRIDE; | 125 virtual int64 GetBufferedBytes() const OVERRIDE; |
126 virtual int64 GetTotalBytes() const OVERRIDE; | 126 virtual int64 GetTotalBytes() const OVERRIDE; |
127 virtual void GetNaturalVideoSize(gfx::Size* out_size) const OVERRIDE; | 127 virtual void GetNaturalVideoSize(gfx::Size* out_size) const OVERRIDE; |
128 virtual bool IsStreaming() const OVERRIDE; | 128 virtual bool IsStreaming() const OVERRIDE; |
129 virtual bool IsLoaded() const OVERRIDE; | 129 virtual bool IsLocalSource() const OVERRIDE; |
130 virtual PipelineStatistics GetStatistics() const OVERRIDE; | 130 virtual PipelineStatistics GetStatistics() const OVERRIDE; |
131 | 131 |
132 void SetClockForTesting(Clock* clock); | 132 void SetClockForTesting(Clock* clock); |
133 | 133 |
134 private: | 134 private: |
135 friend class MediaLog; | 135 friend class MediaLog; |
136 | 136 |
137 // Pipeline states, as described above. | 137 // Pipeline states, as described above. |
138 enum State { | 138 enum State { |
139 kCreated, | 139 kCreated, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // FilterHost implementation. | 193 // FilterHost implementation. |
194 virtual void SetError(PipelineStatus error) OVERRIDE; | 194 virtual void SetError(PipelineStatus error) OVERRIDE; |
195 virtual base::TimeDelta GetTime() const OVERRIDE; | 195 virtual base::TimeDelta GetTime() const OVERRIDE; |
196 virtual base::TimeDelta GetDuration() const OVERRIDE; | 196 virtual base::TimeDelta GetDuration() const OVERRIDE; |
197 virtual void SetTime(base::TimeDelta time) OVERRIDE; | 197 virtual void SetTime(base::TimeDelta time) OVERRIDE; |
198 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; | 198 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; |
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 SetStreaming(bool streamed) OVERRIDE; | |
204 virtual void SetLoaded(bool loaded) OVERRIDE; | |
205 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE; | 203 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE; |
206 virtual void NotifyEnded() OVERRIDE; | 204 virtual void NotifyEnded() OVERRIDE; |
207 virtual void DisableAudioRenderer() OVERRIDE; | 205 virtual void DisableAudioRenderer() OVERRIDE; |
208 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; | 206 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; |
209 virtual int64 GetCurrentReadPosition() OVERRIDE; | 207 virtual int64 GetCurrentReadPosition() OVERRIDE; |
210 | 208 |
211 // Callback executed by filters upon completing initialization. | 209 // Callback executed by filters upon completing initialization. |
212 void OnFilterInitialize(); | 210 void OnFilterInitialize(); |
213 | 211 |
214 // Callback executed by filters upon completing Play(), Pause(), or Stop(). | 212 // Callback executed by filters upon completing Play(), Pause(), or Stop(). |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 376 |
379 // Amount of available buffered data. Set by filters. | 377 // Amount of available buffered data. Set by filters. |
380 int64 buffered_bytes_; | 378 int64 buffered_bytes_; |
381 | 379 |
382 // Total size of the media. Set by filters. | 380 // Total size of the media. Set by filters. |
383 int64 total_bytes_; | 381 int64 total_bytes_; |
384 | 382 |
385 // Video's natural width and height. Set by filters. | 383 // Video's natural width and height. Set by filters. |
386 gfx::Size natural_size_; | 384 gfx::Size natural_size_; |
387 | 385 |
388 // Sets by the filters to indicate whether the data source is a streaming | 386 // Set by the demuxer to indicate whether the data source is a streaming |
389 // source. | 387 // source. |
390 bool streaming_; | 388 bool streaming_; |
391 | 389 |
392 // Sets by the filters to indicate whether the data source is a fully | 390 // Indicates whether the data source is local, such as a local media file |
393 // loaded source. | 391 // from disk or a local webcam stream. |
394 bool loaded_; | 392 bool local_source_; |
395 | 393 |
396 // Current volume level (from 0.0f to 1.0f). This value is set immediately | 394 // Current volume level (from 0.0f to 1.0f). This value is set immediately |
397 // via SetVolume() and a task is dispatched on the message loop to notify the | 395 // via SetVolume() and a task is dispatched on the message loop to notify the |
398 // filters. | 396 // filters. |
399 float volume_; | 397 float volume_; |
400 | 398 |
401 // Current value of preload attribute. This value is set immediately via | 399 // Current value of preload attribute. This value is set immediately via |
402 // SetPreload() and a task is dispatched on the message loop to notify the | 400 // SetPreload() and a task is dispatched on the message loop to notify the |
403 // filters. | 401 // filters. |
404 Preload preload_; | 402 Preload preload_; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 bool is_downloading_data_; | 493 bool is_downloading_data_; |
496 | 494 |
497 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); | 495 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); |
498 | 496 |
499 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 497 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
500 }; | 498 }; |
501 | 499 |
502 } // namespace media | 500 } // namespace media |
503 | 501 |
504 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 502 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
OLD | NEW |