[MediaRouter] Update MR-2-Extension's PostMessage to return boolean.
[chromium-blink-merge.git] / chromecast / media / cma / pipeline / media_pipeline.h
blob6026cdcc8744c15542da7d19fb59b83b9260f836
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
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_
6 #define CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_
8 #include "base/basictypes.h"
9 #include "base/macros.h"
10 #include "base/time/time.h"
11 #include "media/base/pipeline_status.h"
13 namespace media {
14 class AudioDecoderConfig;
15 class BrowserCdm;
16 class VideoDecoderConfig;
19 namespace chromecast {
20 namespace media {
21 class AudioPipeline;
22 class CodedFrameProvider;
23 struct MediaPipelineClient;
24 class VideoPipeline;
26 class MediaPipeline {
27 public:
28 MediaPipeline() {}
29 virtual ~MediaPipeline() {}
31 // Set the media pipeline client.
32 virtual void SetClient(const MediaPipelineClient& client) = 0;
34 // Set the CDM to use for decryption.
35 // The CDM is refered by its id.
36 virtual void SetCdm(int cdm_id) = 0;
38 // Return the audio/video pipeline owned by the MediaPipeline.
39 virtual AudioPipeline* GetAudioPipeline() const = 0;
40 virtual VideoPipeline* GetVideoPipeline() const = 0;
42 // Create an audio/video pipeline.
43 // MediaPipeline owns the resulting audio/video pipeline.
44 // Only one audio and one video pipeline can be created.
45 virtual void InitializeAudio(
46 const ::media::AudioDecoderConfig& config,
47 scoped_ptr<CodedFrameProvider> frame_provider,
48 const ::media::PipelineStatusCB& status_cb) = 0;
49 virtual void InitializeVideo(
50 const std::vector<::media::VideoDecoderConfig>& configs,
51 scoped_ptr<CodedFrameProvider> frame_provider,
52 const ::media::PipelineStatusCB& status_cb) = 0;
54 // Control the media pipeline state machine.
55 virtual void StartPlayingFrom(base::TimeDelta time) = 0;
56 virtual void Flush(const ::media::PipelineStatusCB& status_cb) = 0;
57 virtual void Stop() = 0;
59 // Set the playback rate.
60 virtual void SetPlaybackRate(double playback_rate) = 0;
62 private:
63 DISALLOW_COPY_AND_ASSIGN(MediaPipeline);
66 } // namespace media
67 } // namespace chromecast
69 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_