OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_ |
6 #define CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_ | 6 #define CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
12 #include "chromecast/media/cma/pipeline/video_pipeline.h" | 12 #include "chromecast/media/cma/pipeline/video_pipeline.h" |
13 #include "chromecast/media/cma/pipeline/video_pipeline_client.h" | 13 #include "chromecast/media/cma/pipeline/video_pipeline_client.h" |
14 #include "chromecast/public/media/stream_id.h" | 14 #include "chromecast/public/media/stream_id.h" |
15 | 15 |
16 namespace gfx { | |
17 class Size; | |
18 } | |
19 | |
20 namespace media { | 16 namespace media { |
21 class AudioDecoderConfig; | 17 class AudioDecoderConfig; |
22 class VideoDecoderConfig; | 18 class VideoDecoderConfig; |
23 } | 19 } |
24 | 20 |
25 namespace chromecast { | 21 namespace chromecast { |
| 22 struct Size; |
26 namespace media { | 23 namespace media { |
27 class AvPipelineImpl; | 24 class AvPipelineImpl; |
28 class BrowserCdmCast; | 25 class BrowserCdmCast; |
29 class BufferingState; | 26 class BufferingState; |
30 class CodedFrameProvider; | 27 class CodedFrameProvider; |
31 class VideoPipelineDevice; | 28 class VideoPipelineDevice; |
32 | 29 |
33 class VideoPipelineImpl : public VideoPipeline { | 30 class VideoPipelineImpl : public VideoPipeline { |
34 public: | 31 public: |
35 // |buffering_controller| can be NULL. | 32 // |buffering_controller| can be NULL. |
(...skipping 16 matching lines...) Expand all Loading... |
52 void Flush(const ::media::PipelineStatusCB& status_cb); | 49 void Flush(const ::media::PipelineStatusCB& status_cb); |
53 void Stop(); | 50 void Stop(); |
54 | 51 |
55 // Update the playback statistics for this video stream. | 52 // Update the playback statistics for this video stream. |
56 void UpdateStatistics(); | 53 void UpdateStatistics(); |
57 | 54 |
58 // VideoPipeline implementation. | 55 // VideoPipeline implementation. |
59 void SetClient(const VideoPipelineClient& client) override; | 56 void SetClient(const VideoPipelineClient& client) override; |
60 | 57 |
61 private: | 58 private: |
| 59 class DeviceClientImpl; |
| 60 friend class DeviceClientImpl; |
| 61 |
62 void OnFlushDone(const ::media::PipelineStatusCB& status_cb); | 62 void OnFlushDone(const ::media::PipelineStatusCB& status_cb); |
63 void OnUpdateConfig(StreamId id, | 63 void OnUpdateConfig(StreamId id, |
64 const ::media::AudioDecoderConfig& audio_config, | 64 const ::media::AudioDecoderConfig& audio_config, |
65 const ::media::VideoDecoderConfig& video_config); | 65 const ::media::VideoDecoderConfig& video_config); |
66 void OnNaturalSizeChanged(const gfx::Size& size); | 66 void OnNaturalSizeChanged(const Size& size); |
67 | 67 |
68 VideoPipelineDevice* video_device_; | 68 VideoPipelineDevice* video_device_; |
69 | 69 |
70 scoped_ptr<AvPipelineImpl> av_pipeline_impl_; | 70 scoped_ptr<AvPipelineImpl> av_pipeline_impl_; |
71 VideoPipelineClient video_client_; | 71 VideoPipelineClient video_client_; |
72 | 72 |
73 ::media::PipelineStatistics previous_stats_; | 73 ::media::PipelineStatistics previous_stats_; |
74 | 74 |
75 base::WeakPtr<VideoPipelineImpl> weak_this_; | 75 base::WeakPtr<VideoPipelineImpl> weak_this_; |
76 base::WeakPtrFactory<VideoPipelineImpl> weak_factory_; | 76 base::WeakPtrFactory<VideoPipelineImpl> weak_factory_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(VideoPipelineImpl); | 78 DISALLOW_COPY_AND_ASSIGN(VideoPipelineImpl); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace media | 81 } // namespace media |
82 } // namespace chromecast | 82 } // namespace chromecast |
83 | 83 |
84 #endif // CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_ | 84 #endif // CHROMECAST_MEDIA_CMA_BASE_VIDEO_PIPELINE_IMPL_H_ |
OLD | NEW |