From a2f078f1088827ec2bc066aaee7ca3199c6cb4eb Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 16 Aug 2013 17:51:53 +0200 Subject: WMF and GStreamer: fixed incorrect frame startTime and endTime. The QVideoFrame documentation explicitly says that the time is in microseconds, however the GStreamer backend was setting the time in milliseconds and the WMF backend in 100-nanosecond units. With WMF, the time was missing from the QVideoFrame when presenting it to the video surface. Task-number: QTBUG-31731 Change-Id: I0638d2abf8eed25b3a531db67c19a18703e5b630 Reviewed-by: Andy Nichols --- src/gsttools/qvideosurfacegstsink.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gsttools') diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp index 94aa1262e..f91c1192d 100644 --- a/src/gsttools/qvideosurfacegstsink.cpp +++ b/src/gsttools/qvideosurfacegstsink.cpp @@ -713,13 +713,14 @@ QVideoSurfaceFormat QVideoSurfaceGstSink::formatForCaps(GstCaps *caps, int *byte void QVideoSurfaceGstSink::setFrameTimeStamps(QVideoFrame *frame, GstBuffer *buffer) { + // GStreamer uses nanoseconds, Qt uses microseconds qint64 startTime = GST_BUFFER_TIMESTAMP(buffer); if (startTime >= 0) { - frame->setStartTime(startTime/G_GINT64_CONSTANT (1000000)); + frame->setStartTime(startTime/G_GINT64_CONSTANT (1000)); qint64 duration = GST_BUFFER_DURATION(buffer); if (duration >= 0) - frame->setEndTime((startTime + duration)/G_GINT64_CONSTANT (1000000)); + frame->setEndTime((startTime + duration)/G_GINT64_CONSTANT (1000)); } } -- cgit v1.2.3