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 CONTENT_RENDERER_MEDIA_VIDEO_FRAME_COMPOSITOR_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_FRAME_COMPOSITOR_H_ |
6 #define CONTENT_RENDERER_MEDIA_VIDEO_FRAME_COMPOSITOR_H_ | 6 #define CONTENT_RENDERER_MEDIA_VIDEO_FRAME_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 45 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
46 const base::Callback<void(gfx::Size)>& natural_size_changed_cb); | 46 const base::Callback<void(gfx::Size)>& natural_size_changed_cb); |
47 ~VideoFrameCompositor(); | 47 ~VideoFrameCompositor(); |
48 | 48 |
49 cc::VideoFrameProvider* GetVideoFrameProvider(); | 49 cc::VideoFrameProvider* GetVideoFrameProvider(); |
50 | 50 |
51 // Updates the current frame and notifies the compositor. | 51 // Updates the current frame and notifies the compositor. |
52 void UpdateCurrentFrame(const scoped_refptr<media::VideoFrame>& frame); | 52 void UpdateCurrentFrame(const scoped_refptr<media::VideoFrame>& frame); |
53 | 53 |
54 // Retrieves the last frame set via UpdateCurrentFrame() for non-compositing | 54 // Retrieves the last frame set via UpdateCurrentFrame() for non-compositing |
55 // purposes (e.g., painting to a canvas). Frames retrieved in this manner will | 55 // purposes (e.g., painting to a canvas). |
56 // not be counted as being composited for frame drop counting. | |
57 // | 56 // |
58 // Note that the compositor retrieves frames via the cc::VideoFrameProvider | 57 // Note that the compositor retrieves frames via the cc::VideoFrameProvider |
59 // interface instead of using this method. | 58 // interface instead of using this method. |
60 scoped_refptr<media::VideoFrame> GetCurrentFrame(); | 59 scoped_refptr<media::VideoFrame> GetCurrentFrame(); |
61 | 60 |
62 // Returns the number of frames dropped before the compositor was notified as | 61 // Returns the number of frames dropped before the compositor was notified |
63 // well as being able to composite the previous frame. | 62 // of a new frame. |
64 uint32 GetFramesDroppedBeforeComposite(); | 63 uint32 GetFramesDroppedBeforeComposite(); |
xhwang
2014/03/27 21:28:59
The name is not accurate now. "BeforeComposite" sh
scherkus (not reviewing)
2014/03/29 00:34:14
let's go with the extremely long but accurate name
| |
65 | 64 |
66 void SetFramesDroppedBeforeCompositeForTesting(uint32 dropped_frames); | 65 void SetFramesDroppedBeforeCompositeForTesting(uint32 dropped_frames); |
67 | 66 |
68 private: | 67 private: |
69 class Internal; | 68 class Internal; |
70 Internal* internal_; | 69 Internal* internal_; |
71 | 70 |
72 DISALLOW_COPY_AND_ASSIGN(VideoFrameCompositor); | 71 DISALLOW_COPY_AND_ASSIGN(VideoFrameCompositor); |
73 }; | 72 }; |
74 | 73 |
75 } // namespace content | 74 } // namespace content |
76 | 75 |
77 #endif // CONTENT_RENDERER_MEDIA_VIDEO_FRAME_COMPOSITOR_H_ | 76 #endif // CONTENT_RENDERER_MEDIA_VIDEO_FRAME_COMPOSITOR_H_ |
OLD | NEW |