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_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "base/threading/thread_checker.h"
13 #include "chromecast/media/cma/pipeline/video_pipeline.h"
14 #include "media/base/pipeline_status.h"
17 class SingleThreadTaskRunner
;
22 class VideoDecoderConfig
;
25 namespace chromecast
{
27 struct AvPipelineClient
;
28 class AvStreamerProxy
;
29 class CodedFrameProvider
;
30 class VideoPipelineProxyInternal
;
31 class MediaChannelProxy
;
33 class VideoPipelineProxy
: public VideoPipeline
{
35 VideoPipelineProxy(scoped_refptr
<base::SingleThreadTaskRunner
> io_task_runner
,
36 scoped_refptr
<MediaChannelProxy
> media_channel_proxy
);
37 ~VideoPipelineProxy() override
;
39 void Initialize(const std::vector
<::media::VideoDecoderConfig
>& configs
,
40 scoped_ptr
<CodedFrameProvider
> frame_provider
,
41 const ::media::PipelineStatusCB
& status_cb
);
43 void Flush(const base::Closure
& done_cb
);
46 // VideoPipeline implementation.
47 void SetClient(const VideoPipelineClient
& video_client
) override
;
50 base::ThreadChecker thread_checker_
;
53 const std::vector
<::media::VideoDecoderConfig
>& configs
,
54 const ::media::PipelineStatusCB
& status_cb
,
55 scoped_ptr
<base::SharedMemory
> shared_memory
);
59 scoped_refptr
<base::SingleThreadTaskRunner
> io_task_runner_
;
61 // |proxy_| main goal is to convert function calls to IPC messages.
62 scoped_ptr
<VideoPipelineProxyInternal
> proxy_
;
64 scoped_ptr
<AvStreamerProxy
> video_streamer_
;
66 base::WeakPtr
<VideoPipelineProxy
> weak_this_
;
67 base::WeakPtrFactory
<VideoPipelineProxy
> weak_factory_
;
69 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy
);
73 } // namespace chromecast
75 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_