summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/camerabin/camerabinfocus.h
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den.exter@jollamobile.com>2014-07-15 02:18:11 +0000
committerAndrew den Exter <andrew.den.exter@qinetic.com.au>2014-11-28 06:07:59 +0100
commitbe7fef656a1d087d3d1d3fa102da4fce85855935 (patch)
treed7e612429d27abdcb5ecd75f09a5ed6b028eca4e /src/plugins/gstreamer/camerabin/camerabinfocus.h
parent9932feec63994d87c586a07513e692545ba0db9e (diff)
Add support for face detection focus point mode to camerabin backend.
[ChangeLog][GStreamer] Implemented the face detection focus point mode in the gstreamer camerabin backend. Change-Id: Ia582d2fb5e74d5b438aa0038224c5e20e597d53e Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinfocus.h')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinfocus.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinfocus.h b/src/plugins/gstreamer/camerabin/camerabinfocus.h
index 1ac013789..4fa5cb550 100644
--- a/src/plugins/gstreamer/camerabin/camerabinfocus.h
+++ b/src/plugins/gstreamer/camerabin/camerabinfocus.h
@@ -37,6 +37,12 @@
#include <qcamera.h>
#include <qcamerafocuscontrol.h>
+#include <private/qgstreamerbufferprobe_p.h>
+
+#include <qbasictimer.h>
+#include <qmutex.h>
+#include <qvector.h>
+
#include <gst/gst.h>
#include <glib.h>
@@ -44,7 +50,11 @@ QT_BEGIN_NAMESPACE
class CameraBinSession;
-class CameraBinFocus : public QCameraFocusControl
+class CameraBinFocus
+ : public QCameraFocusControl
+#if GST_CHECK_VERSION(1,0,0)
+ , QGstreamerBufferProbe
+#endif
{
Q_OBJECT
@@ -76,13 +86,27 @@ public Q_SLOTS:
void setViewfinderResolution(const QSize &resolution);
+#if GST_CHECK_VERSION(1,0,0)
+protected:
+ void timerEvent(QTimerEvent *event);
+#endif
+
private Q_SLOTS:
void _q_setFocusStatus(QCamera::LockStatus status, QCamera::LockChangeReason reason);
void _q_handleCameraStateChange(QCamera::State state);
+#if GST_CHECK_VERSION(1,0,0)
+ void _q_updateFaces();
+#endif
+
private:
void resetFocusPoint();
- void updateRegionOfInterest(const QRectF &focusRect, int priority);
+ void updateRegionOfInterest(const QRectF &rectangle);
+ void updateRegionOfInterest(const QVector<QRect> &rectangles);
+
+#if GST_CHECK_VERSION(1,0,0)
+ bool probeBuffer(GstBuffer *buffer);
+#endif
CameraBinSession *m_session;
QCamera::State m_cameraState;
@@ -93,6 +117,10 @@ private:
QPointF m_focusPoint;
QRectF m_focusRect;
QSize m_viewfinderResolution;
+ QVector<QRect> m_faces;
+ QVector<QRect> m_faceFocusRects;
+ QBasicTimer m_faceResetTimer;
+ mutable QMutex m_mutex;
};
QT_END_NAMESPACE