Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / chromecast / media / cma / pipeline / media_pipeline.h
blob625917ceecbd9cab7f14d5797a815e0bff7f407f
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 <vector>
10 #include "base/basictypes.h"
11 #include "base/macros.h"
12 #include "base/time/time.h"
13 #include "media/base/pipeline_status.h"
15 namespace media {
16 class AudioDecoderConfig;
17 class BrowserCdm;
18 class VideoDecoderConfig;
21 namespace chromecast {
22 namespace media {
23 class AudioPipeline;
24 class CodedFrameProvider;
25 struct MediaPipelineClient;
26 class VideoPipeline;
28 class MediaPipeline {
29 public:
30 MediaPipeline() {}
31 virtual ~MediaPipeline() {}
33 // Set the media pipeline client.
34 virtual void SetClient(const MediaPipelineClient& client) = 0;
36 // Set the CDM to use for decryption.
37 // The CDM is refered by its id.
38 virtual void SetCdm(int cdm_id) = 0;
40 // Return the audio/video pipeline owned by the MediaPipeline.
41 virtual AudioPipeline* GetAudioPipeline() const = 0;
42 virtual VideoPipeline* GetVideoPipeline() const = 0;
44 // Create an audio/video pipeline.
45 // MediaPipeline owns the resulting audio/video pipeline.
46 // Only one audio and one video pipeline can be created.
47 virtual void InitializeAudio(
48 const ::media::AudioDecoderConfig& config,
49 scoped_ptr<CodedFrameProvider> frame_provider,
50 const ::media::PipelineStatusCB& status_cb) = 0;
51 virtual void InitializeVideo(
52 const std::vector<::media::VideoDecoderConfig>& configs,
53 scoped_ptr<CodedFrameProvider> frame_provider,
54 const ::media::PipelineStatusCB& status_cb) = 0;
56 // Control the media pipeline state machine.
57 virtual void StartPlayingFrom(base::TimeDelta time) = 0;
58 virtual void Flush(const ::media::PipelineStatusCB& status_cb) = 0;
59 virtual void Stop() = 0;
61 // Set the playback rate.
62 virtual void SetPlaybackRate(double playback_rate) = 0;
64 private:
65 DISALLOW_COPY_AND_ASSIGN(MediaPipeline);
68 } // namespace media
69 } // namespace chromecast
71 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_