summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/camerabin/camerabinimagecapture.h
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2014-11-20 17:54:18 +0100
committerAndrew den Exter <andrew.den.exter@qinetic.com.au>2014-11-27 23:30:05 +0100
commit108dda7a90bd0f0337358b0db47ae55acd16dea6 (patch)
treee74c44c004b257fb99fdc96063641c76ac0426cf /src/plugins/gstreamer/camerabin/camerabinimagecapture.h
parent7e3d69668e3f04110a651dee1850a1d0c885947b (diff)
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>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinimagecapture.h')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimagecapture.h50
1 files changed, 45 insertions, 5 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.h b/src/plugins/gstreamer/camerabin/camerabinimagecapture.h
index c2e26f51c..9a52dd9da 100644
--- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.h
+++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.h
@@ -38,6 +38,14 @@
#include <qcameraimagecapturecontrol.h>
#include "camerabinsession.h"
+#include <qvideosurfaceformat.h>
+
+#include <private/qgstreamerbufferprobe_p.h>
+
+#if GST_CHECK_VERSION(1,0,0)
+#include <gst/video/video.h>
+#endif
+
QT_BEGIN_NAMESPACE
class CameraBinImageCapture : public QCameraImageCaptureControl, public QGstreamerBusMessageFilter
@@ -61,15 +69,47 @@ private slots:
void updateState();
private:
- static gboolean metadataEventProbe(GstPad *pad, GstEvent *event, CameraBinImageCapture *);
- static gboolean uncompressedBufferProbe(GstPad *pad, GstBuffer *buffer, CameraBinImageCapture *);
- static gboolean jpegBufferProbe(GstPad *pad, GstBuffer *buffer, CameraBinImageCapture *);
+#if GST_CHECK_VERSION(1,0,0)
+ static GstPadProbeReturn encoderEventProbe(GstPad *, GstPadProbeInfo *info, gpointer user_data);
+#else
+ static gboolean encoderEventProbe(GstElement *, GstEvent *event, gpointer user_data);
+#endif
+
+ class EncoderProbe : public QGstreamerBufferProbe
+ {
+ public:
+ EncoderProbe(CameraBinImageCapture *capture) : capture(capture) {}
+ void probeCaps(GstCaps *caps);
+ bool probeBuffer(GstBuffer *buffer);
+
+ private:
+ CameraBinImageCapture * const capture;
+ } m_encoderProbe;
+
+ class MuxerProbe : public QGstreamerBufferProbe
+ {
+ public:
+ MuxerProbe(CameraBinImageCapture *capture) : capture(capture) {}
+ void probeCaps(GstCaps *caps);
+ bool probeBuffer(GstBuffer *buffer);
+ private:
+ CameraBinImageCapture * const capture;
+
+ } m_muxerProbe;
+
+ QVideoSurfaceFormat m_bufferFormat;
+ QSize m_jpegResolution;
CameraBinSession *m_session;
- bool m_ready;
- int m_requestId;
GstElement *m_jpegEncoderElement;
GstElement *m_metadataMuxerElement;
+#if GST_CHECK_VERSION(1,0,0)
+ GstVideoInfo m_videoInfo;
+#else
+ int m_bytesPerLine;
+#endif
+ int m_requestId;
+ bool m_ready;
};
QT_END_NAMESPACE