Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: chromecast/media/cma/pipeline/video_pipeline_impl.h

Issue 741863002: Chromecast: adds a media pipeline feeding data to CMA device backends. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cma-cdm
Patch Set: address nits, merge Pause/Flush Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_
6 #define CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_
7
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"
14
15 namespace gfx {
16 class Size;
17 }
18
19 namespace media {
20 class AudioDecoderConfig;
21 class VideoDecoderConfig;
22 }
23
24 namespace chromecast {
25 namespace media {
26 class AvPipelineImpl;
27 class BrowserCdmCast;
28 class BufferingState;
29 class CodedFrameProvider;
30 class VideoPipelineDevice;
31
32 class VideoPipelineImpl : public VideoPipeline {
33 public:
34 // |buffering_controller| can be NULL.
35 explicit VideoPipelineImpl(VideoPipelineDevice* video_device);
36 ~VideoPipelineImpl() override;
37
38 // Input port of the pipeline.
39 void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider);
40
41 // Provide the CDM to use to decrypt samples.
42 void SetCdm(BrowserCdmCast* media_keys);
43
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();
53
54 // Update the playback statistics for this video stream.
55 void UpdateStatistics();
56
57 // VideoPipeline implementation.
58 void SetClient(const VideoPipelineClient& client) override;
59
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);
65
66 VideoPipelineDevice* video_device_;
67
68 scoped_ptr<AvPipelineImpl> av_pipeline_impl_;
69 VideoPipelineClient video_client_;
70
71 ::media::PipelineStatistics previous_stats_;
72
73 base::WeakPtrFactory<VideoPipelineImpl> weak_factory_;
74 base::WeakPtr<VideoPipelineImpl> weak_this_;
75
76 DISALLOW_COPY_AND_ASSIGN(VideoPipelineImpl);
77 };
78
79 } // namespace media
80 } // namespace chromecast
81
82 #endif // CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_
OLDNEW
« no previous file with comments | « chromecast/media/cma/pipeline/video_pipeline_client.cc ('k') | chromecast/media/cma/pipeline/video_pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698