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

Unified Diff: media/capture/video/fake_video_capture_device.cc

Issue 1983193002: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve Comments Created 4 years, 7 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: media/capture/video/fake_video_capture_device.cc
diff --git a/media/capture/video/fake_video_capture_device.cc b/media/capture/video/fake_video_capture_device.cc
index 9e1479d81cfd44ec20c3d1deacaf0dafd3a28a2f..fef7de5aeef1669dd887f42a1f1fd9c704cacdb8 100644
--- a/media/capture/video/fake_video_capture_device.cc
+++ b/media/capture/video/fake_video_capture_device.cc
@@ -179,9 +179,12 @@ void FakeVideoCaptureDevice::CaptureUsingOwnBuffers(
fake_capture_rate_, capture_format_.frame_size);
// Give the captured frame to the client.
+ base::TimeTicks now = base::TimeTicks::Now();
+ if (first_ref_time_.is_null())
+ first_ref_time_ = now;
client_->OnIncomingCapturedData(fake_frame_.get(), frame_size,
- capture_format_, 0 /* rotation */,
- base::TimeTicks::Now());
+ capture_format_, 0 /* rotation */, now,
+ now - first_ref_time_);
BeepAndScheduleNextCapture(
expected_execution_time,
base::Bind(&FakeVideoCaptureDevice::CaptureUsingOwnBuffers,
@@ -227,8 +230,11 @@ void FakeVideoCaptureDevice::CaptureUsingClientBuffers(
}
// Give the captured frame to the client.
+ base::TimeTicks now = base::TimeTicks::Now();
+ if (first_ref_time_.is_null())
+ first_ref_time_ = now;
client_->OnIncomingCapturedBuffer(std::move(capture_buffer), capture_format_,
- base::TimeTicks::Now());
+ now, now - first_ref_time_);
BeepAndScheduleNextCapture(
expected_execution_time,
« no previous file with comments | « media/capture/video/fake_video_capture_device.h ('k') | media/capture/video/fake_video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698