Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / chromecast / renderer / media / video_pipeline_proxy.h
blob1dbf13ec0b80881e9b68fa9a3bc2401a7c3f093d
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"
16 namespace base {
17 class SingleThreadTaskRunner;
18 class SharedMemory;
21 namespace media {
22 class VideoDecoderConfig;
25 namespace chromecast {
26 namespace media {
27 struct AvPipelineClient;
28 class AvStreamerProxy;
29 class CodedFrameProvider;
30 class VideoPipelineProxyInternal;
31 class MediaChannelProxy;
33 class VideoPipelineProxy : public VideoPipeline {
34 public:
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);
42 void StartFeeding();
43 void Flush(const base::Closure& done_cb);
44 void Stop();
46 // VideoPipeline implementation.
47 void SetClient(const VideoPipelineClient& video_client) override;
49 private:
50 base::ThreadChecker thread_checker_;
52 void OnAvPipeCreated(
53 const std::vector<::media::VideoDecoderConfig>& configs,
54 const ::media::PipelineStatusCB& status_cb,
55 scoped_ptr<base::SharedMemory> shared_memory);
56 void OnPipeWrite();
57 void OnPipeRead();
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);
72 } // namespace media
73 } // namespace chromecast
75 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_