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