Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_ | 5 #ifndef CHROMECAST_RENDERER_MEDIA_RENDERER_MEDIA_PIPELINE_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_ | 6 #define CHROMECAST_RENDERER_MEDIA_RENDERER_MEDIA_PIPELINE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "media/base/pipeline_status.h" | 13 #include "media/base/pipeline_status.h" |
| 14 | 14 |
| 15 namespace media { | 15 namespace media { |
| 16 class AudioDecoderConfig; | 16 class AudioDecoderConfig; |
| 17 class BrowserCdm; | |
| 18 class VideoDecoderConfig; | 17 class VideoDecoderConfig; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace chromecast { | 20 namespace chromecast { |
| 22 namespace media { | 21 namespace media { |
| 23 class AudioPipeline; | 22 class AudioPipeline; |
| 24 class CodedFrameProvider; | 23 class CodedFrameProvider; |
| 25 struct MediaPipelineClient; | 24 struct MediaPipelineClient; |
| 26 class VideoPipeline; | 25 class VideoPipeline; |
| 27 | 26 |
| 28 class MediaPipeline { | 27 class RendererMediaPipeline { |
| 29 public: | 28 public: |
| 30 MediaPipeline() {} | 29 RendererMediaPipeline() {} |
|
slan
2015/10/07 02:06:47
This class can also be simplified in the way that
kmackay
2015/10/07 16:37:58
Done.
| |
| 31 virtual ~MediaPipeline() {} | 30 virtual ~RendererMediaPipeline() {} |
| 32 | 31 |
| 33 // Set the media pipeline client. | 32 // Set the media pipeline client. |
| 34 virtual void SetClient(const MediaPipelineClient& client) = 0; | 33 virtual void SetClient(const MediaPipelineClient& client) = 0; |
| 35 | 34 |
| 36 // Set the CDM to use for decryption. | 35 // Set the CDM to use for decryption. |
| 37 // The CDM is refered by its id. | 36 // The CDM is refered by its id. |
| 38 virtual void SetCdm(int cdm_id) = 0; | 37 virtual void SetCdm(int cdm_id) = 0; |
| 39 | 38 |
| 40 // Return the audio/video pipeline owned by the MediaPipeline. | 39 // Return the audio/video pipeline owned by the RendererMediaPipeline. |
| 41 virtual AudioPipeline* GetAudioPipeline() const = 0; | 40 virtual AudioPipeline* GetAudioPipeline() const = 0; |
| 42 virtual VideoPipeline* GetVideoPipeline() const = 0; | 41 virtual VideoPipeline* GetVideoPipeline() const = 0; |
| 43 | 42 |
| 44 // Create an audio/video pipeline. | 43 // Create an audio/video pipeline. |
| 45 // MediaPipeline owns the resulting audio/video pipeline. | 44 // RendererMediaPipeline owns the resulting audio/video pipeline. |
| 46 // Only one audio and one video pipeline can be created. | 45 // Only one audio and one video pipeline can be created. |
| 47 virtual void InitializeAudio( | 46 virtual void InitializeAudio(const ::media::AudioDecoderConfig& config, |
| 48 const ::media::AudioDecoderConfig& config, | 47 scoped_ptr<CodedFrameProvider> frame_provider, |
| 49 scoped_ptr<CodedFrameProvider> frame_provider, | 48 const ::media::PipelineStatusCB& status_cb) = 0; |
| 50 const ::media::PipelineStatusCB& status_cb) = 0; | |
| 51 virtual void InitializeVideo( | 49 virtual void InitializeVideo( |
| 52 const std::vector<::media::VideoDecoderConfig>& configs, | 50 const std::vector< ::media::VideoDecoderConfig>& configs, |
| 53 scoped_ptr<CodedFrameProvider> frame_provider, | 51 scoped_ptr<CodedFrameProvider> frame_provider, |
| 54 const ::media::PipelineStatusCB& status_cb) = 0; | 52 const ::media::PipelineStatusCB& status_cb) = 0; |
| 55 | 53 |
| 56 // Control the media pipeline state machine. | 54 // Control the media pipeline state machine. |
| 57 virtual void StartPlayingFrom(base::TimeDelta time) = 0; | 55 virtual void StartPlayingFrom(base::TimeDelta time) = 0; |
| 58 virtual void Flush(const ::media::PipelineStatusCB& status_cb) = 0; | 56 virtual void Flush(const ::media::PipelineStatusCB& status_cb) = 0; |
| 59 virtual void Stop() = 0; | 57 virtual void Stop() = 0; |
| 60 | 58 |
| 61 // Set the playback rate. | 59 // Set the playback rate. |
| 62 virtual void SetPlaybackRate(double playback_rate) = 0; | 60 virtual void SetPlaybackRate(double playback_rate) = 0; |
| 63 | 61 |
| 64 private: | 62 private: |
| 65 DISALLOW_COPY_AND_ASSIGN(MediaPipeline); | 63 DISALLOW_COPY_AND_ASSIGN(RendererMediaPipeline); |
| 66 }; | 64 }; |
| 67 | 65 |
| 68 } // namespace media | 66 } // namespace media |
| 69 } // namespace chromecast | 67 } // namespace chromecast |
| 70 | 68 |
| 71 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_ | 69 #endif // CHROMECAST_RENDERER_MEDIA_RENDERER_MEDIA_PIPELINE_H_ |
| OLD | NEW |