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

@@ -64,6 +64,8 @@
#endif
#include "qgstreamerstreamscontrol.h"
#include "qgstreameraudioprobecontrol.h"
#include "qgstreamervideoprobecontrol.h"
#include <qmediaplaylistnavigator.h>
#include <qmediaplaylist.h>
@@ -115,6 +117,24 @@ QMediaControl *QGstreamerPlayerService::requestControl(const char *name)
if (qstrcmp(name,QMediaStreamsControl_iid) == 0)
return m_streamsControl;
if (qstrcmp(name,QMediaVideoProbeControl_iid) == 0) {
if (m_session) {
QGstreamerVideoProbeControl *probe = new QGstreamerVideoProbeControl(this);
m_session->addProbe(probe);
return probe;
}
return 0;
}
if (qstrcmp(name,QMediaAudioProbeControl_iid) == 0) {
if (m_session) {
QGstreamerAudioProbeControl *probe = new QGstreamerAudioProbeControl(this);
m_session->addProbe(probe);
return probe;
}
return 0;
}
if (!m_videoOutput) {
if (qstrcmp(name, QVideoRendererControl_iid) == 0)
m_videoOutput = m_videoRenderer;
@@ -140,6 +160,22 @@ void QGstreamerPlayerService::releaseControl(QMediaControl *control)
m_videoOutput = 0;
m_control->setVideoOutput(0);
}
QGstreamerVideoProbeControl* videoProbe = qobject_cast<QGstreamerVideoProbeControl*>(control);
if (videoProbe) {
if (m_session)
m_session->removeProbe(videoProbe);
delete videoProbe;
return;
}
QGstreamerAudioProbeControl* audioProbe = qobject_cast<QGstreamerAudioProbeControl*>(control);
if (audioProbe) {
if (m_session)
m_session->removeProbe(audioProbe);
delete audioProbe;
return;
}
}
QT_END_NAMESPACE