Changed QCamera::captureMode property to QFlags
This enables the expression of extra camera modes like viewfinder only or capture during video recording. Change-Id: Ie02fdeef5eb7fd6fc2f133c1afb0141e37c22b06 Reviewed-by: Mithra Pattison <mithra.pattison@nokia.com> Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
a6268601c9
commit
53d71baed3
@@ -64,7 +64,7 @@ public:
|
||||
qRegisterMetaType<QCamera::Error>("QCamera::Error");
|
||||
qRegisterMetaType<QCamera::State>("QCamera::State");
|
||||
qRegisterMetaType<QCamera::Status>("QCamera::Status");
|
||||
qRegisterMetaType<QCamera::CaptureMode>("QCamera::CaptureMode");
|
||||
qRegisterMetaType<QCamera::CaptureModes>("QCamera::CaptureModes");
|
||||
qRegisterMetaType<QCamera::LockType>("QCamera::LockType");
|
||||
qRegisterMetaType<QCamera::LockStatus>("QCamera::LockStatus");
|
||||
qRegisterMetaType<QCamera::LockChangeReason>("QCamera::LockChangeReason");
|
||||
@@ -246,8 +246,8 @@ void QCameraPrivate::initControls()
|
||||
if (control) {
|
||||
q->connect(control, SIGNAL(stateChanged(QCamera::State)), q, SLOT(_q_updateState(QCamera::State)));
|
||||
q->connect(control, SIGNAL(statusChanged(QCamera::Status)), q, SIGNAL(statusChanged(QCamera::Status)));
|
||||
q->connect(control, SIGNAL(captureModeChanged(QCamera::CaptureMode)),
|
||||
q, SIGNAL(captureModeChanged(QCamera::CaptureMode)));
|
||||
q->connect(control, SIGNAL(captureModeChanged(QCamera::CaptureModes)),
|
||||
q, SIGNAL(captureModeChanged(QCamera::CaptureModes)));
|
||||
q->connect(control, SIGNAL(error(int,QString)), q, SLOT(_q_error(int,QString)));
|
||||
|
||||
}
|
||||
@@ -538,7 +538,7 @@ QString QCamera::errorString() const
|
||||
/*!
|
||||
Returns true if the capture \a mode is suported.
|
||||
*/
|
||||
bool QCamera::isCaptureModeSupported(QCamera::CaptureMode mode) const
|
||||
bool QCamera::isCaptureModeSupported(QCamera::CaptureModes mode) const
|
||||
{
|
||||
return d_func()->control ? d_func()->control->isCaptureModeSupported(mode) : false;
|
||||
}
|
||||
@@ -556,12 +556,12 @@ bool QCamera::isCaptureModeSupported(QCamera::CaptureMode mode) const
|
||||
and when the camera is ready to QCamera::ActiveStatus.
|
||||
*/
|
||||
|
||||
QCamera::CaptureMode QCamera::captureMode() const
|
||||
QCamera::CaptureModes QCamera::captureMode() const
|
||||
{
|
||||
return d_func()->control ? d_func()->control->captureMode() : QCamera::CaptureStillImage;
|
||||
}
|
||||
|
||||
void QCamera::setCaptureMode(QCamera::CaptureMode mode)
|
||||
void QCamera::setCaptureMode(QCamera::CaptureModes mode)
|
||||
{
|
||||
Q_D(QCamera);
|
||||
|
||||
@@ -866,6 +866,7 @@ void QCamera::unlock()
|
||||
|
||||
/*!
|
||||
\enum QCamera::CaptureMode
|
||||
\value CaptureViewfinder Camera is only configured to display viewfinder.
|
||||
\value CaptureStillImage Camera is configured for still frames capture.
|
||||
\value CaptureVideo Camera is configured for video capture.
|
||||
*/
|
||||
@@ -969,7 +970,7 @@ void QCamera::unlock()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QCamera::captureModeChanged(QCamera::CaptureMode mode)
|
||||
\fn void QCamera::captureModeChanged(QCamera::CaptureModes mode)
|
||||
|
||||
Signals the capture \a mode has changed.
|
||||
*/
|
||||
|
||||
@@ -76,7 +76,7 @@ class Q_MULTIMEDIA_EXPORT QCamera : public QMediaObject
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QCamera::State state READ state NOTIFY stateChanged)
|
||||
Q_PROPERTY(QCamera::Status status READ status NOTIFY statusChanged)
|
||||
Q_PROPERTY(QCamera::CaptureMode captureMode READ captureMode WRITE setCaptureMode NOTIFY captureModeChanged)
|
||||
Q_PROPERTY(QCamera::CaptureModes captureMode READ captureMode WRITE setCaptureMode NOTIFY captureModeChanged)
|
||||
Q_PROPERTY(QCamera::LockStatus lockStatus READ lockStatus NOTIFY lockStatusChanged)
|
||||
|
||||
Q_ENUMS(Status)
|
||||
@@ -105,9 +105,11 @@ public:
|
||||
|
||||
enum CaptureMode
|
||||
{
|
||||
CaptureStillImage,
|
||||
CaptureVideo
|
||||
CaptureViewfinder = 0,
|
||||
CaptureStillImage = 0x01,
|
||||
CaptureVideo = 0x02
|
||||
};
|
||||
Q_DECLARE_FLAGS(CaptureModes, CaptureMode)
|
||||
|
||||
enum Error
|
||||
{
|
||||
@@ -155,8 +157,8 @@ public:
|
||||
State state() const;
|
||||
Status status() const;
|
||||
|
||||
CaptureMode captureMode() const;
|
||||
bool isCaptureModeSupported(CaptureMode mode) const;
|
||||
CaptureModes captureMode() const;
|
||||
bool isCaptureModeSupported(CaptureModes mode) const;
|
||||
|
||||
QCameraExposure *exposure() const;
|
||||
QCameraFocus *focus() const;
|
||||
@@ -176,7 +178,7 @@ public:
|
||||
QCamera::LockStatus lockStatus(QCamera::LockType lock) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setCaptureMode(QCamera::CaptureMode mode);
|
||||
void setCaptureMode(QCamera::CaptureModes mode);
|
||||
|
||||
void load();
|
||||
void unload();
|
||||
@@ -192,7 +194,7 @@ public Q_SLOTS:
|
||||
|
||||
Q_SIGNALS:
|
||||
void stateChanged(QCamera::State);
|
||||
void captureModeChanged(QCamera::CaptureMode);
|
||||
void captureModeChanged(QCamera::CaptureModes);
|
||||
void statusChanged(QCamera::Status);
|
||||
|
||||
void locked();
|
||||
@@ -221,6 +223,7 @@ Q_DECLARE_METATYPE(QCamera::State)
|
||||
Q_DECLARE_METATYPE(QCamera::Status)
|
||||
Q_DECLARE_METATYPE(QCamera::Error)
|
||||
Q_DECLARE_METATYPE(QCamera::CaptureMode)
|
||||
Q_DECLARE_METATYPE(QCamera::CaptureModes)
|
||||
Q_DECLARE_METATYPE(QCamera::LockType)
|
||||
Q_DECLARE_METATYPE(QCamera::LockStatus)
|
||||
Q_DECLARE_METATYPE(QCamera::LockChangeReason)
|
||||
|
||||
@@ -145,13 +145,13 @@ QCameraControl::~QCameraControl()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn Camera::CaptureMode QCameraControl::captureMode() const = 0
|
||||
\fn Camera::CaptureModes QCameraControl::captureMode() const = 0
|
||||
|
||||
Returns the current capture mode.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QCameraControl::setCaptureMode(QCamera::CaptureMode mode) = 0;
|
||||
\fn void QCameraControl::setCaptureMode(QCamera::CaptureModes mode) = 0;
|
||||
|
||||
Sets the current capture \a mode.
|
||||
|
||||
@@ -166,13 +166,13 @@ QCameraControl::~QCameraControl()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool QCameraControl::isCaptureModeSupported(QCamera::CaptureMode mode) const = 0;
|
||||
\fn bool QCameraControl::isCaptureModeSupported(QCamera::CaptureModes mode) const = 0;
|
||||
|
||||
Returns true if the capture \a mode is suported.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QCameraControl::captureModeChanged(QCamera::CaptureMode mode)
|
||||
\fn QCameraControl::captureModeChanged(QCamera::CaptureModes mode)
|
||||
|
||||
Signal emitted when the camera capture \a mode changes.
|
||||
*/
|
||||
|
||||
@@ -73,9 +73,9 @@ public:
|
||||
|
||||
virtual QCamera::Status status() const = 0;
|
||||
|
||||
virtual QCamera::CaptureMode captureMode() const = 0;
|
||||
virtual void setCaptureMode(QCamera::CaptureMode) = 0;
|
||||
virtual bool isCaptureModeSupported(QCamera::CaptureMode mode) const = 0;
|
||||
virtual QCamera::CaptureModes captureMode() const = 0;
|
||||
virtual void setCaptureMode(QCamera::CaptureModes) = 0;
|
||||
virtual bool isCaptureModeSupported(QCamera::CaptureModes mode) const = 0;
|
||||
|
||||
virtual bool canChangeProperty(PropertyChangeType changeType, QCamera::Status status) const = 0;
|
||||
|
||||
@@ -83,7 +83,7 @@ Q_SIGNALS:
|
||||
void stateChanged(QCamera::State);
|
||||
void statusChanged(QCamera::Status);
|
||||
void error(int error, const QString &errorString);
|
||||
void captureModeChanged(QCamera::CaptureMode);
|
||||
void captureModeChanged(QCamera::CaptureModes);
|
||||
|
||||
protected:
|
||||
QCameraControl(QObject* parent = 0);
|
||||
|
||||
Reference in New Issue
Block a user