| 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; |
| 66 | 70 |
| 67 // Helper functions for testing purposes. Must be called before Initialize(). | 71 // Helper functions for testing purposes. Must be called before Initialize(). |
| 68 void DisableUnderflowForTesting(); | 72 void DisableUnderflowForTesting(); |
| 69 void EnableClocklessVideoPlaybackForTesting(); | 73 void EnableClocklessVideoPlaybackForTesting(); |
| 70 void set_time_source_for_testing(TimeSource* time_source) { | 74 void set_time_source_for_testing(TimeSource* time_source) { |
| 71 time_source_ = time_source; | 75 time_source_ = time_source; |
| 72 } | 76 } |
| 73 void set_video_underflow_threshold_for_testing(base::TimeDelta threshold) { | 77 void set_video_underflow_threshold_for_testing(base::TimeDelta threshold) { |
| 74 video_underflow_threshold_ = threshold; | 78 video_underflow_threshold_ = threshold; |
| 75 } | 79 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 BufferingStateCB buffering_state_cb_; | 148 BufferingStateCB buffering_state_cb_; |
| 145 base::Closure waiting_for_decryption_key_cb_; | 149 base::Closure waiting_for_decryption_key_cb_; |
| 146 | 150 |
| 147 // Temporary callback used for Initialize() and Flush(). | 151 // Temporary callback used for Initialize() and Flush(). |
| 148 PipelineStatusCB init_cb_; | 152 PipelineStatusCB init_cb_; |
| 149 base::Closure flush_cb_; | 153 base::Closure flush_cb_; |
| 150 | 154 |
| 151 scoped_ptr<AudioRenderer> audio_renderer_; | 155 scoped_ptr<AudioRenderer> audio_renderer_; |
| 152 scoped_ptr<VideoRenderer> video_renderer_; | 156 scoped_ptr<VideoRenderer> video_renderer_; |
| 153 | 157 |
| 158 bool audio_stream_currently_disabled_ = false; |
| 159 float audio_volume_ = 1.0f; |
| 160 |
| 154 // Renderer-provided time source used to control playback. | 161 // Renderer-provided time source used to control playback. |
| 155 TimeSource* time_source_; | 162 TimeSource* time_source_; |
| 156 scoped_ptr<WallClockTimeSource> wall_clock_time_source_; | 163 scoped_ptr<WallClockTimeSource> wall_clock_time_source_; |
| 157 bool time_ticking_; | 164 bool time_ticking_; |
| 158 double playback_rate_; | 165 double playback_rate_; |
| 159 | 166 |
| 160 // The time to start playback from after starting/seeking has completed. | 167 // The time to start playback from after starting/seeking has completed. |
| 161 base::TimeDelta start_time_; | 168 base::TimeDelta start_time_; |
| 162 | 169 |
| 163 BufferingState audio_buffering_state_; | 170 BufferingState audio_buffering_state_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 182 | 189 |
| 183 base::WeakPtr<RendererImpl> weak_this_; | 190 base::WeakPtr<RendererImpl> weak_this_; |
| 184 base::WeakPtrFactory<RendererImpl> weak_factory_; | 191 base::WeakPtrFactory<RendererImpl> weak_factory_; |
| 185 | 192 |
| 186 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | 193 DISALLOW_COPY_AND_ASSIGN(RendererImpl); |
| 187 }; | 194 }; |
| 188 | 195 |
| 189 } // namespace media | 196 } // namespace media |
| 190 | 197 |
| 191 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ | 198 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ |
| OLD | NEW |