OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIDEO_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
6 #define MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ | 6 #define MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 GpuVideoAcceleratorFactories* gpu_factories, | 61 GpuVideoAcceleratorFactories* gpu_factories, |
62 const scoped_refptr<MediaLog>& media_log); | 62 const scoped_refptr<MediaLog>& media_log); |
63 ~VideoRendererImpl() override; | 63 ~VideoRendererImpl() override; |
64 | 64 |
65 // VideoRenderer implementation. | 65 // VideoRenderer implementation. |
66 void Initialize(DemuxerStream* stream, | 66 void Initialize(DemuxerStream* stream, |
67 const PipelineStatusCB& init_cb, | 67 const PipelineStatusCB& init_cb, |
68 CdmContext* cdm_context, | 68 CdmContext* cdm_context, |
69 const StatisticsCB& statistics_cb, | 69 const StatisticsCB& statistics_cb, |
70 const BufferingStateCB& buffering_state_cb, | 70 const BufferingStateCB& buffering_state_cb, |
| 71 const NaturalSizeChangedCB& natural_size_changed_cb, |
71 const base::Closure& ended_cb, | 72 const base::Closure& ended_cb, |
72 const PipelineStatusCB& error_cb, | 73 const PipelineStatusCB& error_cb, |
73 const TimeSource::WallClockTimeCB& wall_clock_time_cb, | 74 const TimeSource::WallClockTimeCB& wall_clock_time_cb, |
74 const base::Closure& waiting_for_decryption_key_cb) override; | 75 const base::Closure& waiting_for_decryption_key_cb) override; |
75 void Flush(const base::Closure& callback) override; | 76 void Flush(const base::Closure& callback) override; |
76 void StartPlayingFrom(base::TimeDelta timestamp) override; | 77 void StartPlayingFrom(base::TimeDelta timestamp) override; |
77 void OnTimeStateChanged(bool time_progressing) override; | 78 void OnTimeStateChanged(bool time_progressing) override; |
78 | 79 |
79 void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock); | 80 void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock); |
80 void SetGpuMemoryBufferVideoForTesting( | 81 void SetGpuMemoryBufferVideoForTesting( |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 225 |
225 BufferingState buffering_state_; | 226 BufferingState buffering_state_; |
226 | 227 |
227 // Playback operation callbacks. | 228 // Playback operation callbacks. |
228 base::Closure flush_cb_; | 229 base::Closure flush_cb_; |
229 | 230 |
230 // Event callbacks. | 231 // Event callbacks. |
231 PipelineStatusCB init_cb_; | 232 PipelineStatusCB init_cb_; |
232 StatisticsCB statistics_cb_; | 233 StatisticsCB statistics_cb_; |
233 BufferingStateCB buffering_state_cb_; | 234 BufferingStateCB buffering_state_cb_; |
| 235 NaturalSizeChangedCB natural_size_changed_cb_; |
234 base::Closure ended_cb_; | 236 base::Closure ended_cb_; |
235 PipelineStatusCB error_cb_; | 237 PipelineStatusCB error_cb_; |
236 TimeSource::WallClockTimeCB wall_clock_time_cb_; | 238 TimeSource::WallClockTimeCB wall_clock_time_cb_; |
237 | 239 |
238 base::TimeDelta start_timestamp_; | 240 base::TimeDelta start_timestamp_; |
239 | 241 |
240 // Keeps track of the number of frames decoded and dropped since the | 242 // Keeps track of the number of frames decoded and dropped since the |
241 // last call to |statistics_cb_|. These must be accessed under lock. | 243 // last call to |statistics_cb_|. These must be accessed under lock. |
242 int frames_decoded_; | 244 int frames_decoded_; |
243 int frames_dropped_; | 245 int frames_dropped_; |
(...skipping 16 matching lines...) Expand all Loading... |
260 // Indicates that Render() should only render the first frame and then request | 262 // Indicates that Render() should only render the first frame and then request |
261 // that the sink be stopped. |posted_maybe_stop_after_first_paint_| is used | 263 // that the sink be stopped. |posted_maybe_stop_after_first_paint_| is used |
262 // to avoid repeated task posts. | 264 // to avoid repeated task posts. |
263 bool render_first_frame_and_stop_; | 265 bool render_first_frame_and_stop_; |
264 bool posted_maybe_stop_after_first_paint_; | 266 bool posted_maybe_stop_after_first_paint_; |
265 | 267 |
266 // Memory usage of |algorithm_| recorded during the last UpdateStats_Locked() | 268 // Memory usage of |algorithm_| recorded during the last UpdateStats_Locked() |
267 // call. | 269 // call. |
268 int64_t last_video_memory_usage_; | 270 int64_t last_video_memory_usage_; |
269 | 271 |
| 272 // Tracks video natural size to detect and notify upstream of any changes. |
| 273 gfx::Size last_frame_natural_size_; |
| 274 |
270 // NOTE: Weak pointers must be invalidated before all other member variables. | 275 // NOTE: Weak pointers must be invalidated before all other member variables. |
271 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; | 276 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; |
272 | 277 |
273 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); | 278 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); |
274 }; | 279 }; |
275 | 280 |
276 } // namespace media | 281 } // namespace media |
277 | 282 |
278 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ | 283 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
OLD | NEW |