QMediaRecorder: GStreamer backend changes for media probing API.

QGstreamerCaptureSession: Using GStreamer buffer probe
to access media data.

Change-Id: I2ee38e864fbd69fcba9efe90d4dcf138528e00c0
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Lev Zelenskiy
2012-02-15 14:45:18 +10:00
committed by Qt by Nokia
parent 0374f0de5e
commit 16aef59187
3 changed files with 113 additions and 0 deletions

View File

@@ -54,6 +54,7 @@
#include "qgstreameraudioinputendpointselector.h"
#include "qgstreamervideoinputdevicecontrol.h"
#include "qgstreamerimagecapturecontrol.h"
#include "qgstreameraudioprobecontrol.h"
#include "qgstreamervideorenderer.h"
@@ -162,6 +163,15 @@ QMediaControl *QGstreamerCaptureService::requestControl(const char *name)
if (qstrcmp(name, QCameraImageCaptureControl_iid) == 0)
return m_imageCaptureControl;
if (qstrcmp(name,QMediaAudioProbeControl_iid) == 0) {
if (m_captureSession) {
QGstreamerAudioProbeControl *probe = new QGstreamerAudioProbeControl(this);
m_captureSession->addProbe(probe);
return probe;
}
return 0;
}
if (!m_videoOutput) {
if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
m_videoOutput = m_videoRenderer;
@@ -189,6 +199,14 @@ void QGstreamerCaptureService::releaseControl(QMediaControl *control)
m_videoOutput = 0;
m_captureSession->setVideoPreview(0);
}
QGstreamerAudioProbeControl* audioProbe = qobject_cast<QGstreamerAudioProbeControl*>(control);
if (audioProbe) {
if (m_captureSession)
m_captureSession->removeProbe(audioProbe);
delete audioProbe;
return;
}
}
QT_END_NAMESPACE