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

Unified Diff: content/renderer/media/canvas_capture_handler.cc

Issue 1782193003: Fix timestamp drift in CanvasCaptureHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/canvas_capture_handler.cc
diff --git a/content/renderer/media/canvas_capture_handler.cc b/content/renderer/media/canvas_capture_handler.cc
index 15ebf053d2d55cb948a5095ba472b23110293c55..fd6e55f26818448d57e3964dac05b3526b0778f5 100644
--- a/content/renderer/media/canvas_capture_handler.cc
+++ b/content/renderer/media/canvas_capture_handler.cc
@@ -194,9 +194,10 @@ void CanvasCaptureHandler::CreateNewFrame(const SkImage* image) {
}
const bool isOpaque = image->isOpaque();
+ const base::TimeTicks timestamp = base::TimeTicks::Now();
scoped_refptr<media::VideoFrame> video_frame = frame_pool_.CreateFrame(
isOpaque ? media::PIXEL_FORMAT_I420 : media::PIXEL_FORMAT_YV12A, size,
- gfx::Rect(size), size, base::TimeTicks::Now() - base::TimeTicks());
+ gfx::Rect(size), size, timestamp - base::TimeTicks());
DCHECK(video_frame);
// TODO(emircan): Use https://code.google.com/p/libyuv/issues/detail?id=572
@@ -218,8 +219,7 @@ void CanvasCaptureHandler::CreateNewFrame(const SkImage* image) {
FROM_HERE,
base::Bind(&CanvasCaptureHandler::CanvasCaptureHandlerDelegate::
SendNewFrameOnIOThread,
- delegate_->GetWeakPtrForIOThread(), video_frame,
- base::TimeTicks::Now()));
+ delegate_->GetWeakPtrForIOThread(), video_frame, timestamp));
}
void CanvasCaptureHandler::AddVideoCapturerSourceToVideoTrack(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698