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_
10 #include "base/basictypes.h"
11 #include "base/macros.h"
12 #include "base/time/time.h"
13 #include "media/base/pipeline_status.h"
16 class AudioDecoderConfig
;
18 class VideoDecoderConfig
;
21 namespace chromecast
{
24 class CodedFrameProvider
;
25 struct MediaPipelineClient
;
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;
65 DISALLOW_COPY_AND_ASSIGN(MediaPipeline
);
69 } // namespace chromecast
71 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_H_