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>
This commit is contained in:
Lev Zelenskiy
2012-02-09 16:50:30 +10:00
committed by Qt by Nokia
parent 4f38f950b0
commit 0374f0de5e
13 changed files with 777 additions and 24 deletions

View File

@@ -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);