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 MEDIA_RENDERERS_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_RENDERERS_RENDERER_IMPL_H_ |
6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ | 6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const base::Closure& waiting_for_decryption_key_cb) final; | 56 const base::Closure& waiting_for_decryption_key_cb) final; |
57 void SetCdm(CdmContext* cdm_context, | 57 void SetCdm(CdmContext* cdm_context, |
58 const CdmAttachedCB& cdm_attached_cb) final; | 58 const CdmAttachedCB& cdm_attached_cb) final; |
59 void Flush(const base::Closure& flush_cb) final; | 59 void Flush(const base::Closure& flush_cb) final; |
60 void StartPlayingFrom(base::TimeDelta time) final; | 60 void StartPlayingFrom(base::TimeDelta time) final; |
61 void SetPlaybackRate(double playback_rate) final; | 61 void SetPlaybackRate(double playback_rate) final; |
62 void SetVolume(float volume) final; | 62 void SetVolume(float volume) final; |
63 base::TimeDelta GetMediaTime() final; | 63 base::TimeDelta GetMediaTime() final; |
64 bool HasAudio() final; | 64 bool HasAudio() final; |
65 bool HasVideo() final; | 65 bool HasVideo() final; |
66 void OnEnabledAudioStreamsChanged( | |
67 const std::vector<const DemuxerStream*>& enabledAudioStreams) final; | |
68 void OnSelectedVideoStreamChanged( | |
69 const DemuxerStream* selectedVideoStream) final; | |
70 | 66 |
71 // Helper functions for testing purposes. Must be called before Initialize(). | 67 // Helper functions for testing purposes. Must be called before Initialize(). |
72 void DisableUnderflowForTesting(); | 68 void DisableUnderflowForTesting(); |
73 void EnableClocklessVideoPlaybackForTesting(); | 69 void EnableClocklessVideoPlaybackForTesting(); |
74 void set_time_source_for_testing(TimeSource* time_source) { | 70 void set_time_source_for_testing(TimeSource* time_source) { |
75 time_source_ = time_source; | 71 time_source_ = time_source; |
76 } | 72 } |
77 void set_video_underflow_threshold_for_testing(base::TimeDelta threshold) { | 73 void set_video_underflow_threshold_for_testing(base::TimeDelta threshold) { |
78 video_underflow_threshold_ = threshold; | 74 video_underflow_threshold_ = threshold; |
79 } | 75 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 BufferingStateCB buffering_state_cb_; | 144 BufferingStateCB buffering_state_cb_; |
149 base::Closure waiting_for_decryption_key_cb_; | 145 base::Closure waiting_for_decryption_key_cb_; |
150 | 146 |
151 // Temporary callback used for Initialize() and Flush(). | 147 // Temporary callback used for Initialize() and Flush(). |
152 PipelineStatusCB init_cb_; | 148 PipelineStatusCB init_cb_; |
153 base::Closure flush_cb_; | 149 base::Closure flush_cb_; |
154 | 150 |
155 scoped_ptr<AudioRenderer> audio_renderer_; | 151 scoped_ptr<AudioRenderer> audio_renderer_; |
156 scoped_ptr<VideoRenderer> video_renderer_; | 152 scoped_ptr<VideoRenderer> video_renderer_; |
157 | 153 |
158 bool audio_stream_currently_disabled_ = false; | |
159 float audio_volume_ = 1.0f; | |
160 | |
161 // Renderer-provided time source used to control playback. | 154 // Renderer-provided time source used to control playback. |
162 TimeSource* time_source_; | 155 TimeSource* time_source_; |
163 scoped_ptr<WallClockTimeSource> wall_clock_time_source_; | 156 scoped_ptr<WallClockTimeSource> wall_clock_time_source_; |
164 bool time_ticking_; | 157 bool time_ticking_; |
165 double playback_rate_; | 158 double playback_rate_; |
166 | 159 |
167 // The time to start playback from after starting/seeking has completed. | 160 // The time to start playback from after starting/seeking has completed. |
168 base::TimeDelta start_time_; | 161 base::TimeDelta start_time_; |
169 | 162 |
170 BufferingState audio_buffering_state_; | 163 BufferingState audio_buffering_state_; |
(...skipping 18 matching lines...) Expand all Loading... |
189 | 182 |
190 base::WeakPtr<RendererImpl> weak_this_; | 183 base::WeakPtr<RendererImpl> weak_this_; |
191 base::WeakPtrFactory<RendererImpl> weak_factory_; | 184 base::WeakPtrFactory<RendererImpl> weak_factory_; |
192 | 185 |
193 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | 186 DISALLOW_COPY_AND_ASSIGN(RendererImpl); |
194 }; | 187 }; |
195 | 188 |
196 } // namespace media | 189 } // namespace media |
197 | 190 |
198 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ | 191 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ |
OLD | NEW |