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

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: Alignment 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
« no previous file with comments | « media/capture/video/mac/video_capture_device_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..044e0ff0a81fb393400c857ad2d63bbf6fd9ee62 100644
--- a/media/capture/video/mac/video_capture_device_qtkit_mac.mm
+++ b/media/capture/video/mac/video_capture_device_qtkit_mac.mm
@@ -8,6 +8,7 @@
#include "base/debug/crash_logging.h"
#include "base/logging.h"
+#include "media/base/timestamp_constants.h"
#include "media/base/video_capture_types.h"
#include "media/capture/video/mac/video_capture_device_mac.h"
#include "media/capture/video/video_capture_device.h"
@@ -325,8 +326,17 @@
}
// Deliver the captured video frame.
+ const QTTime qt_timestamp = [sampleBuffer presentationTime];
+ base::TimeDelta timestamp;
+ if (!(qt_timestamp.flags & kQTTimeIsIndefinite) && qt_timestamp.timeScale) {
+ timestamp = base::TimeDelta::FromMicroseconds(
+ qt_timestamp.timeValue * base::TimeTicks::kMicrosecondsPerSecond /
+ qt_timestamp.timeScale);
+ } else {
+ timestamp = media::kNoTimestamp();
+ }
frameReceiver_->ReceiveFrame(addressToPass, frameSize, captureFormat,
- aspectNumerator, aspectDenominator);
+ aspectNumerator, aspectDenominator, timestamp);
CVPixelBufferUnlockBaseAddress(videoFrame, kLockFlags);
}
« no previous file with comments | « media/capture/video/mac/video_capture_device_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698