GStreamer: port to 1.0.
0.10 is still used by default. To enable GStreamer 1.0, pass GST_VERSION=1.0 to qmake for qtmultimedia.pro. Contributions from: Andrew den Exter <andrew.den.exter@qinetic.com.au> Ilya Smelykh <ilya@videoexpertsgroup.com> Jim Hodapp <jim.hodapp@canonical.com> Sergio Schvezov <sergio.schvezov@canonical.com> Change-Id: I72a46d1170a8794a149bdb5e20767afcc5b7587c Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
This commit is contained in:
committed by
Andrew den Exter
parent
7e3d69668e
commit
108dda7a90
@@ -41,8 +41,10 @@
|
||||
#include <QtCore/qurl.h>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include <private/qgstreamerbushelper_p.h>
|
||||
#include <private/qgstreamerbufferprobe_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -70,7 +72,10 @@ public:
|
||||
virtual QList<QSize> supportedResolutions(qreal frameRate = -1) const = 0;
|
||||
};
|
||||
|
||||
class QGstreamerCaptureSession : public QObject, public QGstreamerBusMessageFilter
|
||||
class QGstreamerCaptureSession
|
||||
: public QObject
|
||||
, public QGstreamerBusMessageFilter
|
||||
, private QGstreamerBufferProbe
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qint64 duration READ duration NOTIFY durationChanged)
|
||||
@@ -131,7 +136,6 @@ public:
|
||||
|
||||
void addProbe(QGstreamerAudioProbeControl* probe);
|
||||
void removeProbe(QGstreamerAudioProbeControl* probe);
|
||||
static gboolean padAudioBufferProbe(GstPad *pad, GstBuffer *buffer, gpointer user_data);
|
||||
|
||||
signals:
|
||||
void stateChanged(QGstreamerCaptureSession::State state);
|
||||
@@ -156,6 +160,9 @@ public slots:
|
||||
void setVolume(qreal volume);
|
||||
|
||||
private:
|
||||
void probeCaps(GstCaps *caps);
|
||||
bool probeBuffer(GstBuffer *buffer);
|
||||
|
||||
enum PipelineMode { EmptyPipeline, PreviewPipeline, RecordingPipeline, PreviewAndRecordingPipeline };
|
||||
|
||||
GstElement *buildEncodeBin();
|
||||
@@ -180,9 +187,7 @@ private:
|
||||
QGstreamerCaptureSession::CaptureMode m_captureMode;
|
||||
QMap<QByteArray, QVariant> m_metaData;
|
||||
|
||||
QList<QGstreamerAudioProbeControl*> m_audioProbes;
|
||||
QMutex m_audioProbeMutex;
|
||||
int m_audioBufferProbeId;
|
||||
QGstreamerAudioProbeControl *m_audioProbe;
|
||||
|
||||
QGstreamerElementFactory *m_audioInputFactory;
|
||||
QGstreamerElementFactory *m_audioPreviewFactory;
|
||||
@@ -217,6 +222,10 @@ private:
|
||||
|
||||
GstElement *m_encodeBin;
|
||||
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
GstVideoInfo m_previewInfo;
|
||||
#endif
|
||||
|
||||
public:
|
||||
bool m_passImage;
|
||||
bool m_passPrerollImage;
|
||||
|
||||
Reference in New Issue
Block a user