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 "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const StatisticsCB& statistics_cb, | 49 const StatisticsCB& statistics_cb, |
50 const BufferingStateCB& buffering_state_cb, | 50 const BufferingStateCB& buffering_state_cb, |
51 const PaintCB& paint_cb, | 51 const PaintCB& paint_cb, |
52 const base::Closure& ended_cb, | 52 const base::Closure& ended_cb, |
53 const PipelineStatusCB& error_cb, | 53 const PipelineStatusCB& error_cb, |
54 const base::Closure& waiting_for_decryption_key_cb) final; | 54 const base::Closure& waiting_for_decryption_key_cb) final; |
55 void SetCdm(CdmContext* cdm_context, | 55 void SetCdm(CdmContext* cdm_context, |
56 const CdmAttachedCB& cdm_attached_cb) final; | 56 const CdmAttachedCB& cdm_attached_cb) final; |
57 void Flush(const base::Closure& flush_cb) final; | 57 void Flush(const base::Closure& flush_cb) final; |
58 void StartPlayingFrom(base::TimeDelta time) final; | 58 void StartPlayingFrom(base::TimeDelta time) final; |
59 void SetPlaybackRate(float playback_rate) final; | 59 void SetPlaybackRate(double playback_rate) final; |
60 void SetVolume(float volume) final; | 60 void SetVolume(float volume) final; |
61 base::TimeDelta GetMediaTime() final; | 61 base::TimeDelta GetMediaTime() final; |
62 bool HasAudio() final; | 62 bool HasAudio() final; |
63 bool HasVideo() final; | 63 bool HasVideo() final; |
64 | 64 |
65 // Helper functions for testing purposes. Must be called before Initialize(). | 65 // Helper functions for testing purposes. Must be called before Initialize(). |
66 void DisableUnderflowForTesting(); | 66 void DisableUnderflowForTesting(); |
67 void EnableClocklessVideoPlaybackForTesting(); | 67 void EnableClocklessVideoPlaybackForTesting(); |
68 void set_time_source_for_testing(TimeSource* time_source) { | 68 void set_time_source_for_testing(TimeSource* time_source) { |
69 time_source_ = time_source; | 69 time_source_ = time_source; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 PipelineStatusCB init_cb_; | 147 PipelineStatusCB init_cb_; |
148 base::Closure flush_cb_; | 148 base::Closure flush_cb_; |
149 | 149 |
150 scoped_ptr<AudioRenderer> audio_renderer_; | 150 scoped_ptr<AudioRenderer> audio_renderer_; |
151 scoped_ptr<VideoRenderer> video_renderer_; | 151 scoped_ptr<VideoRenderer> video_renderer_; |
152 | 152 |
153 // Renderer-provided time source used to control playback. | 153 // Renderer-provided time source used to control playback. |
154 TimeSource* time_source_; | 154 TimeSource* time_source_; |
155 scoped_ptr<WallClockTimeSource> wall_clock_time_source_; | 155 scoped_ptr<WallClockTimeSource> wall_clock_time_source_; |
156 bool time_ticking_; | 156 bool time_ticking_; |
157 float playback_rate_; | 157 double playback_rate_; |
158 | 158 |
159 // The time to start playback from after starting/seeking has completed. | 159 // The time to start playback from after starting/seeking has completed. |
160 base::TimeDelta start_time_; | 160 base::TimeDelta start_time_; |
161 | 161 |
162 BufferingState audio_buffering_state_; | 162 BufferingState audio_buffering_state_; |
163 BufferingState video_buffering_state_; | 163 BufferingState video_buffering_state_; |
164 | 164 |
165 // Whether we've received the audio/video ended events. | 165 // Whether we've received the audio/video ended events. |
166 bool audio_ended_; | 166 bool audio_ended_; |
167 bool video_ended_; | 167 bool video_ended_; |
(...skipping 20 matching lines...) Expand all Loading... |
188 | 188 |
189 base::WeakPtr<RendererImpl> weak_this_; | 189 base::WeakPtr<RendererImpl> weak_this_; |
190 base::WeakPtrFactory<RendererImpl> weak_factory_; | 190 base::WeakPtrFactory<RendererImpl> weak_factory_; |
191 | 191 |
192 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | 192 DISALLOW_COPY_AND_ASSIGN(RendererImpl); |
193 }; | 193 }; |
194 | 194 |
195 } // namespace media | 195 } // namespace media |
196 | 196 |
197 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ | 197 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ |
OLD | NEW |