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

Unified Diff: media/capture/video/mac/video_capture_device_mac.mm

Issue 1783603004: Revert of Use system timestamp as capture timestamp (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 | media/capture/video/win/video_capture_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/mac/video_capture_device_mac.mm
diff --git a/media/capture/video/mac/video_capture_device_mac.mm b/media/capture/video/mac/video_capture_device_mac.mm
index 432fbfbf4343231e42d82878bbd0dc5ec5886c69..ec6fcaf83f9279d46beea362f6b16a9814607456 100644
--- a/media/capture/video/mac/video_capture_device_mac.mm
+++ b/media/capture/video/mac/video_capture_device_mac.mm
@@ -545,8 +545,18 @@
return;
}
+ base::TimeTicks aligned_timestamp;
+ if (timestamp == media::kNoTimestamp()) {
+ aligned_timestamp = base::TimeTicks::Now();
+ } else {
+ if (first_timestamp_ == media::kNoTimestamp()) {
+ first_timestamp_ = timestamp;
+ first_aligned_timestamp_ = base::TimeTicks::Now();
+ }
+ aligned_timestamp = first_aligned_timestamp_ + timestamp - first_timestamp_;
+ }
client_->OnIncomingCapturedData(video_frame, video_frame_length, frame_format,
- 0, base::TimeTicks::Now());
+ 0, aligned_timestamp);
}
void VideoCaptureDeviceMac::ReceiveError(
« no previous file with comments | « no previous file | media/capture/video/win/video_capture_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698