OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "chromecast/browser/media/media_pipeline_backend_factory.h" | 5 #include "chromecast/browser/media/media_pipeline_backend_factory.h" |
6 #include "media/base/renderer.h" | 6 #include "media/base/renderer.h" |
7 | 7 |
8 namespace base { | 8 namespace base { |
9 class SingleThreadTaskRunner; | 9 class SingleThreadTaskRunner; |
10 } // namespace base | 10 } // namespace base |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 CastRenderer(const CreateMediaPipelineBackendCB& create_backend_cb, | 25 CastRenderer(const CreateMediaPipelineBackendCB& create_backend_cb, |
26 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 26 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
27 ~CastRenderer() final; | 27 ~CastRenderer() final; |
28 | 28 |
29 // ::media::Renderer implementation. | 29 // ::media::Renderer implementation. |
30 void Initialize(::media::DemuxerStreamProvider* demuxer_stream_provider, | 30 void Initialize(::media::DemuxerStreamProvider* demuxer_stream_provider, |
31 const ::media::PipelineStatusCB& init_cb, | 31 const ::media::PipelineStatusCB& init_cb, |
32 const ::media::StatisticsCB& statistics_cb, | 32 const ::media::StatisticsCB& statistics_cb, |
33 const ::media::BufferingStateCB& buffering_state_cb, | 33 const ::media::BufferingStateCB& buffering_state_cb, |
| 34 const ::media::NaturalSizeChangedCB& natural_size_changed_cb, |
34 const base::Closure& ended_cb, | 35 const base::Closure& ended_cb, |
35 const ::media::PipelineStatusCB& error_cb, | 36 const ::media::PipelineStatusCB& error_cb, |
36 const base::Closure& waiting_for_decryption_key_cb) final; | 37 const base::Closure& waiting_for_decryption_key_cb) final; |
37 void SetCdm(::media::CdmContext* cdm_context, | 38 void SetCdm(::media::CdmContext* cdm_context, |
38 const ::media::CdmAttachedCB& cdm_attached_cb) final; | 39 const ::media::CdmAttachedCB& cdm_attached_cb) final; |
39 void Flush(const base::Closure& flush_cb) final; | 40 void Flush(const base::Closure& flush_cb) final; |
40 void StartPlayingFrom(base::TimeDelta time) final; | 41 void StartPlayingFrom(base::TimeDelta time) final; |
41 void SetPlaybackRate(double playback_rate) final; | 42 void SetPlaybackRate(double playback_rate) final; |
42 void SetVolume(float volume) final; | 43 void SetVolume(float volume) final; |
43 base::TimeDelta GetMediaTime() final; | 44 base::TimeDelta GetMediaTime() final; |
44 bool HasAudio() final; | 45 bool HasAudio() final; |
45 bool HasVideo() final; | 46 bool HasVideo() final; |
46 | 47 |
47 private: | 48 private: |
48 enum Stream { STREAM_AUDIO, STREAM_VIDEO }; | 49 enum Stream { STREAM_AUDIO, STREAM_VIDEO }; |
49 void OnEos(Stream stream); | 50 void OnEos(Stream stream); |
50 | 51 |
51 const CreateMediaPipelineBackendCB create_backend_cb_; | 52 const CreateMediaPipelineBackendCB create_backend_cb_; |
52 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 53 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
53 scoped_refptr<BalancedMediaTaskRunnerFactory> media_task_runner_factory_; | 54 scoped_refptr<BalancedMediaTaskRunnerFactory> media_task_runner_factory_; |
54 std::unique_ptr<TaskRunnerImpl> backend_task_runner_; | 55 std::unique_ptr<TaskRunnerImpl> backend_task_runner_; |
55 std::unique_ptr<MediaPipelineImpl> pipeline_; | 56 std::unique_ptr<MediaPipelineImpl> pipeline_; |
56 bool eos_[2]; | 57 bool eos_[2]; |
57 base::Closure ended_cb_; | 58 base::Closure ended_cb_; |
58 DISALLOW_COPY_AND_ASSIGN(CastRenderer); | 59 DISALLOW_COPY_AND_ASSIGN(CastRenderer); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace media | 62 } // namespace media |
62 } // namespace chromecast | 63 } // namespace chromecast |
OLD | NEW |