ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chromecast / media / cma / pipeline / video_pipeline_impl.h
blobe065ac1df203ab078b5ff8d09402ac5ba0fbbe44
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_BASE_VIDEO_PIPELINE_IMPL_H_
6 #define CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h"
11 #include "base/threading/thread_checker.h"
12 #include "chromecast/media/cma/pipeline/video_pipeline.h"
13 #include "chromecast/media/cma/pipeline/video_pipeline_client.h"
15 namespace gfx {
16 class Size;
19 namespace media {
20 class AudioDecoderConfig;
21 class VideoDecoderConfig;
24 namespace chromecast {
25 namespace media {
26 class AvPipelineImpl;
27 class BrowserCdmCast;
28 class BufferingState;
29 class CodedFrameProvider;
30 class VideoPipelineDevice;
32 class VideoPipelineImpl : public VideoPipeline {
33 public:
34 // |buffering_controller| can be NULL.
35 explicit VideoPipelineImpl(VideoPipelineDevice* video_device);
36 ~VideoPipelineImpl() override;
38 // Input port of the pipeline.
39 void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider);
41 // Provide the CDM to use to decrypt samples.
42 void SetCdm(BrowserCdmCast* media_keys);
44 // Functions to control the state of the audio pipeline.
45 void Initialize(
46 const ::media::VideoDecoderConfig& config,
47 scoped_ptr<CodedFrameProvider> frame_provider,
48 const ::media::PipelineStatusCB& status_cb);
49 bool StartPlayingFrom(base::TimeDelta time,
50 const scoped_refptr<BufferingState>& buffering_state);
51 void Flush(const ::media::PipelineStatusCB& status_cb);
52 void Stop();
54 // Update the playback statistics for this video stream.
55 void UpdateStatistics();
57 // VideoPipeline implementation.
58 void SetClient(const VideoPipelineClient& client) override;
60 private:
61 void OnFlushDone(const ::media::PipelineStatusCB& status_cb);
62 void OnUpdateConfig(const ::media::AudioDecoderConfig& audio_config,
63 const ::media::VideoDecoderConfig& video_config);
64 void OnNaturalSizeChanged(const gfx::Size& size);
66 VideoPipelineDevice* video_device_;
68 scoped_ptr<AvPipelineImpl> av_pipeline_impl_;
69 VideoPipelineClient video_client_;
71 ::media::PipelineStatistics previous_stats_;
73 base::WeakPtr<VideoPipelineImpl> weak_this_;
74 base::WeakPtrFactory<VideoPipelineImpl> weak_factory_;
76 DISALLOW_COPY_AND_ASSIGN(VideoPipelineImpl);
79 } // namespace media
80 } // namespace chromecast
82 #endif // CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_