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

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

Issue 1421583007: Mac Video Capture: Sending the timestamps provided by the driver to the capture pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fallback Created 5 years, 1 month 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/mac/video_capture_device_qtkit_mac.mm
diff --git a/media/capture/video/mac/video_capture_device_qtkit_mac.mm b/media/capture/video/mac/video_capture_device_qtkit_mac.mm
index 1ea4c9e44988f8cfb18d5f03ba8f2c13f236d948..de77a346987ea3d2d0033f9b5a67ea8b859532c9 100644
--- a/media/capture/video/mac/video_capture_device_qtkit_mac.mm
+++ b/media/capture/video/mac/video_capture_device_qtkit_mac.mm
@@ -325,8 +325,19 @@
}
// Deliver the captured video frame.
+ const QTTime qt_timestamp = [sampleBuffer presentationTime];
+ base::TimeTicks timestamp;
+ if (!(qt_timestamp.flags & kQTTimeIsIndefinite) && qt_timestamp.timeScale) {
+ timestamp =
+ base::TimeTicks() +
+ base::TimeDelta::FromMicroseconds(
+ qt_timestamp.timeValue * base::TimeTicks::kMicrosecondsPerSecond /
+ qt_timestamp.timeScale);
+ } else {
+ timestamp = base::TimeTicks::Now();
+ }
frameReceiver_->ReceiveFrame(addressToPass, frameSize, captureFormat,
- aspectNumerator, aspectDenominator);
+ aspectNumerator, aspectDenominator, timestamp);
CVPixelBufferUnlockBaseAddress(videoFrame, kLockFlags);
}

Powered by Google App Engine
This is Rietveld 408576698