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

Unified Diff: content/browser/media/capture/web_contents_video_capture_device.cc

Issue 418283003: "Buttery Smooth" Tab Capture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Un-inline some methods, plus REBASE. Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/media/capture/web_contents_video_capture_device.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc
index 7eb2d944c24dcc340d49f1316dfc6d4cdee5b79d..2789634ea4eb3486855b3e3ff3cf0e4553e0754d 100644
--- a/content/browser/media/capture/web_contents_video_capture_device.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device.cc
@@ -137,6 +137,7 @@ class FrameSubscriber : public RenderWidgetHostViewFrameSubscriber {
delivery_log_(delivery_log) {}
virtual bool ShouldCaptureFrame(
+ const gfx::Rect& damage_rect,
base::TimeTicks present_time,
scoped_refptr<media::VideoFrame>* storage,
RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback*
@@ -332,6 +333,7 @@ class WebContentsCaptureMachine
};
bool FrameSubscriber::ShouldCaptureFrame(
+ const gfx::Rect& damage_rect,
base::TimeTicks present_time,
scoped_refptr<media::VideoFrame>* storage,
DeliverFrameCallback* deliver_frame_cb) {
@@ -340,7 +342,7 @@ bool FrameSubscriber::ShouldCaptureFrame(
ThreadSafeCaptureOracle::CaptureFrameCallback capture_frame_cb;
bool oracle_decision = oracle_proxy_->ObserveEventAndDecideCapture(
- event_type_, present_time, storage, &capture_frame_cb);
+ event_type_, damage_rect, present_time, storage, &capture_frame_cb);
if (!capture_frame_cb.is_null())
*deliver_frame_cb = base::Bind(capture_frame_cb, *storage);
@@ -384,7 +386,7 @@ ContentCaptureSubscription::ContentCaptureSubscription(
Source<RenderWidgetHost>(&source));
// Subscribe to timer events. This instance will service these as well.
- timer_.Start(FROM_HERE, oracle_proxy->capture_period(),
+ timer_.Start(FROM_HERE, oracle_proxy->min_capture_period(),
base::Bind(&ContentCaptureSubscription::OnTimer,
base::Unretained(this)));
}
@@ -433,7 +435,8 @@ void ContentCaptureSubscription::Observe(
scoped_refptr<media::VideoFrame> frame;
RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback deliver_frame_cb;
const base::TimeTicks start_time = base::TimeTicks::Now();
- if (paint_subscriber_.ShouldCaptureFrame(start_time,
+ if (paint_subscriber_.ShouldCaptureFrame(gfx::Rect(),
+ start_time,
&frame,
&deliver_frame_cb)) {
// This message happens just before paint. If we post a task to do the copy,
@@ -452,7 +455,8 @@ void ContentCaptureSubscription::OnTimer() {
RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback deliver_frame_cb;
const base::TimeTicks start_time = base::TimeTicks::Now();
- if (timer_subscriber_.ShouldCaptureFrame(start_time,
+ if (timer_subscriber_.ShouldCaptureFrame(gfx::Rect(),
+ start_time,
&frame,
&deliver_frame_cb)) {
capture_callback_.Run(start_time, frame, deliver_frame_cb);

Powered by Google App Engine
This is Rietveld 408576698