summaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-02-10 15:09:49 +0100
committerLars Knoll <lars.knoll@qt.io>2021-02-12 15:38:24 +0000
commit3c59ba2b3ce96f578b2d677ecc1fbf7da0b2e27f (patch)
tree8bf1df70cb5e264a5674d0eb513841d8dec12251 /src/imports
parent1920146be1193a1136bd279f8036778e8c9c4083 (diff)
Remove camera locking API
QCamera::lock()/unlock() is something that's not needed these days anymore. cameras will automatically focus anyway, there's no real reason to lock the focus (or other properties) to some specific value in 99% of the cases. Plus it wasn't supported on Linux or macOS/iOS anyway. Change-Id: I437d29cbb768da3ece42eea8d753eeafa0c534ae Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/multimedia/plugins.qmltypes66
-rw-r--r--src/imports/multimedia/qdeclarativecamera.cpp71
-rw-r--r--src/imports/multimedia/qdeclarativecamera_p.h16
3 files changed, 0 insertions, 153 deletions
diff --git a/src/imports/multimedia/plugins.qmltypes b/src/imports/multimedia/plugins.qmltypes
index 2450865d5..4dc0f7c90 100644
--- a/src/imports/multimedia/plugins.qmltypes
+++ b/src/imports/multimedia/plugins.qmltypes
@@ -346,33 +346,6 @@ Module {
}
}
Enum {
- name: "LockStatus"
- values: {
- "Unlocked": 0,
- "Searching": 1,
- "Locked": 2
- }
- }
- Enum {
- name: "LockChangeReason"
- values: {
- "UserRequest": 0,
- "LockAcquired": 1,
- "LockFailed": 2,
- "LockLost": 3,
- "LockTemporaryLost": 4
- }
- }
- Enum {
- name: "LockType"
- values: {
- "NoLock": 0,
- "LockExposure": 1,
- "LockWhiteBalance": 2,
- "LockFocus": 4
- }
- }
- Enum {
name: "Position"
values: {
"UnspecifiedPosition": 0,
@@ -383,7 +356,6 @@ Module {
Property { name: "state"; type: "QCamera::State"; isReadonly: true }
Property { name: "status"; type: "QCamera::Status"; isReadonly: true }
Property { name: "captureMode"; type: "QCamera::CaptureModes" }
- Property { name: "lockStatus"; type: "QCamera::LockStatus"; isReadonly: true }
Signal {
name: "stateChanged"
Parameter { name: "state"; type: "QCamera::State" }
@@ -396,19 +368,6 @@ Module {
name: "statusChanged"
Parameter { name: "status"; type: "QCamera::Status" }
}
- Signal { name: "locked" }
- Signal { name: "lockFailed" }
- Signal {
- name: "lockStatusChanged"
- Parameter { name: "status"; type: "QCamera::LockStatus" }
- Parameter { name: "reason"; type: "QCamera::LockChangeReason" }
- }
- Signal {
- name: "lockStatusChanged"
- Parameter { name: "lock"; type: "QCamera::LockType" }
- Parameter { name: "status"; type: "QCamera::LockStatus" }
- Parameter { name: "reason"; type: "QCamera::LockChangeReason" }
- }
Signal {
name: "error"
Parameter { type: "QCamera::Error" }
@@ -421,16 +380,6 @@ Module {
Method { name: "unload" }
Method { name: "start" }
Method { name: "stop" }
- Method { name: "searchAndLock" }
- Method { name: "unlock" }
- Method {
- name: "searchAndLock"
- Parameter { name: "locks"; type: "QCamera::LockTypes" }
- }
- Method {
- name: "unlock"
- Parameter { name: "locks"; type: "QCamera::LockTypes" }
- }
}
Component {
name: "QDeclarativeAudio"
@@ -612,14 +561,6 @@ Module {
}
}
Enum {
- name: "LockStatus"
- values: {
- "Unlocked": 0,
- "Searching": 1,
- "Locked": 2
- }
- }
- Enum {
name: "Error"
values: {
"NoError": 0,
@@ -712,7 +653,6 @@ Module {
Property { name: "captureMode"; type: "CaptureMode" }
Property { name: "cameraState"; type: "State" }
Property { name: "cameraStatus"; type: "Status"; isReadonly: true }
- Property { name: "lockStatus"; type: "LockStatus"; isReadonly: true }
Property { name: "errorCode"; type: "Error"; isReadonly: true }
Property { name: "errorString"; type: "string"; isReadonly: true }
Property { name: "availability"; type: "Availability"; isReadonly: true }
@@ -801,12 +741,6 @@ Module {
name: "setCameraState"
Parameter { name: "state"; type: "State" }
}
- Method { name: "searchAndLock" }
- Method { name: "unlock" }
- Method {
- name: "setOpticalZoom"
- Parameter { type: "double" }
- }
Method {
name: "setDigitalZoom"
Parameter { type: "double" }
diff --git a/src/imports/multimedia/qdeclarativecamera.cpp b/src/imports/multimedia/qdeclarativecamera.cpp
index d2af7ab7d..d47ec4471 100644
--- a/src/imports/multimedia/qdeclarativecamera.cpp
+++ b/src/imports/multimedia/qdeclarativecamera.cpp
@@ -186,8 +186,6 @@ QDeclarativeCamera::QDeclarativeCamera(QObject *parent) :
connect(m_camera, SIGNAL(captureModeChanged(QCamera::CaptureModes)),
this, SIGNAL(captureModeChanged()));
- connect(m_camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason)),
- this, SIGNAL(lockStatusChanged()));
connect(m_camera, &QCamera::stateChanged, this, &QDeclarativeCamera::_q_updateState);
connect(m_camera, SIGNAL(statusChanged(QCamera::Status)), this, SIGNAL(cameraStatusChanged()));
connect(m_camera, SIGNAL(errorOccurred(QCamera::Error)), this, SLOT(_q_errorOccurred(QCamera::Error)));
@@ -561,66 +559,6 @@ void QDeclarativeCamera::stop()
setCameraState(QDeclarativeCamera::LoadedState);
}
-
-/*!
- \qmlproperty enumeration QtMultimedia::Camera::lockStatus
-
- This property holds the status of all the requested camera locks.
-
- \value Camera.Unlocked
- The application is not interested in camera settings value.
- The camera may keep this parameter without changes, which is common
- with camera focus, or adjust exposure and white balance constantly
- to keep the viewfinder image nice.
- \value Camera.Searching
- The application has requested the camera focus, exposure, or white
- balance lock with searchAndLock(). This state indicates the camera
- is focusing or calculating exposure and white balance.
- \value Camera.Locked
- The camera focus, exposure, or white balance is locked.
- The camera is ready to capture, and the application may check the
- exposure parameters.
- The locked state usually means the requested parameter stays the
- same, except in cases where the parameter is requested to be updated
- constantly. For example, in continuous focusing mode, the focus is
- considered locked as long as the object is in focus, even while the
- actual focusing distance may be constantly changing.
-*/
-/*!
- \property QDeclarativeCamera::lockStatus
-
- This property holds the status of all the requested camera locks.
-*/
-QDeclarativeCamera::LockStatus QDeclarativeCamera::lockStatus() const
-{
- return QDeclarativeCamera::LockStatus(m_camera->lockStatus());
-}
-
-/*!
- \qmlmethod QtMultimedia::Camera::searchAndLock()
-
- Start focusing, exposure and white balance calculation.
-
- This is appropriate to call when the camera focus button is pressed
- (or on a camera capture button half-press). If the camera supports
- autofocusing, information on the focus zones is available through
- the \l {CameraFocus}{focus} property.
-*/
-void QDeclarativeCamera::searchAndLock()
-{
- m_camera->searchAndLock();
-}
-
-/*!
- \qmlmethod QtMultimedia::Camera::unlock()
-
- Unlock focus, exposure and white balance locks.
- */
-void QDeclarativeCamera::unlock()
-{
- m_camera->unlock();
-}
-
/*!
\qmlproperty real QtMultimedia::Camera::minimumZoomFactor
@@ -703,15 +641,6 @@ void QDeclarativeCamera::setZoomFactor(qreal value)
*/
/*!
- \qmlsignal Camera::lockStatusChanged()
-
- This signal is emitted when the lock status (focus, exposure etc) changes.
- This can happen when locking (e.g. autofocusing) is complete or has failed.
-
- The corresponding handler is \c onLockStatusChanged.
-*/
-
-/*!
\qmlsignal Camera::cameraStateChanged(state)
This signal is emitted when the camera state has changed to \a state. Since the
diff --git a/src/imports/multimedia/qdeclarativecamera_p.h b/src/imports/multimedia/qdeclarativecamera_p.h
index 0c60d9319..92430c0c4 100644
--- a/src/imports/multimedia/qdeclarativecamera_p.h
+++ b/src/imports/multimedia/qdeclarativecamera_p.h
@@ -84,7 +84,6 @@ class QDeclarativeCamera : public QObject, public QQmlParserStatus
Q_PROPERTY(CaptureMode captureMode READ captureMode WRITE setCaptureMode NOTIFY captureModeChanged)
Q_PROPERTY(State cameraState READ cameraState WRITE setCameraState NOTIFY cameraStateChanged)
Q_PROPERTY(Status cameraStatus READ cameraStatus NOTIFY cameraStatusChanged)
- Q_PROPERTY(LockStatus lockStatus READ lockStatus NOTIFY lockStatusChanged)
Q_PROPERTY(Error errorCode READ errorCode NOTIFY errorChanged)
Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
@@ -105,7 +104,6 @@ class QDeclarativeCamera : public QObject, public QQmlParserStatus
Q_ENUMS(CaptureMode)
Q_ENUMS(State)
Q_ENUMS(Status)
- Q_ENUMS(LockStatus)
Q_ENUMS(Error)
Q_ENUMS(FlashMode)
@@ -148,13 +146,6 @@ public:
ActiveStatus = QCamera::ActiveStatus
};
- enum LockStatus
- {
- Unlocked = QCamera::Unlocked,
- Searching = QCamera::Searching,
- Locked = QCamera::Locked
- };
-
enum Error
{
NoError = QCamera::NoError,
@@ -257,8 +248,6 @@ public:
Error errorCode() const;
QString errorString() const;
- LockStatus lockStatus() const;
-
qreal minimumZoomFactor() const;
qreal maximumZoomFactor() const;
@@ -274,9 +263,6 @@ public Q_SLOTS:
void setCameraState(State state);
- void searchAndLock();
- void unlock();
-
void setZoomFactor(qreal);
Q_REVISION(2) QJSValue supportedResolutions(qreal minimumFrameRate = 0.0,
@@ -296,8 +282,6 @@ Q_SIGNALS:
void cameraStateChanged(QDeclarativeCamera::State);
void cameraStatusChanged();
- void lockStatusChanged();
-
void zoomFactorChanged(qreal);
void mediaSourceChanged();