Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: media/renderers/renderer_impl.h

Issue 1094783002: Switch to double for time calculations using playback rate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making changes at chromecast side to fix trybots Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698