summaryrefslogtreecommitdiffstats
path: root/src/gsttools
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-08-16 17:51:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-22 13:16:49 +0200
commita2f078f1088827ec2bc066aaee7ca3199c6cb4eb (patch)
treea83d8cdf2f16d2950442373360dd169eb62e750f /src/gsttools
parentca769ba264f868ea2f41f2656f7126218b428ad4 (diff)
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 <andy.nichols@digia.com>
Diffstat (limited to 'src/gsttools')
-rw-r--r--src/gsttools/qvideosurfacegstsink.cpp5
1 files changed, 3 insertions, 2 deletions
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));
}
}