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

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: 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_| when the renderer switches from
294 // rendering in the background to rendering in the foreground.
295 // Used to compute how much time it took to paint the first frame.
296 base::TimeTicks shown_timestamp_;
297
292 // NOTE: Weak pointers must be invalidated before all other member variables. 298 // NOTE: Weak pointers must be invalidated before all other member variables.
293 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; 299 base::WeakPtrFactory<VideoRendererImpl> weak_factory_;
294 300
295 // Weak factory used to invalidate certain queued callbacks on reset(). 301 // Weak factory used to invalidate certain queued callbacks on reset().
296 // This is useful when doing video frame copies asynchronously since we 302 // 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 303 // want to discard video frames that might be received after the stream has
298 // been reset. 304 // been reset.
299 base::WeakPtrFactory<VideoRendererImpl> frame_callback_weak_factory_; 305 base::WeakPtrFactory<VideoRendererImpl> frame_callback_weak_factory_;
300 306
301 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); 307 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl);
302 }; 308 };
303 309
304 } // namespace media 310 } // namespace media
305 311
306 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ 312 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/renderers/video_renderer_impl.cc » ('j') | media/renderers/video_renderer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698