diff options
author | miu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 20:07:27 +0000 |
---|---|---|
committer | miu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 20:07:27 +0000 |
commit | b2d4e61698efbe48d3c0f07790f5c9ee328f8bfd (patch) | |
tree | 48bd219a4c6859c58dd1e7d341aa5b8a23c7135e /content/port | |
parent | c22efb13446cf238a6d99820ff2ca9f061e76d33 (diff) | |
download | chromium_src-b2d4e61698efbe48d3c0f07790f5c9ee328f8bfd.zip chromium_src-b2d4e61698efbe48d3c0f07790f5c9ee328f8bfd.tar.gz chromium_src-b2d4e61698efbe48d3c0f07790f5c9ee328f8bfd.tar.bz2 |
Improve FrameSubscriber decision-making for smoother frame capture sampling.
Added a "present time" argument to the ShouldCaptureFrame() method to communicate to the implementation when a frame is to be displayed on the screen (e.g., around regular v-sync intervals). Then, replaced the existing sampling logic with use of a token bucket.
This is needed to support smooth frame capturing on Mac when the asynchronous read-back code path is used (in CompositingIOSurfaceMac). See: https://codereview.chromium.org/14361007/ This change is also likely to produce none to some improvement on other platforms.
BUG=232006,232264,232256
Review URL: https://chromiumcodereview.appspot.com/14384002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196211 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port')
-rw-r--r-- | content/port/browser/render_widget_host_view_frame_subscriber.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/content/port/browser/render_widget_host_view_frame_subscriber.h b/content/port/browser/render_widget_host_view_frame_subscriber.h index de1ee089..fb88860 100644 --- a/content/port/browser/render_widget_host_view_frame_subscriber.h +++ b/content/port/browser/render_widget_host_view_frame_subscriber.h @@ -44,8 +44,9 @@ class RenderWidgetHostViewFrameSubscriber { base::Time /* timestamp */, bool /* frame_captured */)> DeliverFrameCallback; - // Called when a new frame is going to be presented. Implementation can - // decide whether the current frame should be captured or not. + // Called when a new frame is going to be presented at time + // |present_time|. Implementation can decide whether the current frame should + // be captured or not. // // Return true if the current frame should be captured. If so, |storage| // should will be set to hold an appropriately sized and allocated buffer @@ -61,6 +62,7 @@ class RenderWidgetHostViewFrameSubscriber { // // Return false if the current frame should not be captured. virtual bool ShouldCaptureFrame( + base::Time present_time, scoped_refptr<media::VideoFrame>* storage, DeliverFrameCallback* callback) = 0; }; |