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>
This commit is contained in:
Andrew den Exter
2014-07-15 02:18:11 +00:00
committed by Andrew den Exter
parent 9932feec63
commit be7fef656a
2 changed files with 235 additions and 28 deletions

View File

@@ -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