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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 PipelineStatusCallback* seek_callback); | 107 PipelineStatusCallback* seek_callback); |
108 virtual bool IsRunning() const; | 108 virtual bool IsRunning() const; |
109 virtual bool IsInitialized() const; | 109 virtual bool IsInitialized() const; |
110 virtual bool IsNetworkActive() const; | 110 virtual bool IsNetworkActive() const; |
111 virtual bool HasAudio() const; | 111 virtual bool HasAudio() const; |
112 virtual bool HasVideo() const; | 112 virtual bool HasVideo() const; |
113 virtual float GetPlaybackRate() const; | 113 virtual float GetPlaybackRate() const; |
114 virtual void SetPlaybackRate(float playback_rate); | 114 virtual void SetPlaybackRate(float playback_rate); |
115 virtual float GetVolume() const; | 115 virtual float GetVolume() const; |
116 virtual void SetVolume(float volume); | 116 virtual void SetVolume(float volume); |
117 virtual Preload GetPreload() const; | |
acolwell GONE FROM CHROMIUM
2011/03/25 04:35:28
Move to private section since this isn't part of t
vrk (LEFT CHROMIUM)
2011/03/25 21:33:32
Done.
| |
118 virtual void SetPreload(Preload preload); | |
117 virtual base::TimeDelta GetCurrentTime() const; | 119 virtual base::TimeDelta GetCurrentTime() const; |
118 virtual base::TimeDelta GetBufferedTime(); | 120 virtual base::TimeDelta GetBufferedTime(); |
119 virtual base::TimeDelta GetMediaDuration() const; | 121 virtual base::TimeDelta GetMediaDuration() const; |
120 virtual int64 GetBufferedBytes() const; | 122 virtual int64 GetBufferedBytes() const; |
121 virtual int64 GetTotalBytes() const; | 123 virtual int64 GetTotalBytes() const; |
122 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; | 124 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; |
123 virtual bool IsStreaming() const; | 125 virtual bool IsStreaming() const; |
124 virtual bool IsLoaded() const; | 126 virtual bool IsLoaded() const; |
125 virtual PipelineStatistics GetStatistics() const; | 127 virtual PipelineStatistics GetStatistics() const; |
126 | 128 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 // Carries out stopping and destroying all filters, placing the pipeline in | 235 // Carries out stopping and destroying all filters, placing the pipeline in |
234 // the kError state. | 236 // the kError state. |
235 void ErrorChangedTask(PipelineStatus error); | 237 void ErrorChangedTask(PipelineStatus error); |
236 | 238 |
237 // Carries out notifying filters that the playback rate has changed. | 239 // Carries out notifying filters that the playback rate has changed. |
238 void PlaybackRateChangedTask(float playback_rate); | 240 void PlaybackRateChangedTask(float playback_rate); |
239 | 241 |
240 // Carries out notifying filters that the volume has changed. | 242 // Carries out notifying filters that the volume has changed. |
241 void VolumeChangedTask(float volume); | 243 void VolumeChangedTask(float volume); |
242 | 244 |
245 // Carries out notifying filters that the preload value has changed. | |
246 void PreloadChangedTask(Preload preload); | |
247 | |
243 // Carries out notifying filters that we are seeking to a new timestamp. | 248 // Carries out notifying filters that we are seeking to a new timestamp. |
244 void SeekTask(base::TimeDelta time, PipelineStatusCallback* seek_callback); | 249 void SeekTask(base::TimeDelta time, PipelineStatusCallback* seek_callback); |
245 | 250 |
246 // Carries out handling a notification from a filter that it has ended. | 251 // Carries out handling a notification from a filter that it has ended. |
247 void NotifyEndedTask(); | 252 void NotifyEndedTask(); |
248 | 253 |
249 // Carries out handling a notification of network event. | 254 // Carries out handling a notification of network event. |
250 void NotifyNetworkEventTask(); | 255 void NotifyNetworkEventTask(); |
251 | 256 |
252 // Carries out disabling the audio renderer. | 257 // Carries out disabling the audio renderer. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 bool loaded_; | 353 bool loaded_; |
349 | 354 |
350 // Sets by the filters to indicate whether network is active. | 355 // Sets by the filters to indicate whether network is active. |
351 bool network_activity_; | 356 bool network_activity_; |
352 | 357 |
353 // Current volume level (from 0.0f to 1.0f). This value is set immediately | 358 // Current volume level (from 0.0f to 1.0f). This value is set immediately |
354 // via SetVolume() and a task is dispatched on the message loop to notify the | 359 // via SetVolume() and a task is dispatched on the message loop to notify the |
355 // filters. | 360 // filters. |
356 float volume_; | 361 float volume_; |
357 | 362 |
363 // Current value of preload attribute. This value is set immediately via | |
364 // SetPreload() and a task is dispatched on the message loop to notify the | |
365 // filters. | |
366 Preload preload_; | |
367 | |
358 // Current playback rate (>= 0.0f). This value is set immediately via | 368 // Current playback rate (>= 0.0f). This value is set immediately via |
359 // SetPlaybackRate() and a task is dispatched on the message loop to notify | 369 // SetPlaybackRate() and a task is dispatched on the message loop to notify |
360 // the filters. | 370 // the filters. |
361 float playback_rate_; | 371 float playback_rate_; |
362 | 372 |
363 // Reference clock. Keeps track of current playback time. Uses system | 373 // Reference clock. Keeps track of current playback time. Uses system |
364 // clock and linear interpolation, but can have its time manually set | 374 // clock and linear interpolation, but can have its time manually set |
365 // by filters. | 375 // by filters. |
366 scoped_ptr<Clock> clock_; | 376 scoped_ptr<Clock> clock_; |
367 | 377 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
416 scoped_ptr<PipelineStatusCallback> network_callback_; | 426 scoped_ptr<PipelineStatusCallback> network_callback_; |
417 | 427 |
418 // Reference to the filter(s) that constitute the pipeline. | 428 // Reference to the filter(s) that constitute the pipeline. |
419 scoped_refptr<Filter> pipeline_filter_; | 429 scoped_refptr<Filter> pipeline_filter_; |
420 | 430 |
421 // Renderer references used for setting the volume and determining | 431 // Renderer references used for setting the volume and determining |
422 // when playback has finished. | 432 // when playback has finished. |
423 scoped_refptr<AudioRenderer> audio_renderer_; | 433 scoped_refptr<AudioRenderer> audio_renderer_; |
424 scoped_refptr<VideoRenderer> video_renderer_; | 434 scoped_refptr<VideoRenderer> video_renderer_; |
425 | 435 |
436 // Demuxer reference used for setting the preload value. | |
437 scoped_refptr<Demuxer> demuxer_; | |
438 | |
426 // Helper class that stores filter references during pipeline | 439 // Helper class that stores filter references during pipeline |
427 // initialization. | 440 // initialization. |
428 class PipelineInitState; | 441 class PipelineInitState; |
429 scoped_ptr<PipelineInitState> pipeline_init_state_; | 442 scoped_ptr<PipelineInitState> pipeline_init_state_; |
430 | 443 |
431 // Statistics. | 444 // Statistics. |
432 PipelineStatistics statistics_; | 445 PipelineStatistics statistics_; |
433 | 446 |
434 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); | 447 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); |
435 | 448 |
436 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 449 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
437 }; | 450 }; |
438 | 451 |
439 } // namespace media | 452 } // namespace media |
440 | 453 |
441 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 454 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
OLD | NEW |