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

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

Issue 2552493002: [Media] Record time it takes to start rendering audio and video (Closed)
Patch Set: Audio and video first render times Created 4 years 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
OLDNEW
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
11 #include <deque> 11 #include <deque>
12 #include <memory> 12 #include <memory>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/scoped_vector.h" 16 #include "base/memory/scoped_vector.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/synchronization/condition_variable.h" 18 #include "base/synchronization/condition_variable.h"
19 #include "base/synchronization/lock.h" 19 #include "base/synchronization/lock.h"
20 #include "base/time/time.h"
20 #include "base/timer/timer.h" 21 #include "base/timer/timer.h"
21 #include "media/base/decryptor.h" 22 #include "media/base/decryptor.h"
22 #include "media/base/demuxer_stream.h" 23 #include "media/base/demuxer_stream.h"
23 #include "media/base/media_log.h" 24 #include "media/base/media_log.h"
24 #include "media/base/pipeline_status.h" 25 #include "media/base/pipeline_status.h"
25 #include "media/base/video_decoder.h" 26 #include "media/base/video_decoder.h"
26 #include "media/base/video_frame.h" 27 #include "media/base/video_frame.h"
27 #include "media/base/video_renderer.h" 28 #include "media/base/video_renderer.h"
28 #include "media/base/video_renderer_sink.h" 29 #include "media/base/video_renderer_sink.h"
29 #include "media/filters/decoder_stream.h" 30 #include "media/filters/decoder_stream.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // Indicates if a frame has been processed by CheckForMetadataChanges(). 283 // Indicates if a frame has been processed by CheckForMetadataChanges().
283 bool have_renderered_frames_; 284 bool have_renderered_frames_;
284 285
285 // Tracks last frame properties to detect and notify client of any changes. 286 // Tracks last frame properties to detect and notify client of any changes.
286 gfx::Size last_frame_natural_size_; 287 gfx::Size last_frame_natural_size_;
287 bool last_frame_opaque_; 288 bool last_frame_opaque_;
288 289
289 // Indicates if we've painted the first valid frame after StartPlayingFrom(). 290 // Indicates if we've painted the first valid frame after StartPlayingFrom().
290 bool painted_first_frame_; 291 bool painted_first_frame_;
291 292
293 // The timestamp recorded from |tick_clock_| in StartPlayingFrom() so we could
294 // record the time needed to paint the first valid frame.
295 base::TimeTicks start_rendering_time_;
296
292 // NOTE: Weak pointers must be invalidated before all other member variables. 297 // NOTE: Weak pointers must be invalidated before all other member variables.
293 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; 298 base::WeakPtrFactory<VideoRendererImpl> weak_factory_;
294 299
295 // Weak factory used to invalidate certain queued callbacks on reset(). 300 // Weak factory used to invalidate certain queued callbacks on reset().
296 // This is useful when doing video frame copies asynchronously since we 301 // This is useful when doing video frame copies asynchronously since we
297 // want to discard video frames that might be received after the stream has 302 // want to discard video frames that might be received after the stream has
298 // been reset. 303 // been reset.
299 base::WeakPtrFactory<VideoRendererImpl> frame_callback_weak_factory_; 304 base::WeakPtrFactory<VideoRendererImpl> frame_callback_weak_factory_;
300 305
301 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); 306 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl);
302 }; 307 };
303 308
304 } // namespace media 309 } // namespace media
305 310
306 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ 311 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698