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_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_
6 #define CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h"
14 #include "base/threading/thread_checker.h"
15 #include "chromecast/media/cma/pipeline/video_pipeline.h"
16 #include "media/base/pipeline_status.h"
19 class SingleThreadTaskRunner
;
24 class VideoDecoderConfig
;
27 namespace chromecast
{
29 struct AvPipelineClient
;
30 class AvStreamerProxy
;
31 class CodedFrameProvider
;
32 class VideoPipelineProxyInternal
;
33 class MediaChannelProxy
;
35 class VideoPipelineProxy
: public VideoPipeline
{
37 VideoPipelineProxy(scoped_refptr
<base::SingleThreadTaskRunner
> io_task_runner
,
38 scoped_refptr
<MediaChannelProxy
> media_channel_proxy
);
39 ~VideoPipelineProxy() override
;
41 void Initialize(const std::vector
<::media::VideoDecoderConfig
>& configs
,
42 scoped_ptr
<CodedFrameProvider
> frame_provider
,
43 const ::media::PipelineStatusCB
& status_cb
);
45 void Flush(const base::Closure
& done_cb
);
48 // VideoPipeline implementation.
49 void SetClient(const VideoPipelineClient
& video_client
) override
;
52 base::ThreadChecker thread_checker_
;
55 const std::vector
<::media::VideoDecoderConfig
>& configs
,
56 const ::media::PipelineStatusCB
& status_cb
,
57 scoped_ptr
<base::SharedMemory
> shared_memory
);
61 scoped_refptr
<base::SingleThreadTaskRunner
> io_task_runner_
;
63 // |proxy_| main goal is to convert function calls to IPC messages.
64 scoped_ptr
<VideoPipelineProxyInternal
> proxy_
;
66 scoped_ptr
<AvStreamerProxy
> video_streamer_
;
68 base::WeakPtr
<VideoPipelineProxy
> weak_this_
;
69 base::WeakPtrFactory
<VideoPipelineProxy
> weak_factory_
;
71 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy
);
75 } // namespace chromecast
77 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_