diff options
author | Lev Zelenskiy <lev.zelenskiy@nokia.com> | 2012-02-09 16:50:30 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-16 07:18:16 +0100 |
commit | 0374f0de5ec881569e463505b232b3870c0fd9d2 (patch) | |
tree | f09822298ad5071377979f48a764ea40a44f2eda /src/gsttools/qvideosurfacegstsink.cpp | |
parent | 4f38f950b0e4b0637a2a267638496a44456ae456 (diff) |
GStreamer backend changes for media probing API.
QGstreamerPlayerSession: Using GStreamer buffer probes
to access media data.
Change-Id: Ibc056283fdedaebba90456cc4e86ab63eae5f5f7
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'src/gsttools/qvideosurfacegstsink.cpp')
-rw-r--r-- | src/gsttools/qvideosurfacegstsink.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp index da11ac74a..89284628c 100644 --- a/src/gsttools/qvideosurfacegstsink.cpp +++ b/src/gsttools/qvideosurfacegstsink.cpp @@ -199,16 +199,7 @@ GstFlowReturn QVideoSurfaceGstDelegate::render(GstBuffer *buffer) m_format.frameSize(), m_format.pixelFormat()); - qint64 startTime = GST_BUFFER_TIMESTAMP(buffer); - - if (startTime >= 0) { - m_frame.setStartTime(startTime/G_GINT64_CONSTANT (1000000)); - - qint64 duration = GST_BUFFER_DURATION(buffer); - - if (duration >= 0) - m_frame.setEndTime((startTime + duration)/G_GINT64_CONSTANT (1000000)); - } + QVideoSurfaceGstSink::setFrameTimeStamps(&m_frame, buffer); m_renderReturn = GST_FLOW_OK; @@ -685,6 +676,18 @@ QVideoSurfaceFormat QVideoSurfaceGstSink::formatForCaps(GstCaps *caps, int *byte return QVideoSurfaceFormat(); } +void QVideoSurfaceGstSink::setFrameTimeStamps(QVideoFrame *frame, GstBuffer *buffer) +{ + qint64 startTime = GST_BUFFER_TIMESTAMP(buffer); + if (startTime >= 0) { + frame->setStartTime(startTime/G_GINT64_CONSTANT (1000000)); + + qint64 duration = GST_BUFFER_DURATION(buffer); + if (duration >= 0) + frame->setEndTime((startTime + duration)/G_GINT64_CONSTANT (1000000)); + } +} + void QVideoSurfaceGstSink::handleShowPrerollChange(GObject *o, GParamSpec *p, gpointer d) { Q_UNUSED(o); |