summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-05-17 14:35:58 +0200
committerLars Knoll <lars.knoll@qt.io>2021-05-18 08:44:31 +0000
commit7b2e6ea598a15a81ad1ed15c5392472db4c23b7f (patch)
treeb597451a2ea01e07b6e455db68a2320608972f33 /src/multimedia
parentd78a921256b50399cead644d69d2a06d43ef3e5c (diff)
Merge QCameraExposure into QCamera
As per API review, let's only have one class for QCamera. Change-Id: I663e238e93ffd83708821e46f8f154c1fdc07731 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/CMakeLists.txt1
-rw-r--r--src/multimedia/camera/qcamera.cpp512
-rw-r--r--src/multimedia/camera/qcamera.h99
-rw-r--r--src/multimedia/camera/qcamera_p.h13
-rw-r--r--src/multimedia/camera/qcameraexposure.cpp629
-rw-r--r--src/multimedia/camera/qcameraexposure.h174
-rw-r--r--src/multimedia/doc/src/cameraoverview.qdoc22
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp108
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol_p.h20
-rw-r--r--src/multimedia/platform/darwin/camera/avfcameraexposure.mm64
-rw-r--r--src/multimedia/platform/darwin/camera/avfcameraexposure_p.h18
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp94
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure_p.h6
-rw-r--r--src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp60
-rw-r--r--src/multimedia/platform/qnx/camera/bbcameraexposurecontrol_p.h10
-rw-r--r--src/multimedia/platform/qplatformcameraexposure.cpp2
-rw-r--r--src/multimedia/platform/qplatformcameraexposure_p.h13
-rw-r--r--src/multimedia/platform/windows/mediacapture/qwindowscameraexposure.cpp16
-rw-r--r--src/multimedia/platform/windows/mediacapture/qwindowscameraexposure_p.h12
-rw-r--r--src/multimedia/qmediametadata.cpp4
20 files changed, 828 insertions, 1049 deletions
diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt
index 3dc1078e2..1b2e6a779 100644
--- a/src/multimedia/CMakeLists.txt
+++ b/src/multimedia/CMakeLists.txt
@@ -27,7 +27,6 @@ qt_internal_add_module(Multimedia
audio/qsoundeffect.cpp audio/qsoundeffect.h
audio/qwavedecoder.cpp audio/qwavedecoder.h
camera/qcamera.cpp camera/qcamera.h camera/qcamera_p.h
- camera/qcameraexposure.cpp camera/qcameraexposure.h
camera/qcameraimagecapture.cpp camera/qcameraimagecapture.h
camera/qcameraimageprocessing.cpp camera/qcameraimageprocessing.h
camera/qcamerainfo.cpp camera/qcamerainfo.h camera/qcamerainfo_p.h
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index fbe0496e6..0a159470e 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -114,7 +114,6 @@ void QCameraPrivate::init()
control->setCamera(cameraInfo);
q->connect(control, SIGNAL(activeChanged(bool)), q, SIGNAL(activeChanged(bool)));
q->connect(control, SIGNAL(error(int,QString)), q, SLOT(_q_error(int,QString)));
- cameraExposure = new QCameraExposure(q, control);
focusControl = control->focusControl();
@@ -125,6 +124,15 @@ void QCameraPrivate::init()
q, SIGNAL(maximumZoomFactorChanged(float)));
}
+ exposureControl = control->exposureControl();
+ if (exposureControl) {
+ q->connect(exposureControl, SIGNAL(actualValueChanged(int)),
+ q, SLOT(_q_exposureParameterChanged(int)));
+ q->connect(exposureControl, SIGNAL(parameterRangeChanged(int)),
+ q, SLOT(_q_exposureParameterRangeChanged(int)));
+ q->connect(exposureControl, SIGNAL(flashReady(bool)), q, SIGNAL(flashReady(bool)));
+ }
+
imageProcessing = new QCameraImageProcessing(q, control);
}
@@ -229,14 +237,6 @@ void QCamera::setActive(bool active)
}
/*!
- Returns the camera exposure control object.
-*/
-QCameraExposure *QCamera::exposure() const
-{
- return d_func()->cameraExposure;
-}
-
-/*!
Returns the camera image processing control object.
*/
QCameraImageProcessing *QCamera::imageProcessing() const
@@ -659,6 +659,500 @@ void QCamera::zoomTo(float factor, float rate)
like capture mode or resolution.
*/
+
+template<typename T>
+T QCameraPrivate::actualExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const
+{
+ QVariant value = exposureControl ? exposureControl->actualValue(parameter) : QVariant();
+
+ return value.isValid() ? value.value<T>() : defaultValue;
+}
+
+template<typename T>
+T QCameraPrivate::requestedExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const
+{
+ QVariant value = exposureControl ? exposureControl->requestedValue(parameter) : QVariant();
+
+ return value.isValid() ? value.value<T>() : defaultValue;
+}
+
+template<typename T>
+void QCameraPrivate::setExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &value)
+{
+ if (exposureControl)
+ exposureControl->setValue(parameter, QVariant::fromValue<T>(value));
+}
+
+void QCameraPrivate::resetExposureParameter(QPlatformCameraExposure::ExposureParameter parameter)
+{
+ if (exposureControl)
+ exposureControl->setValue(parameter, QVariant());
+}
+
+
+void QCameraPrivate::_q_exposureParameterChanged(int parameter)
+{
+ Q_Q(QCamera);
+
+#if DEBUG_EXPOSURE_CHANGES
+ qDebug() << "Exposure parameter changed:"
+ << QPlatformCameraExposure::ExposureParameter(parameter)
+ << exposureControl->actualValue(QPlatformCameraExposure::ExposureParameter(parameter));
+#endif
+
+ switch (parameter) {
+ case QPlatformCameraExposure::ISO:
+ emit q->isoSensitivityChanged(q->isoSensitivity());
+ break;
+ case QPlatformCameraExposure::Aperture:
+ emit q->apertureChanged(q->aperture());
+ break;
+ case QPlatformCameraExposure::ShutterSpeed:
+ emit q->shutterSpeedChanged(q->shutterSpeed());
+ break;
+ case QPlatformCameraExposure::ExposureCompensation:
+ emit q->exposureCompensationChanged(q->exposureCompensation());
+ break;
+ }
+}
+
+void QCameraPrivate::_q_exposureParameterRangeChanged(int parameter)
+{
+ Q_Q(QCamera);
+
+ switch (parameter) {
+ case QPlatformCameraExposure::Aperture:
+ emit q->apertureRangeChanged();
+ break;
+ case QPlatformCameraExposure::ShutterSpeed:
+ emit q->shutterSpeedRangeChanged();
+ break;
+ }
+}
+
+/*!
+ \property QCamera::flashMode
+ \brief The flash mode being used.
+
+ Enables a certain flash mode if the camera has a flash.
+
+ \sa QCamera::isFlashModeSupported(), QCamera::isFlashReady()
+*/
+QCamera::FlashMode QCamera::flashMode() const
+{
+ return d_func()->exposureControl ? d_func()->exposureControl->flashMode() : QCamera::FlashOff;
+}
+
+void QCamera::setFlashMode(QCamera::FlashMode mode)
+{
+ if (d_func()->exposureControl)
+ d_func()->exposureControl->setFlashMode(mode);
+}
+
+/*!
+ Returns true if the flash \a mode is supported.
+*/
+
+bool QCamera::isFlashModeSupported(QCamera::FlashMode mode) const
+{
+ return d_func()->exposureControl ? d_func()->exposureControl->isFlashModeSupported(mode) : (mode == FlashOff);
+}
+
+/*!
+ Returns true if flash is charged.
+*/
+
+bool QCamera::isFlashReady() const
+{
+ return d_func()->exposureControl ? d_func()->exposureControl->isFlashReady() : false;
+}
+
+/*!
+ \property QCamera::torchMode
+ \brief The torch mode being used.
+
+ A torch is a continuous light source used for low light video recording. Enabling torch mode
+ will usually override any currently set flash mode.
+
+ \sa QCamera::isTorchModeSupported(), QCamera::flashMode
+*/
+QCamera::TorchMode QCamera::torchMode() const
+{
+ return d_func()->exposureControl ? d_func()->exposureControl->torchMode() : TorchOff;
+}
+
+void QCamera::setTorchMode(QCamera::TorchMode mode)
+{
+ if (d_func()->exposureControl)
+ d_func()->exposureControl->setTorchMode(mode);
+}
+
+/*!
+ Returns true if the torch \a mode is supported.
+*/
+bool QCamera::isTorchModeSupported(QCamera::TorchMode mode) const
+{
+ return d_func()->exposureControl ? d_func()->exposureControl->isTorchModeSupported(mode) : (mode == TorchOff);
+}
+
+/*!
+ \property QCamera::exposureMode
+ \brief The exposure mode being used.
+
+ \sa QCamera::isExposureModeSupported()
+*/
+
+QCamera::ExposureMode QCamera::exposureMode() const
+{
+ return d_func()->actualExposureParameter<QCamera::ExposureMode>(QPlatformCameraExposure::ExposureMode, QCamera::ExposureAuto);
+}
+
+void QCamera::setExposureMode(QCamera::ExposureMode mode)
+{
+ d_func()->setExposureParameter<QCamera::ExposureMode>(QPlatformCameraExposure::ExposureMode, mode);
+}
+
+/*!
+ Returns true if the exposure \a mode is supported.
+*/
+
+bool QCamera::isExposureModeSupported(QCamera::ExposureMode mode) const
+{
+ if (!d_func()->exposureControl)
+ return false;
+
+ bool continuous = false;
+ return d_func()->exposureControl->supportedParameterRange(QPlatformCameraExposure::ExposureMode, &continuous)
+ .contains(QVariant::fromValue<QCamera::ExposureMode>(mode));
+}
+
+/*!
+ \property QCamera::exposureCompensation
+ \brief Exposure compensation in EV units.
+
+ Exposure compensation property allows to adjust the automatically calculated exposure.
+*/
+
+qreal QCamera::exposureCompensation() const
+{
+ return d_func()->actualExposureParameter<qreal>(QPlatformCameraExposure::ExposureCompensation, 0.0);
+}
+
+void QCamera::setExposureCompensation(qreal ev)
+{
+ d_func()->setExposureParameter<qreal>(QPlatformCameraExposure::ExposureCompensation, ev);
+}
+
+int QCamera::isoSensitivity() const
+{
+ return d_func()->actualExposureParameter<int>(QPlatformCameraExposure::ISO, -1);
+}
+
+/*!
+ Returns the requested ISO sensitivity
+ or -1 if automatic ISO is turned on.
+*/
+int QCamera::requestedIsoSensitivity() const
+{
+ return d_func()->requestedExposureParameter<int>(QPlatformCameraExposure::ISO, -1);
+}
+
+/*!
+ Returns the list of ISO senitivities camera supports.
+
+ If the camera supports arbitrary ISO sensitivities within the supported range,
+ *\a continuous is set to true, otherwise *\a continuous is set to false.
+*/
+QList<int> QCamera::supportedIsoSensitivities(bool *continuous) const
+{
+ QList<int> res;
+ QPlatformCameraExposure *control = d_func()->exposureControl;
+
+ bool tmp = false;
+ if (!continuous)
+ continuous = &tmp;
+
+ if (!control)
+ return res;
+
+ const auto range = control->supportedParameterRange(QPlatformCameraExposure::ISO, continuous);
+ for (const QVariant &value : range) {
+ bool ok = false;
+ int intValue = value.toInt(&ok);
+ if (ok)
+ res.append(intValue);
+ else
+ qWarning() << "Incompatible ISO value type, int is expected";
+ }
+
+ return res;
+}
+
+/*!
+ \fn QCamera::setManualIsoSensitivity(int iso)
+ Sets the manual sensitivity to \a iso
+*/
+
+void QCamera::setManualIsoSensitivity(int iso)
+{
+ d_func()->setExposureParameter<int>(QPlatformCameraExposure::ISO, iso);
+}
+
+/*!
+ \fn QCamera::setAutoIsoSensitivity()
+ Turn on auto sensitivity
+*/
+
+void QCamera::setAutoIsoSensitivity()
+{
+ d_func()->resetExposureParameter(QPlatformCameraExposure::ISO);
+}
+
+/*!
+ \property QCamera::shutterSpeed
+ \brief Camera's shutter speed in seconds.
+
+ \sa supportedShutterSpeeds(), setAutoShutterSpeed(), setManualShutterSpeed()
+*/
+
+/*!
+ \fn QCamera::shutterSpeedChanged(qreal speed)
+
+ Signals that a camera's shutter \a speed has changed.
+*/
+
+/*!
+ \property QCamera::isoSensitivity
+ \brief The sensor ISO sensitivity.
+
+ \sa supportedIsoSensitivities(), setAutoIsoSensitivity(), setManualIsoSensitivity()
+*/
+
+/*!
+ \property QCamera::aperture
+ \brief Lens aperture is specified as an F number, the ratio of the focal length to effective aperture diameter.
+
+ \sa supportedApertures(), setAutoAperture(), setManualAperture(), requestedAperture()
+*/
+
+
+qreal QCamera::aperture() const
+{
+ return d_func()->actualExposureParameter<qreal>(QPlatformCameraExposure::Aperture, -1.0);
+}
+
+/*!
+ Returns the requested manual aperture
+ or -1.0 if automatic aperture is turned on.
+*/
+qreal QCamera::requestedAperture() const
+{
+ return d_func()->requestedExposureParameter<qreal>(QPlatformCameraExposure::Aperture, -1.0);
+}
+
+
+/*!
+ Returns the list of aperture values camera supports.
+ The apertures list can change depending on the focal length,
+ in such a case the apertureRangeChanged() signal is emitted.
+
+ If the camera supports arbitrary aperture values within the supported range,
+ *\a continuous is set to true, otherwise *\a continuous is set to false.
+*/
+QList<qreal> QCamera::supportedApertures(bool * continuous) const
+{
+ QList<qreal> res;
+ QPlatformCameraExposure *control = d_func()->exposureControl;
+
+ bool tmp = false;
+ if (!continuous)
+ continuous = &tmp;
+
+ if (!control)
+ return res;
+
+ const auto range = control->supportedParameterRange(QPlatformCameraExposure::Aperture, continuous);
+ for (const QVariant &value : range) {
+ bool ok = false;
+ qreal realValue = value.toReal(&ok);
+ if (ok)
+ res.append(realValue);
+ else
+ qWarning() << "Incompatible aperture value type, qreal is expected";
+ }
+
+ return res;
+}
+
+/*!
+ \fn QCamera::setManualAperture(qreal aperture)
+ Sets the manual camera \a aperture value.
+*/
+
+void QCamera::setManualAperture(qreal aperture)
+{
+ d_func()->setExposureParameter<qreal>(QPlatformCameraExposure::Aperture, aperture);
+}
+
+/*!
+ \fn QCamera::setAutoAperture()
+ Turn on auto aperture
+*/
+
+void QCamera::setAutoAperture()
+{
+ d_func()->resetExposureParameter(QPlatformCameraExposure::Aperture);
+}
+
+/*!
+ Returns the current shutter speed in seconds.
+*/
+
+qreal QCamera::shutterSpeed() const
+{
+ return d_func()->actualExposureParameter<qreal>(QPlatformCameraExposure::ShutterSpeed, -1.0);
+}
+
+/*!
+ Returns the requested manual shutter speed in seconds
+ or -1.0 if automatic shutter speed is turned on.
+*/
+qreal QCamera::requestedShutterSpeed() const
+{
+ return d_func()->requestedExposureParameter<qreal>(QPlatformCameraExposure::ShutterSpeed, -1.0);
+}
+
+/*!
+ Returns the list of shutter speed values in seconds camera supports.
+
+ If the camera supports arbitrary shutter speed values within the supported range,
+ *\a continuous is set to true, otherwise *\a continuous is set to false.
+*/
+QList<qreal> QCamera::supportedShutterSpeeds(bool *continuous) const
+{
+ QList<qreal> res;
+ QPlatformCameraExposure *control = d_func()->exposureControl;
+
+ bool tmp = false;
+ if (!continuous)
+ continuous = &tmp;
+
+ if (!control)
+ return res;
+
+ const auto range = control->supportedParameterRange(QPlatformCameraExposure::ShutterSpeed, continuous);
+ for (const QVariant &value : range) {
+ bool ok = false;
+ qreal realValue = value.toReal(&ok);
+ if (ok)
+ res.append(realValue);
+ else
+ qWarning() << "Incompatible shutter speed value type, qreal is expected";
+ }
+
+ return res;
+}
+
+/*!
+ Set the manual shutter speed to \a seconds
+*/
+
+void QCamera::setManualShutterSpeed(qreal seconds)
+{
+ d_func()->setExposureParameter<qreal>(QPlatformCameraExposure::ShutterSpeed, seconds);
+}
+
+/*!
+ Turn on auto shutter speed
+*/
+
+void QCamera::setAutoShutterSpeed()
+{
+ d_func()->resetExposureParameter(QPlatformCameraExposure::ShutterSpeed);
+}
+
+
+/*!
+ \enum QCamera::FlashMode
+
+ \value FlashOff Flash is Off.
+ \value FlashOn Flash is On.
+ \value FlashAuto Automatic flash.
+*/
+
+/*!
+ \enum QCamera::TorchMode
+
+ \value TorchOff Torch is Off.
+ \value TorchOn Torch is On.
+ \value TorchAuto Automatic torch.
+*/
+
+/*!
+ \enum QCamera::ExposureMode
+
+ \value ExposureAuto Automatic mode.
+ \value ExposureManual Manual mode.
+ \value ExposurePortrait Portrait exposure mode.
+ \value ExposureNight Night mode.
+ \value ExposureSports Spots exposure mode.
+ \value ExposureSnow Snow exposure mode.
+ \value ExposureBeach Beach exposure mode.
+ \value ExposureAction Action mode. Since 5.5
+ \value ExposureLandscape Landscape mode. Since 5.5
+ \value ExposureNightPortrait Night portrait mode. Since 5.5
+ \value ExposureTheatre Theatre mode. Since 5.5
+ \value ExposureSunset Sunset mode. Since 5.5
+ \value ExposureSteadyPhoto Steady photo mode. Since 5.5
+ \value ExposureFireworks Fireworks mode. Since 5.5
+ \value ExposureParty Party mode. Since 5.5
+ \value ExposureCandlelight Candlelight mode. Since 5.5
+ \value ExposureBarcode Barcode mode. Since 5.5
+*/
+
+/*!
+ \property QCamera::flashReady
+ \brief Indicates if the flash is charged and ready to use.
+*/
+
+/*!
+ \fn void QCamera::flashReady(bool ready)
+
+ Signal the flash \a ready status has changed.
+*/
+
+/*!
+ \fn void QCamera::apertureChanged(qreal value)
+
+ Signal emitted when aperature changes to \a value.
+*/
+
+/*!
+ \fn void QCamera::apertureRangeChanged()
+
+ Signal emitted when aperature range has changed.
+*/
+
+
+/*!
+ \fn void QCamera::shutterSpeedRangeChanged()
+
+ Signal emitted when the shutter speed range has changed.
+*/
+
+
+/*!
+ \fn void QCamera::isoSensitivityChanged(int value)
+
+ Signal emitted when sensitivity changes to \a value.
+*/
+
+/*!
+ \fn void QCamera::exposureCompensationChanged(qreal value)
+
+ Signal emitted when the exposure compensation changes to \a value.
+*/
+
QT_END_NAMESPACE
#include "moc_qcamera.cpp"
diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h
index 7acae0c3a..988b9adf3 100644
--- a/src/multimedia/camera/qcamera.h
+++ b/src/multimedia/camera/qcamera.h
@@ -48,7 +48,6 @@
#include <QtCore/qobject.h>
-#include <QtMultimedia/qcameraexposure.h>
#include <QtMultimedia/qcameraimageprocessing.h>
#include <QtMultimedia/qcamerainfo.h>
@@ -67,7 +66,6 @@ class Q_MULTIMEDIA_EXPORT QCamera : public QObject
Q_OBJECT
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
Q_PROPERTY(QCamera::Status status READ status NOTIFY statusChanged)
- Q_PROPERTY(QCameraExposure* exposure READ exposure CONSTANT)
Q_PROPERTY(QCameraImageProcessing* imageProcessing READ imageProcessing CONSTANT)
Q_PROPERTY(QCameraInfo cameraInfo READ cameraInfo WRITE setCameraInfo NOTIFY cameraInfoChanged)
Q_PROPERTY(Error error READ error NOTIFY errorChanged)
@@ -81,10 +79,24 @@ class Q_MULTIMEDIA_EXPORT QCamera : public QObject
Q_PROPERTY(float minimumZoomFactor READ minimumZoomFactor NOTIFY minimumZoomFactorChanged)
Q_PROPERTY(float maximumZoomFactor READ maximumZoomFactor NOTIFY maximumZoomFactorChanged)
Q_PROPERTY(float zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged)
+ Q_PROPERTY(qreal aperture READ aperture NOTIFY apertureChanged)
+ Q_PROPERTY(qreal shutterSpeed READ shutterSpeed NOTIFY shutterSpeedChanged)
+ Q_PROPERTY(int isoSensitivity READ isoSensitivity NOTIFY isoSensitivityChanged)
+ Q_PROPERTY(qreal exposureCompensation READ exposureCompensation WRITE setExposureCompensation NOTIFY exposureCompensationChanged)
+ Q_PROPERTY(bool flashReady READ isFlashReady NOTIFY flashReady)
+ Q_PROPERTY(QCamera::FlashMode flashMode READ flashMode WRITE setFlashMode)
+ Q_PROPERTY(QCamera::TorchMode torchMode READ torchMode WRITE setTorchMode)
+ Q_PROPERTY(QCamera::ExposureMode exposureMode READ exposureMode WRITE setExposureMode)
- Q_ENUMS(FocusMode)
Q_ENUMS(Status)
Q_ENUMS(Error)
+
+ Q_ENUMS(FocusMode)
+
+ Q_ENUMS(FlashMode)
+ Q_ENUMS(TorchMode)
+ Q_ENUMS(ExposureMode)
+
public:
enum Status {
UnavailableStatus,
@@ -109,6 +121,38 @@ public:
FocusModeManual
};
+ enum FlashMode {
+ FlashOff,
+ FlashOn,
+ FlashAuto
+ };
+
+ enum TorchMode {
+ TorchOff,
+ TorchOn,
+ TorchAuto
+ };
+
+ enum ExposureMode {
+ ExposureAuto,
+ ExposureManual,
+ ExposurePortrait,
+ ExposureNight,
+ ExposureSports,
+ ExposureSnow,
+ ExposureBeach,
+ ExposureAction,
+ ExposureLandscape,
+ ExposureNightPortrait,
+ ExposureTheatre,
+ ExposureSunset,
+ ExposureSteadyPhoto,
+ ExposureFireworks,
+ ExposureParty,
+ ExposureCandlelight,
+ ExposureBarcode
+ };
+
explicit QCamera(QObject *parent = nullptr);
explicit QCamera(const QCameraInfo& cameraInfo, QObject *parent = nullptr);
explicit QCamera(QCameraInfo::Position position, QObject *parent = nullptr);
@@ -127,7 +171,6 @@ public:
QCameraFormat cameraFormat() const;
void setCameraFormat(const QCameraFormat &format);
- QCameraExposure *exposure() const;
QCameraImageProcessing *imageProcessing() const;
Error error() const;
@@ -151,6 +194,30 @@ public:
float zoomFactor() const;
void setZoomFactor(float factor);
+ FlashMode flashMode() const;
+ bool isFlashModeSupported(FlashMode mode) const;
+ bool isFlashReady() const;
+
+ TorchMode torchMode() const;
+ bool isTorchModeSupported(TorchMode mode) const;
+
+ ExposureMode exposureMode() const;
+ bool isExposureModeSupported(ExposureMode mode) const;
+
+ qreal exposureCompensation() const;
+
+ int isoSensitivity() const;
+ qreal aperture() const;
+ qreal shutterSpeed() const;
+
+ int requestedIsoSensitivity() const;
+ qreal requestedAperture() const;
+ qreal requestedShutterSpeed() const;
+
+ QList<int> supportedIsoSensitivities(bool *continuous = nullptr) const;
+ QList<qreal> supportedApertures(bool *continuous = nullptr) const;
+ QList<qreal> supportedShutterSpeeds(bool *continuous = nullptr) const;
+
public Q_SLOTS:
void setActive(bool active);
void start() { setActive(true); }
@@ -158,6 +225,21 @@ public Q_SLOTS:
void zoomTo(float zoom, float rate);
+ void setFlashMode(FlashMode mode);
+ void setTorchMode(TorchMode mode);
+ void setExposureMode(ExposureMode mode);
+
+ void setExposureCompensation(qreal ev);
+
+ void setManualIsoSensitivity(int iso);
+ void setAutoIsoSensitivity();
+
+ void setManualAperture(qreal aperture);
+ void setAutoAperture();
+
+ void setManualShutterSpeed(qreal seconds);
+ void setAutoShutterSpeed();
+
Q_SIGNALS:
void activeChanged(bool);
void statusChanged(QCamera::Status status);
@@ -173,6 +255,15 @@ Q_SIGNALS:
void focusDistanceChanged(float);
void customFocusPointChanged();
+ void flashReady(bool);
+
+ void apertureChanged(qreal);
+ void apertureRangeChanged();
+ void shutterSpeedChanged(qreal speed);
+ void shutterSpeedRangeChanged();
+ void isoSensitivityChanged(int);
+ void exposureCompensationChanged(qreal);
+
private:
void setCaptureSession(QMediaCaptureSession *session);
friend class QMediaCaptureSession;
diff --git a/src/multimedia/camera/qcamera_p.h b/src/multimedia/camera/qcamera_p.h
index 67f06eeb3..0224ac6d5 100644
--- a/src/multimedia/camera/qcamera_p.h
+++ b/src/multimedia/camera/qcamera_p.h
@@ -54,11 +54,13 @@
#include "private/qobject_p.h"
#include "qcamera.h"
#include "qcamerainfo.h"
+#include <private/qplatformcameraexposure_p.h>
QT_BEGIN_NAMESPACE
class QPlatformCamera;
class QPlatformCameraFocus;
+class QPlatformCameraExposure;
class QPlatformMediaCaptureSession;
class QCameraPrivate : public QObjectPrivate
@@ -77,7 +79,6 @@ public:
QPlatformMediaCaptureSession *captureInterface = nullptr;
QPlatformCamera *control = nullptr;
- QCameraExposure *cameraExposure = nullptr;
QCameraImageProcessing *imageProcessing = nullptr;
QObject *capture = nullptr;
@@ -92,6 +93,16 @@ public:
float zoomFactor = 1.;
QPointF customFocusPoint{-1, -1};
+ QPlatformCameraExposure *exposureControl;
+
+ template<typename T> T actualExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const;
+ template<typename T> T requestedExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const;
+ template<typename T> void setExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &value);
+ void resetExposureParameter(QPlatformCameraExposure::ExposureParameter parameter);
+
+ void _q_exposureParameterChanged(int parameter);
+ void _q_exposureParameterRangeChanged(int parameter);
+
void _q_error(int error, const QString &errorString);
void unsetError() { error = QCamera::NoError; errorString.clear(); }
};
diff --git a/src/multimedia/camera/qcameraexposure.cpp b/src/multimedia/camera/qcameraexposure.cpp
deleted file mode 100644
index 173b92d4a..000000000
--- a/src/multimedia/camera/qcameraexposure.cpp
+++ /dev/null
@@ -1,629 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qcameraexposure.h"
-#include "private/qobject_p.h"
-
-#include <qcamera.h>
-#include <private/qplatformcameraexposure_p.h>
-#include <private/qplatformcamera_p.h>
-
-#include <QtCore/QMetaObject>
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QCameraExposure
-
-
- \brief The QCameraExposure class provides interface for exposure related camera settings.
-
- \inmodule QtMultimedia
- \ingroup multimedia
- \ingroup multimedia_camera
-
-*/
-
-//#define DEBUG_EXPOSURE_CHANGES 1
-
-class QCameraExposurePrivate
-{
- Q_DECLARE_PUBLIC(QCameraExposure)
-public:
- void init(QPlatformCamera *cameraControl);
- QCameraExposure *q_ptr;
-
- template<typename T> T actualExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const;
- template<typename T> T requestedExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const;
- template<typename T> void setExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &value);
- void resetExposureParameter(QPlatformCameraExposure::ExposureParameter parameter);
-
- QCamera *camera;
- QPlatformCameraExposure *exposureControl;
-
- void _q_exposureParameterChanged(int parameter);
- void _q_exposureParameterRangeChanged(int parameter);
-};
-
-void QCameraExposurePrivate::init(QPlatformCamera *cameraControl)
-{
- Q_Q(QCameraExposure);
-
- exposureControl = cameraControl->exposureControl();
-
- if (!exposureControl)
- return;
-
- q->connect(exposureControl, SIGNAL(actualValueChanged(int)),
- q, SLOT(_q_exposureParameterChanged(int)));
- q->connect(exposureControl, SIGNAL(parameterRangeChanged(int)),
- q, SLOT(_q_exposureParameterRangeChanged(int)));
- q->connect(exposureControl, SIGNAL(flashReady(bool)), q, SIGNAL(flashReady(bool)));
-}
-
-template<typename T>
-T QCameraExposurePrivate::actualExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const
-{
- QVariant value = exposureControl ? exposureControl->actualValue(parameter) : QVariant();
-
- return value.isValid() ? value.value<T>() : defaultValue;
-}
-
-template<typename T>
-T QCameraExposurePrivate::requestedExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &defaultValue) const
-{
- QVariant value = exposureControl ? exposureControl->requestedValue(parameter) : QVariant();
-
- return value.isValid() ? value.value<T>() : defaultValue;
-}
-
-template<typename T>
-void QCameraExposurePrivate::setExposureParameter(QPlatformCameraExposure::ExposureParameter parameter, const T &value)
-{
- if (exposureControl)
- exposureControl->setValue(parameter, QVariant::fromValue<T>(value));
-}
-
-void QCameraExposurePrivate::resetExposureParameter(QPlatformCameraExposure::ExposureParameter parameter)
-{
- if (exposureControl)
- exposureControl->setValue(parameter, QVariant());
-}
-
-
-void QCameraExposurePrivate::_q_exposureParameterChanged(int parameter)
-{
- Q_Q(QCameraExposure);
-
-#if DEBUG_EXPOSURE_CHANGES
- qDebug() << "Exposure parameter changed:"
- << QPlatformCameraExposure::ExposureParameter(parameter)
- << exposureControl->actualValue(QPlatformCameraExposure::ExposureParameter(parameter));
-#endif
-
- switch (parameter) {
- case QPlatformCameraExposure::ISO:
- emit q->isoSensitivityChanged(q->isoSensitivity());
- break;
- case QPlatformCameraExposure::Aperture:
- emit q->apertureChanged(q->aperture());
- break;
- case QPlatformCameraExposure::ShutterSpeed:
- emit q->shutterSpeedChanged(q->shutterSpeed());
- break;
- case QPlatformCameraExposure::ExposureCompensation:
- emit q->exposureCompensationChanged(q->exposureCompensation());
- break;
- }
-}
-
-void QCameraExposurePrivate::_q_exposureParameterRangeChanged(int parameter)
-{
- Q_Q(QCameraExposure);
-
- switch (parameter) {
- case QPlatformCameraExposure::Aperture:
- emit q->apertureRangeChanged();
- break;
- case QPlatformCameraExposure::ShutterSpeed:
- emit q->shutterSpeedRangeChanged();
- break;
- }
-}
-
-/*!
- Construct a QCameraExposure from service \a provider and \a parent.
-*/
-
-QCameraExposure::QCameraExposure(QCamera *parent, QPlatformCamera *cameraControl):
- QObject(parent), d_ptr(new QCameraExposurePrivate)
-{
- Q_D(QCameraExposure);
- d->camera = parent;
- d->q_ptr = this;
- d->init(cameraControl);
-}
-
-
-/*!
- Destroys the camera exposure object.
-*/
-
-QCameraExposure::~QCameraExposure()
-{
- Q_D(QCameraExposure);
- delete d;
-}
-
-/*!
- Returns true if exposure settings are supported by this camera.
-*/
-bool QCameraExposure::isAvailable() const
-{
- return d_func()->exposureControl != nullptr;
-}
-
-
-/*!
- \property QCameraExposure::flashMode
- \brief The flash mode being used.
-
- Enables a certain flash mode if the camera has a flash.
-
- \sa QCameraExposure::isFlashModeSupported(), QCameraExposure::isFlashReady()
-*/
-QCameraExposure::FlashMode QCameraExposure::flashMode() const
-{
- return d_func()->exposureControl ? d_func()->exposureControl->flashMode() : QCameraExposure::FlashOff;
-}
-
-void QCameraExposure::setFlashMode(QCameraExposure::FlashMode mode)
-{
- if (d_func()->exposureControl)
- d_func()->exposureControl->setFlashMode(mode);
-}
-
-/*!
- Returns true if the flash \a mode is supported.
-*/
-
-bool QCameraExposure::isFlashModeSupported(QCameraExposure::FlashMode mode) const
-{
- return d_func()->exposureControl ? d_func()->exposureControl->isFlashModeSupported(mode) : (mode == FlashOff);
-}
-
-/*!
- Returns true if flash is charged.
-*/
-
-bool QCameraExposure::isFlashReady() const
-{
- return d_func()->exposureControl ? d_func()->exposureControl->isFlashReady() : false;
-}
-
-/*!
- \property QCameraExposure::torchMode
- \brief The torch mode being used.
-
- A torch is a continuous light source used for low light video recording. Enabling torch mode
- will usually override any currently set flash mode.
-
- \sa QCameraExposure::isTorchModeSupported(), QCameraExposure::flashMode
-*/
-QCameraExposure::TorchMode QCameraExposure::torchMode() const
-{
- return d_func()->exposureControl ? d_func()->exposureControl->torchMode() : TorchOff;
-}
-
-void QCameraExposure::setTorchMode(QCameraExposure::TorchMode mode)
-{
- if (d_func()->exposureControl)
- d_func()->exposureControl->setTorchMode(mode);
-}
-
-/*!
- Returns true if the torch \a mode is supported.
-*/
-bool QCameraExposure::isTorchModeSupported(QCameraExposure::TorchMode mode) const
-{
- return d_func()->exposureControl ? d_func()->exposureControl->isTorchModeSupported(mode) : (mode == TorchOff);
-}
-
-/*!
- \property QCameraExposure::exposureMode
- \brief The exposure mode being used.
-
- \sa QCameraExposure::isExposureModeSupported()
-*/
-
-QCameraExposure::ExposureMode QCameraExposure::exposureMode() const
-{
- return d_func()->actualExposureParameter<QCameraExposure::ExposureMode>(QPlatformCameraExposure::ExposureMode, QCameraExposure::ExposureAuto);
-}
-
-void QCameraExposure::setExposureMode(QCameraExposure::ExposureMode mode)
-{
- d_func()->setExposureParameter<QCameraExposure::ExposureMode>(QPlatformCameraExposure::ExposureMode, mode);
-}
-
-/*!
- Returns true if the exposure \a mode is supported.
-*/
-
-bool QCameraExposure::isExposureModeSupported(QCameraExposure::ExposureMode mode) const
-{
- if (!d_func()->exposureControl)
- return false;
-
- bool continuous = false;
- return d_func()->exposureControl->supportedParameterRange(QPlatformCameraExposure::ExposureMode, &continuous)
- .contains(QVariant::fromValue<QCameraExposure::ExposureMode>(mode));
-}
-
-/*!
- \property QCameraExposure::exposureCompensation
- \brief Exposure compensation in EV units.
-
- Exposure compensation property allows to adjust the automatically calculated exposure.
-*/
-
-qreal QCameraExposure::exposureCompensation() const
-{
- return d_func()->actualExposureParameter<qreal>(QPlatformCameraExposure::ExposureCompensation, 0.0);
-}
-
-void QCameraExposure::setExposureCompensation(qreal ev)
-{
- d_func()->setExposureParameter<qreal>(QPlatformCameraExposure::ExposureCompensation, ev);
-}
-
-int QCameraExposure::isoSensitivity() const
-{
- return d_func()->actualExposureParameter<int>(QPlatformCameraExposure::ISO, -1);
-}
-
-/*!
- Returns the requested ISO sensitivity
- or -1 if automatic ISO is turned on.
-*/
-int QCameraExposure::requestedIsoSensitivity() const
-{
- return d_func()->requestedExposureParameter<int>(QPlatformCameraExposure::ISO, -1);
-}
-
-/*!
- Returns the list of ISO senitivities camera supports.
-
- If the camera supports arbitrary ISO sensitivities within the supported range,
- *\a continuous is set to true, otherwise *\a continuous is set to false.
-*/
-QList<int> QCameraExposure::supportedIsoSensitivities(bool *continuous) const
-{
- QList<int> res;
- QPlatformCameraExposure *control = d_func()->exposureControl;
-
- bool tmp = false;
- if (!continuous)
- continuous = &tmp;
-
- if (!control)
- return res;
-
- const auto range = control->supportedParameterRange(QPlatformCameraExposure::ISO, continuous);
- for (const QVariant &value : range) {
- bool ok = false;
- int intValue = value.toInt(&ok);
- if (ok)
- res.append(intValue);
- else
- qWarning() << "Incompatible ISO value type, int is expected";
- }
-
- return res;
-}
-
-/*!
- \fn QCameraExposure::setManualIsoSensitivity(int iso)
- Sets the manual sensitivity to \a iso
-*/
-
-void QCameraExposure::setManualIsoSensitivity(int iso)
-{
- d_func()->setExposureParameter<int>(QPlatformCameraExposure::ISO, iso);
-}
-
-/*!
- \fn QCameraExposure::setAutoIsoSensitivity()
- Turn on auto sensitivity
-*/
-
-void QCameraExposure::setAutoIsoSensitivity()
-{
- d_func()->resetExposureParameter(QPlatformCameraExposure::ISO);
-}
-
-/*!
- \property QCameraExposure::shutterSpeed
- \brief Camera's shutter speed in seconds.
-
- \sa supportedShutterSpeeds(), setAutoShutterSpeed(), setManualShutterSpeed()
-*/
-
-/*!
- \fn QCameraExposure::shutterSpeedChanged(qreal speed)
-
- Signals that a camera's shutter \a speed has changed.
-*/
-
-/*!
- \property QCameraExposure::isoSensitivity
- \brief The sensor ISO sensitivity.
-
- \sa supportedIsoSensitivities(), setAutoIsoSensitivity(), setManualIsoSensitivity()
-*/
-
-/*!
- \property QCameraExposure::aperture
- \brief Lens aperture is specified as an F number, the ratio of the focal length to effective aperture diameter.
-
- \sa supportedApertures(), setAutoAperture(), setManualAperture(), requestedAperture()
-*/
-
-
-qreal QCameraExposure::aperture() const
-{
- return d_func()->actualExposureParameter<qreal>(QPlatformCameraExposure::Aperture, -1.0);
-}
-
-/*!
- Returns the requested manual aperture
- or -1.0 if automatic aperture is turned on.
-*/
-qreal QCameraExposure::requestedAperture() const
-{
- return d_func()->requestedExposureParameter<qreal>(QPlatformCameraExposure::Aperture, -1.0);
-}
-
-
-/*!
- Returns the list of aperture values camera supports.
- The apertures list can change depending on the focal length,
- in such a case the apertureRangeChanged() signal is emitted.
-
- If the camera supports arbitrary aperture values within the supported range,
- *\a continuous is set to true, otherwise *\a continuous is set to false.
-*/
-QList<qreal> QCameraExposure::supportedApertures(bool * continuous) const
-{
- QList<qreal> res;
- QPlatformCameraExposure *control = d_func()->exposureControl;
-
- bool tmp = false;
- if (!continuous)
- continuous = &tmp;
-
- if (!control)
- return res;
-
- const auto range = control->supportedParameterRange(QPlatformCameraExposure::Aperture, continuous);
- for (const QVariant &value : range) {
- bool ok = false;
- qreal realValue = value.toReal(&ok);
- if (ok)
- res.append(realValue);
- else
- qWarning() << "Incompatible aperture value type, qreal is expected";
- }
-
- return res;
-}
-
-/*!
- \fn QCameraExposure::setManualAperture(qreal aperture)
- Sets the manual camera \a aperture value.
-*/
-
-void QCameraExposure::setManualAperture(qreal aperture)
-{
- d_func()->setExposureParameter<qreal>(QPlatformCameraExposure::Aperture, aperture);
-}
-
-/*!
- \fn QCameraExposure::setAutoAperture()
- Turn on auto aperture
-*/
-
-void QCameraExposure::setAutoAperture()
-{
- d_func()->resetExposureParameter(QPlatformCameraExposure::Aperture);
-}
-
-/*!
- Returns the current shutter speed in seconds.
-*/
-
-qreal QCameraExposure::shutterSpeed() const
-{
- return d_func()->actualExposureParameter<qreal>(QPlatformCameraExposure::ShutterSpeed, -1.0);
-}
-
-/*!
- Returns the requested manual shutter speed in seconds
- or -1.0 if automatic shutter speed is turned on.
-*/
-qreal QCameraExposure::requestedShutterSpeed() const
-{
- return d_func()->requestedExposureParameter<qreal>(QPlatformCameraExposure::ShutterSpeed, -1.0);
-}
-
-/*!
- Returns the list of shutter speed values in seconds camera supports.
-
- If the camera supports arbitrary shutter speed values within the supported range,
- *\a continuous is set to true, otherwise *\a continuous is set to false.
-*/
-QList<qreal> QCameraExposure::supportedShutterSpeeds(bool *continuous) const
-{
- QList<qreal> res;
- QPlatformCameraExposure *control = d_func()->exposureControl;
-
- bool tmp = false;
- if (!continuous)
- continuous = &tmp;
-
- if (!control)
- return res;
-
- const auto range = control->supportedParameterRange(QPlatformCameraExposure::ShutterSpeed, continuous);
- for (const QVariant &value : range) {
- bool ok = false;
- qreal realValue = value.toReal(&ok);
- if (ok)
- res.append(realValue);
- else
- qWarning() << "Incompatible shutter speed value type, qreal is expected";
- }
-
- return res;
-}
-
-/*!
- Set the manual shutter speed to \a seconds
-*/
-
-void QCameraExposure::setManualShutterSpeed(qreal seconds)
-{
- d_func()->setExposureParameter<qreal>(QPlatformCameraExposure::ShutterSpeed, seconds);
-}
-
-/*!
- Turn on auto shutter speed
-*/
-
-void QCameraExposure::setAutoShutterSpeed()
-{
- d_func()->resetExposureParameter(QPlatformCameraExposure::ShutterSpeed);
-}
-
-
-/*!
- \enum QCameraExposure::FlashMode
-
- \value FlashOff Flash is Off.
- \value FlashOn Flash is On.
- \value FlashAuto Automatic flash.
-*/
-
-/*!
- \enum QCameraExposure::TorchMode
-
- \value TorchOff Torch is Off.
- \value TorchOn Torch is On.
- \value TorchAuto Automatic torch.
-*/
-
-/*!
- \enum QCameraExposure::ExposureMode
-
- \value ExposureAuto Automatic mode.
- \value ExposureManual Manual mode.
- \value ExposurePortrait Portrait exposure mode.
- \value ExposureNight Night mode.
- \value ExposureSports Spots exposure mode.
- \value ExposureSnow Snow exposure mode.
- \value ExposureBeach Beach exposure mode.
- \value ExposureAction Action mode. Since 5.5
- \value ExposureLandscape Landscape mode. Since 5.5
- \value ExposureNightPortrait Night portrait mode. Since 5.5
- \value ExposureTheatre Theatre mode. Since 5.5
- \value ExposureSunset Sunset mode. Since 5.5
- \value ExposureSteadyPhoto Steady photo mode. Since 5.5
- \value ExposureFireworks Fireworks mode. Since 5.5
- \value ExposureParty Party mode. Since 5.5
- \value ExposureCandlelight Candlelight mode. Since 5.5
- \value ExposureBarcode Barcode mode. Since 5.5
-*/
-
-/*!
- \property QCameraExposure::flashReady
- \brief Indicates if the flash is charged and ready to use.
-*/
-
-/*!
- \fn void QCameraExposure::flashReady(bool ready)
-
- Signal the flash \a ready status has changed.
-*/
-
-/*!
- \fn void QCameraExposure::apertureChanged(qreal value)
-
- Signal emitted when aperature changes to \a value.
-*/
-
-/*!
- \fn void QCameraExposure::apertureRangeChanged()
-
- Signal emitted when aperature range has changed.
-*/
-
-
-/*!
- \fn void QCameraExposure::shutterSpeedRangeChanged()
-
- Signal emitted when the shutter speed range has changed.
-*/
-
-
-/*!
- \fn void QCameraExposure::isoSensitivityChanged(int value)
-
- Signal emitted when sensitivity changes to \a value.
-*/
-
-/*!
- \fn void QCameraExposure::exposureCompensationChanged(qreal value)
-
- Signal emitted when the exposure compensation changes to \a value.
-*/
-
-QT_END_NAMESPACE
-
-#include "moc_qcameraexposure.cpp"
diff --git a/src/multimedia/camera/qcameraexposure.h b/src/multimedia/camera/qcameraexposure.h
deleted file mode 100644
index a540da4df..000000000
--- a/src/multimedia/camera/qcameraexposure.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QCAMERAEXPOSURE_H
-#define QCAMERAEXPOSURE_H
-
-#include <QtCore/qobject.h>
-#include <QtMultimedia/qtmultimediaglobal.h>
-#include <QtMultimedia/qmediaenumdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-
-class QCamera;
-class QPlatformCamera;
-class QCameraExposurePrivate;
-
-class Q_MULTIMEDIA_EXPORT QCameraExposure : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(qreal aperture READ aperture NOTIFY apertureChanged)
- Q_PROPERTY(qreal shutterSpeed READ shutterSpeed NOTIFY shutterSpeedChanged)
- Q_PROPERTY(int isoSensitivity READ isoSensitivity NOTIFY isoSensitivityChanged)
- Q_PROPERTY(qreal exposureCompensation READ exposureCompensation WRITE setExposureCompensation NOTIFY exposureCompensationChanged)
- Q_PROPERTY(bool flashReady READ isFlashReady NOTIFY flashReady)
- Q_PROPERTY(QCameraExposure::FlashMode flashMode READ flashMode WRITE setFlashMode)
- Q_PROPERTY(QCameraExposure::TorchMode torchMode READ torchMode WRITE setTorchMode)
- Q_PROPERTY(QCameraExposure::ExposureMode exposureMode READ exposureMode WRITE setExposureMode)
-
- Q_ENUMS(FlashMode)
- Q_ENUMS(TorchMode)
- Q_ENUMS(ExposureMode)
-public:
- enum FlashMode {
- FlashOff,
- FlashOn,
- FlashAuto
- };
-
- enum TorchMode {
- TorchOff,
- TorchOn,
- TorchAuto
- };
-
- enum ExposureMode {
- ExposureAuto,
- ExposureManual,
- ExposurePortrait,
- ExposureNight,
- ExposureSports,
- ExposureSnow,
- ExposureBeach,
- ExposureAction,
- ExposureLandscape,
- ExposureNightPortrait,
- ExposureTheatre,
- ExposureSunset,
- ExposureSteadyPhoto,
- ExposureFireworks,
- ExposureParty,
- ExposureCandlelight,
- ExposureBarcode
- };
-
- bool isAvailable() const;
-
- FlashMode flashMode() const;
- bool isFlashModeSupported(FlashMode mode) const;
- bool isFlashReady() const;
-
- TorchMode torchMode() const;
- bool isTorchModeSupported(TorchMode mode) const;
-
- ExposureMode exposureMode() const;
- bool isExposureModeSupported(ExposureMode mode) const;
-
- qreal exposureCompensation() const;
-
- int isoSensitivity() const;
- qreal aperture() const;
- qreal shutterSpeed() const;
-
- int requestedIsoSensitivity() const;
- qreal requestedAperture() const;
- qreal requestedShutterSpeed() const;
-
- QList<int> supportedIsoSensitivities(bool *continuous = nullptr) const;
- QList<qreal> supportedApertures(bool *continuous = nullptr) const;
- QList<qreal> supportedShutterSpeeds(bool *continuous = nullptr) const;
-
-public Q_SLOTS:
- void setFlashMode(FlashMode mode);
- void setTorchMode(TorchMode mode);
- void setExposureMode(ExposureMode mode);
-
- void setExposureCompensation(qreal ev);
-
- void setManualIsoSensitivity(int iso);
- void setAutoIsoSensitivity();
-
- void setManualAperture(qreal aperture);
- void setAutoAperture();
-
- void setManualShutterSpeed(qreal seconds);
- void setAutoShutterSpeed();
-
-Q_SIGNALS:
- void flashReady(bool);
-
- void apertureChanged(qreal);
- void apertureRangeChanged();
- void shutterSpeedChanged(qreal speed);
- void shutterSpeedRangeChanged();
- void isoSensitivityChanged(int);
- void exposureCompensationChanged(qreal);
-
-protected:
- virtual ~QCameraExposure();
-
-private:
- friend class QCamera;
- friend class QCameraPrivate;
- explicit QCameraExposure(QCamera *parent, QPlatformCamera *cameraControl);
-
- Q_DISABLE_COPY(QCameraExposure)
- Q_DECLARE_PRIVATE(QCameraExposure)
- Q_PRIVATE_SLOT(d_func(), void _q_exposureParameterChanged(int))
- Q_PRIVATE_SLOT(d_func(), void _q_exposureParameterRangeChanged(int))
- QCameraExposurePrivate *d_ptr;
-};
-
-QT_END_NAMESPACE
-
-Q_MEDIA_ENUM_DEBUG(QCameraExposure, ExposureMode)
-Q_MEDIA_ENUM_DEBUG(QCameraExposure, FlashMode)
-
-#endif // QCAMERAEXPOSURE_H
diff --git a/src/multimedia/doc/src/cameraoverview.qdoc b/src/multimedia/doc/src/cameraoverview.qdoc
index 53015339a..4128c14eb 100644
--- a/src/multimedia/doc/src/cameraoverview.qdoc
+++ b/src/multimedia/doc/src/cameraoverview.qdoc
@@ -247,26 +247,14 @@ be checked with \l minimumZoomFactor() and maximumZoomFactor().
\section3 Exposure, Aperture, Shutter Speed and Flash
There are a number of settings that affect the amount of light that hits the
-camera sensor, and hence the quality of the resulting image. The \l QCameraExposure
-class allows you to adjust these settings. You can use this class to implement
-some techniques like High Dynamic Range (HDR) photos by locking the exposure
-parameters (with \l {QCamera::searchAndLock()}), or motion blur by setting slow shutter speeds
-with small apertures.
-
-The main settings for automatic image taking are the \l {QCameraExposure::ExposureMode}{exposure mode}
-and \l {QCameraExposure::FlashMode}{flash mode}. Several other settings (aperture, ISO setting,
- shutter speed) are usually managed automatically but can also be overridden if desired.
+camera sensor, and hence the quality of the resulting image.
-You can also adjust the \l {QCameraExposure::meteringMode()} to control which parts
-of the camera frame to measure exposure at. Some camera implementations also allow
-you to specify a specific point that should be used for exposure metering - this is
-useful if you can let the user touch or click on an interesting part of the viewfinder,
-and then use this point so that the image exposure is best at that point.
+The main settings for automatic image taking are the \l {QCamera::ExposureMode}{exposure mode}
+and \l {QCamera::FlashMode}{flash mode}. Several other settings (aperture, ISO setting,
+ shutter speed) are usually managed automatically but can also be overridden if desired.
Finally, you can control the flash hardware (if present) using this class. In some cases
-the hardware may also double as a torch (typically when the flash is LED based, rather than
-a xenon or other bulb). See also \l {Torch} for an easy to use API for
-torch functionality.
+the hardware may also double as a torch.
\target camera_image_processing
\section3 Image Processing
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp b/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp
index d8ad36d8d..ffb99b250 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp
+++ b/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp
@@ -52,8 +52,8 @@ QAndroidCameraExposureControl::QAndroidCameraExposureControl(QAndroidCameraSessi
, m_exposureCompensationStep(0.0)
, m_requestedExposureCompensation(0.0)
, m_actualExposureCompensation(0.0)
- , m_requestedExposureMode(QCameraExposure::ExposureAuto)
- , m_actualExposureMode(QCameraExposure::ExposureAuto)
+ , m_requestedExposureMode(QCamera::ExposureAuto)
+ , m_actualExposureMode(QCamera::ExposureAuto)
{
connect(m_session, SIGNAL(opened()),
this, SLOT(onCameraOpened()));
@@ -147,7 +147,7 @@ bool QAndroidCameraExposureControl::setValue(ExposureParameter parameter, const
}
} else if (parameter == QPlatformCameraExposure::ExposureMode) {
- QCameraExposure::ExposureMode expMode = value.value<QCameraExposure::ExposureMode>();
+ QCamera::ExposureMode expMode = value.value<QCamera::ExposureMode>();
if (m_requestedExposureMode != expMode) {
m_requestedExposureMode = expMode;
emit requestedValueChanged(QPlatformCameraExposure::ExposureMode);
@@ -161,57 +161,57 @@ bool QAndroidCameraExposureControl::setValue(ExposureParameter parameter, const
QString sceneMode;
switch (m_requestedExposureMode) {
- case QCameraExposure::ExposureAuto:
+ case QCamera::ExposureAuto:
sceneMode = QLatin1String("auto");
break;
- case QCameraExposure::ExposureSports:
+ case QCamera::ExposureSports:
sceneMode = QLatin1String("sports");
break;
- case QCameraExposure::ExposurePortrait:
+ case QCamera::ExposurePortrait:
sceneMode = QLatin1String("portrait");
break;
- case QCameraExposure::ExposureBeach:
+ case QCamera::ExposureBeach:
sceneMode = QLatin1String("beach");
break;
- case QCameraExposure::ExposureSnow:
+ case QCamera::ExposureSnow:
sceneMode = QLatin1String("snow");
break;
- case QCameraExposure::ExposureNight:
+ case QCamera::ExposureNight:
sceneMode = QLatin1String("night");
break;
- case QCameraExposure::ExposureAction:
+ case QCamera::ExposureAction:
sceneMode = QLatin1String("action");
break;
- case QCameraExposure::ExposureLandscape:
+ case QCamera::ExposureLandscape:
sceneMode = QLatin1String("landscape");
break;
- case QCameraExposure::ExposureNightPortrait:
+ case QCamera::ExposureNightPortrait:
sceneMode = QLatin1String("night-portrait");
break;
- case QCameraExposure::ExposureTheatre:
+ case QCamera::ExposureTheatre:
sceneMode = QLatin1String("theatre");
break;
- case QCameraExposure::ExposureSunset:
+ case QCamera::ExposureSunset:
sceneMode = QLatin1String("sunset");
break;
- case QCameraExposure::ExposureSteadyPhoto:
+ case QCamera::ExposureSteadyPhoto:
sceneMode = QLatin1String("steadyphoto");
break;
- case QCameraExposure::ExposureFireworks:
+ case QCamera::ExposureFireworks:
sceneMode = QLatin1String("fireworks");
break;
- case QCameraExposure::ExposureParty:
+ case QCamera::ExposureParty:
sceneMode = QLatin1String("party");
break;
- case QCameraExposure::ExposureCandlelight:
+ case QCamera::ExposureCandlelight:
sceneMode = QLatin1String("candlelight");
break;
- case QCameraExposure::ExposureBarcode:
+ case QCamera::ExposureBarcode:
sceneMode = QLatin1String("barcode");
break;
default:
sceneMode = QLatin1String("auto");
- m_actualExposureMode = QCameraExposure::ExposureAuto;
+ m_actualExposureMode = QCamera::ExposureAuto;
break;
}
@@ -243,37 +243,37 @@ void QAndroidCameraExposureControl::onCameraOpened()
for (int i = 0; i < sceneModes.size(); ++i) {
const QString &sceneMode = sceneModes.at(i);
if (sceneMode == QLatin1String("auto"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureAuto);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureAuto);
else if (sceneMode == QLatin1String("beach"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureBeach);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureBeach);
else if (sceneMode == QLatin1String("night"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureNight);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureNight);
else if (sceneMode == QLatin1String("portrait"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposurePortrait);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposurePortrait);
else if (sceneMode == QLatin1String("snow"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSnow);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureSnow);
else if (sceneMode == QLatin1String("sports"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSports);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureSports);
else if (sceneMode == QLatin1String("action"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureAction);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureAction);
else if (sceneMode == QLatin1String("landscape"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureLandscape);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureLandscape);
else if (sceneMode == QLatin1String("night-portrait"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureNightPortrait);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureNightPortrait);
else if (sceneMode == QLatin1String("theatre"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureTheatre);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureTheatre);
else if (sceneMode == QLatin1String("sunset"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSunset);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureSunset);
else if (sceneMode == QLatin1String("steadyphoto"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSteadyPhoto);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureSteadyPhoto);
else if (sceneMode == QLatin1String("fireworks"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureFireworks);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureFireworks);
else if (sceneMode == QLatin1String("party"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureParty);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureParty);
else if (sceneMode == QLatin1String("candlelight"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureCandlelight);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureCandlelight);
else if (sceneMode == QLatin1String("barcode"))
- m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureBarcode);
+ m_supportedExposureModes << QVariant::fromValue(QCamera::ExposureBarcode);
}
emit parameterRangeChanged(QPlatformCameraExposure::ExposureMode);
}
@@ -288,31 +288,31 @@ void QAndroidCameraExposureControl::onCameraOpened()
for (int i = 0; i < flashModes.size(); ++i) {
const QString &flashMode = flashModes.at(i);
if (flashMode == QLatin1String("off"))
- m_supportedFlashModes << QCameraExposure::FlashOff;
+ m_supportedFlashModes << QCamera::FlashOff;
else if (flashMode == QLatin1String("auto"))
- m_supportedFlashModes << QCameraExposure::FlashAuto;
+ m_supportedFlashModes << QCamera::FlashAuto;
else if (flashMode == QLatin1String("on"))
- m_supportedFlashModes << QCameraExposure::FlashOn;
+ m_supportedFlashModes << QCamera::FlashOn;
else if (flashMode == QLatin1String("torch"))
torchModeSupported = true;
}
if (!m_supportedFlashModes.contains(m_flashMode))
- m_flashMode = QCameraExposure::FlashOff;
+ m_flashMode = QCamera::FlashOff;
setFlashMode(m_flashMode);
}
-QCameraExposure::FlashMode QAndroidCameraExposureControl::flashMode() const
+QCamera::FlashMode QAndroidCameraExposureControl::flashMode() const
{
return m_flashMode;
}
-void QAndroidCameraExposureControl::setFlashMode(QCameraExposure::FlashMode mode)
+void QAndroidCameraExposureControl::setFlashMode(QCamera::FlashMode mode)
{
if (!m_session->camera()) {
- m_flashMode = QCameraExposure::FlashOff;
+ m_flashMode = QCamera::FlashOff;
return;
}
@@ -323,9 +323,9 @@ void QAndroidCameraExposureControl::setFlashMode(QCameraExposure::FlashMode mode
m_flashMode = mode;
QString flashMode;
- if (mode == QCameraExposure::FlashAuto)
+ if (mode == QCamera::FlashAuto)
flashMode = QLatin1String("auto");
- else if (mode == QCameraExposure::FlashOn)
+ else if (mode == QCamera::FlashOn)
flashMode = QLatin1String("on");
else // FlashOff
flashMode = QLatin1String("off");
@@ -333,7 +333,7 @@ void QAndroidCameraExposureControl::setFlashMode(QCameraExposure::FlashMode mode
m_session->camera()->setFlashMode(flashMode);
}
-bool QAndroidCameraExposureControl::isFlashModeSupported(QCameraExposure::FlashMode mode) const
+bool QAndroidCameraExposureControl::isFlashModeSupported(QCamera::FlashMode mode) const
{
return m_session->camera() ? m_supportedFlashModes.contains(mode) : false;
}
@@ -344,21 +344,21 @@ bool QAndroidCameraExposureControl::isFlashReady() const
return true;
}
-QCameraExposure::TorchMode QAndroidCameraExposureControl::torchMode() const
+QCamera::TorchMode QAndroidCameraExposureControl::torchMode() const
{
- return torchEnabled ? QCameraExposure::TorchOn : QCameraExposure::TorchOff;
+ return torchEnabled ? QCamera::TorchOn : QCamera::TorchOff;
}
-void QAndroidCameraExposureControl::setTorchMode(QCameraExposure::TorchMode mode)
+void QAndroidCameraExposureControl::setTorchMode(QCamera::TorchMode mode)
{
auto *camera = m_session->camera();
if (!camera || !torchModeSupported)
return;
- if (mode == QCameraExposure::TorchOn) {
+ if (mode == QCamera::TorchOn) {
camera->setFlashMode(QLatin1String("torch"));
torchEnabled = true;
- } else if (mode == QCameraExposure::TorchOff) {
+ } else if (mode == QCamera::TorchOff) {
// if torch was enabled, it first needs to be turned off before restoring the flash mode
camera->setFlashMode(QLatin1String("off"));
setFlashMode(m_flashMode);
@@ -366,11 +366,11 @@ void QAndroidCameraExposureControl::setTorchMode(QCameraExposure::TorchMode mode
}
}
-bool QAndroidCameraExposureControl::isTorchModeSupported(QCameraExposure::TorchMode mode) const
+bool QAndroidCameraExposureControl::isTorchModeSupported(QCamera::TorchMode mode) const
{
- if (mode == QCameraExposure::TorchAuto)
+ if (mode == QCamera::TorchAuto)
return false;
- else if (mode == QCameraExposure::TorchOn)
+ else if (mode == QCamera::TorchOn)
return torchModeSupported;
else
return true;
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol_p.h b/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol_p.h
index 5c818d14a..510a9a764 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol_p.h
+++ b/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol_p.h
@@ -70,14 +70,14 @@ public:
QVariant actualValue(ExposureParameter parameter) const override;
bool setValue(ExposureParameter parameter, const QVariant& value) override;
- QCameraExposure::FlashMode flashMode() const override;
- void setFlashMode(QCameraExposure::FlashMode mode) override;
- bool isFlashModeSupported(QCameraExposure::FlashMode mode) const override;
+ QCamera::FlashMode flashMode() const override;
+ void setFlashMode(QCamera::FlashMode mode) override;
+ bool isFlashModeSupported(QCamera::FlashMode mode) const override;
bool isFlashReady() const override;
- QCameraExposure::TorchMode torchMode() const override;
- void setTorchMode(QCameraExposure::TorchMode mode) override;
- bool isTorchModeSupported(QCameraExposure::TorchMode mode) const override;
+ QCamera::TorchMode torchMode() const override;
+ void setTorchMode(QCamera::TorchMode mode) override;
+ bool isTorchModeSupported(QCamera::TorchMode mode) const override;
private Q_SLOTS:
void onCameraOpened();
@@ -94,11 +94,11 @@ private:
qreal m_requestedExposureCompensation;
qreal m_actualExposureCompensation;
- QCameraExposure::ExposureMode m_requestedExposureMode;
- QCameraExposure::ExposureMode m_actualExposureMode;
+ QCamera::ExposureMode m_requestedExposureMode;
+ QCamera::ExposureMode m_actualExposureMode;
- QList<QCameraExposure::FlashMode> m_supportedFlashModes;
- QCameraExposure::FlashMode m_flashMode;
+ QList<QCamera::FlashMode> m_supportedFlashModes;
+ QCamera::FlashMode m_flashMode;
bool torchModeSupported = false;
bool torchEnabled = false;
diff --git a/src/multimedia/platform/darwin/camera/avfcameraexposure.mm b/src/multimedia/platform/darwin/camera/avfcameraexposure.mm
index dd5e47f9a..53499aa1f 100644
--- a/src/multimedia/platform/darwin/camera/avfcameraexposure.mm
+++ b/src/multimedia/platform/darwin/camera/avfcameraexposure.mm
@@ -132,20 +132,20 @@ bool qt_exposure_bias_equal(AVCaptureDevice *captureDevice, qreal bias)
// Converters:
-bool qt_convert_exposure_mode(AVCaptureDevice *captureDevice, QCameraExposure::ExposureMode mode,
+bool qt_convert_exposure_mode(AVCaptureDevice *captureDevice, QCamera::ExposureMode mode,
AVCaptureExposureMode &avMode)
{
// Test if mode supported and convert.
Q_ASSERT(captureDevice);
- if (mode == QCameraExposure::ExposureAuto) {
+ if (mode == QCamera::ExposureAuto) {
if ([captureDevice isExposureModeSupported:AVCaptureExposureModeContinuousAutoExposure]) {
avMode = AVCaptureExposureModeContinuousAutoExposure;
return true;
}
}
- if (mode == QCameraExposure::ExposureManual) {
+ if (mode == QCamera::ExposureManual) {
if ([captureDevice isExposureModeSupported:AVCaptureExposureModeCustom]) {
avMode = AVCaptureExposureModeCustom;
return true;
@@ -293,10 +293,10 @@ QVariantList AVFCameraExposure::supportedParameterRange(ExposureParameter parame
*continuous = true;
} else if (parameter == QPlatformCameraExposure::ExposureMode) {
if ([captureDevice isExposureModeSupported:AVCaptureExposureModeCustom])
- parameterRange << QVariant::fromValue(QCameraExposure::ExposureManual);
+ parameterRange << QVariant::fromValue(QCamera::ExposureManual);
if ([captureDevice isExposureModeSupported:AVCaptureExposureModeContinuousAutoExposure])
- parameterRange << QVariant::fromValue(QCameraExposure::ExposureAuto);
+ parameterRange << QVariant::fromValue(QCamera::ExposureAuto);
}
#else
Q_UNUSED(parameter);
@@ -340,8 +340,8 @@ QVariant AVFCameraExposure::actualValue(ExposureParameter parameter) const
if (parameter == QPlatformCameraExposure::ExposureMode) {
// This code expects exposureMode to be continuous by default ...
if (captureDevice.exposureMode == AVCaptureExposureModeContinuousAutoExposure)
- return QVariant::fromValue(QCameraExposure::ExposureAuto);
- return QVariant::fromValue(QCameraExposure::ExposureManual);
+ return QVariant::fromValue(QCamera::ExposureAuto);
+ return QVariant::fromValue(QCamera::ExposureManual);
}
if (parameter == QPlatformCameraExposure::ExposureCompensation)
@@ -383,14 +383,14 @@ bool AVFCameraExposure::setValue(ExposureParameter parameter, const QVariant &va
bool AVFCameraExposure::setExposureMode(const QVariant &value)
{
#ifdef Q_OS_IOS
- if (!value.canConvert<QCameraExposure::ExposureMode>()) {
+ if (!value.canConvert<QCamera::ExposureMode>()) {
qDebugCamera() << Q_FUNC_INFO << "invalid exposure mode value,"
- << "QCameraExposure::ExposureMode expected";
+ << "QCamera::ExposureMode expected";
return false;
}
- const QCameraExposure::ExposureMode qtMode = value.value<QCameraExposure::ExposureMode>();
- if (qtMode != QCameraExposure::ExposureAuto && qtMode != QCameraExposure::ExposureManual) {
+ const QCamera::ExposureMode qtMode = value.value<QCamera::ExposureMode>();
+ if (qtMode != QCamera::ExposureAuto && qtMode != QCamera::ExposureManual) {
qDebugCamera() << Q_FUNC_INFO << "exposure mode not supported";
return false;
}
@@ -472,7 +472,7 @@ bool AVFCameraExposure::setShutterSpeed(const QVariant &value)
{
#ifdef Q_OS_IOS
if (value.isNull())
- return setExposureMode(QVariant::fromValue(QCameraExposure::ExposureAuto));
+ return setExposureMode(QVariant::fromValue(QCamera::ExposureAuto));
if (!value.canConvert<qreal>()) {
qDebugCamera() << Q_FUNC_INFO << "invalid shutter speed"
@@ -519,7 +519,7 @@ bool AVFCameraExposure::setISO(const QVariant &value)
{
#ifdef Q_OS_IOS
if (value.isNull())
- return setExposureMode(QVariant::fromValue(QCameraExposure::ExposureAuto));
+ return setExposureMode(QVariant::fromValue(QCamera::ExposureAuto));
if (!value.canConvert<int>()) {
qDebugCamera() << Q_FUNC_INFO << "invalid ISO value, int expected";
@@ -632,7 +632,7 @@ void AVFCameraExposure::cameraActiveChanged(bool active)
}
if (!m_requestedMode.isNull()) {
- QCameraExposure::ExposureMode qtMode = m_requestedMode.value<QCameraExposure::ExposureMode>();
+ QCamera::ExposureMode qtMode = m_requestedMode.value<QCamera::ExposureMode>();
AVCaptureExposureMode avMode = AVCaptureExposureModeContinuousAutoExposure;
if (!qt_convert_exposure_mode(captureDevice, qtMode, avMode)) {
qDebugCamera() << Q_FUNC_INFO << "requested exposure mode is not supported";
@@ -685,12 +685,12 @@ void AVFCameraExposure::cameraActiveChanged(bool active)
-QCameraExposure::FlashMode AVFCameraExposure::flashMode() const
+QCamera::FlashMode AVFCameraExposure::flashMode() const
{
return m_flashMode;
}
-void AVFCameraExposure::setFlashMode(QCameraExposure::FlashMode mode)
+void AVFCameraExposure::setFlashMode(QCamera::FlashMode mode)
{
if (m_flashMode == mode)
return;
@@ -708,13 +708,13 @@ void AVFCameraExposure::setFlashMode(QCameraExposure::FlashMode mode)
applyFlashSettings();
}
-bool AVFCameraExposure::isFlashModeSupported(QCameraExposure::FlashMode mode) const
+bool AVFCameraExposure::isFlashModeSupported(QCamera::FlashMode mode) const
{
- if (mode == QCameraExposure::FlashOff)
+ if (mode == QCamera::FlashOff)
return true;
- else if (mode == QCameraExposure::FlashOn)
+ else if (mode == QCamera::FlashOn)
return isFlashSupported;
- else //if (mode == QCameraExposure::FlashAuto)
+ else //if (mode == QCamera::FlashAuto)
return isFlashAutoSupported;
}
@@ -743,12 +743,12 @@ bool AVFCameraExposure::isFlashReady() const
return true;
}
-QCameraExposure::TorchMode AVFCameraExposure::torchMode() const
+QCamera::TorchMode AVFCameraExposure::torchMode() const
{
return m_torchMode;
}
-void AVFCameraExposure::setTorchMode(QCameraExposure::TorchMode mode)
+void AVFCameraExposure::setTorchMode(QCamera::TorchMode mode)
{
if (m_torchMode == mode)
return;
@@ -766,13 +766,13 @@ void AVFCameraExposure::setTorchMode(QCameraExposure::TorchMode mode)
applyFlashSettings();
}
-bool AVFCameraExposure::isTorchModeSupported(QCameraExposure::TorchMode mode) const
+bool AVFCameraExposure::isTorchModeSupported(QCamera::TorchMode mode) const
{
- if (mode == QCameraExposure::TorchOff)
+ if (mode == QCamera::TorchOff)
return true;
- else if (mode == QCameraExposure::TorchOn)
+ else if (mode == QCamera::TorchOn)
return isTorchSupported;
- else //if (mode == QCameraExposure::TorchAuto)
+ else //if (mode == QCamera::TorchAuto)
return isTorchAutoSupported;
}
@@ -794,7 +794,7 @@ void AVFCameraExposure::applyFlashSettings()
const AVFConfigurationLock lock(captureDevice);
if (captureDevice.hasFlash) {
- if (m_flashMode == QCameraExposure::FlashOff) {
+ if (m_flashMode == QCamera::FlashOff) {
captureDevice.flashMode = AVCaptureFlashModeOff;
} else {
#ifdef Q_OS_IOS
@@ -803,15 +803,15 @@ void AVFCameraExposure::applyFlashSettings()
return;
}
#endif
- if (m_flashMode == QCameraExposure::FlashOn)
+ if (m_flashMode == QCamera::FlashOn)
captureDevice.flashMode = AVCaptureFlashModeOn;
- else if (m_flashMode == QCameraExposure::FlashAuto)
+ else if (m_flashMode == QCamera::FlashAuto)
captureDevice.flashMode = AVCaptureFlashModeAuto;
}
}
if (captureDevice.hasTorch) {
- if (m_torchMode == QCameraExposure::TorchOff) {
+ if (m_torchMode == QCamera::TorchOff) {
captureDevice.torchMode = AVCaptureTorchModeOff;
} else {
#ifdef Q_OS_IOS
@@ -820,9 +820,9 @@ void AVFCameraExposure::applyFlashSettings()
return;
}
#endif
- if (m_torchMode == QCameraExposure::TorchOn)
+ if (m_torchMode == QCamera::TorchOn)
captureDevice.torchMode = AVCaptureTorchModeOn;
- else if (m_torchMode == QCameraExposure::TorchAuto)
+ else if (m_torchMode == QCamera::TorchAuto)
captureDevice.torchMode = AVCaptureTorchModeAuto;
}
}
diff --git a/src/multimedia/platform/darwin/camera/avfcameraexposure_p.h b/src/multimedia/platform/darwin/camera/avfcameraexposure_p.h
index 22477f857..e432d377f 100644
--- a/src/multimedia/platform/darwin/camera/avfcameraexposure_p.h
+++ b/src/multimedia/platform/darwin/camera/avfcameraexposure_p.h
@@ -52,7 +52,7 @@
//
#include <private/qplatformcameraexposure_p.h>
-#include <QtMultimedia/qcameraexposure.h>
+#include <QtMultimedia/qcamera.h>
#include <QtCore/qglobal.h>
@@ -75,14 +75,14 @@ public:
QVariant actualValue(ExposureParameter parameter) const override;
bool setValue(ExposureParameter parameter, const QVariant &value) override;
- QCameraExposure::FlashMode flashMode() const override;
- void setFlashMode(QCameraExposure::FlashMode mode) override;
- bool isFlashModeSupported(QCameraExposure::FlashMode mode) const override;
+ QCamera::FlashMode flashMode() const override;
+ void setFlashMode(QCamera::FlashMode mode) override;
+ bool isFlashModeSupported(QCamera::FlashMode mode) const override;
bool isFlashReady() const override;
- QCameraExposure::TorchMode torchMode() const override;
- void setTorchMode(QCameraExposure::TorchMode mode) override;
- bool isTorchModeSupported(QCameraExposure::TorchMode mode) const override;
+ QCamera::TorchMode torchMode() const override;
+ void setTorchMode(QCamera::TorchMode mode) override;
+ bool isTorchModeSupported(QCamera::TorchMode mode) const override;
private Q_SLOTS:
void cameraActiveChanged(bool active);
@@ -108,8 +108,8 @@ private:
bool isFlashAutoSupported = false;
bool isTorchSupported = false;
bool isTorchAutoSupported = false;
- QCameraExposure::FlashMode m_flashMode = QCameraExposure::FlashOff;
- QCameraExposure::TorchMode m_torchMode = QCameraExposure::TorchOff;
+ QCamera::FlashMode m_flashMode = QCamera::FlashOff;
+ QCamera::TorchMode m_torchMode = QCamera::TorchOff;
};
QT_END_NAMESPACE
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp
index 70c25f518..a65c58f7f 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp
@@ -149,42 +149,42 @@ QVariant QGstreamerCameraExposure::actualValue(ExposureParameter parameter) cons
switch (sceneMode) {
case GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT:
- return QVariant::fromValue(QCameraExposure::ExposurePortrait);
+ return QVariant::fromValue(QCamera::ExposurePortrait);
case GST_PHOTOGRAPHY_SCENE_MODE_SPORT:
- return QVariant::fromValue(QCameraExposure::ExposureSports);
+ return QVariant::fromValue(QCamera::ExposureSports);
case GST_PHOTOGRAPHY_SCENE_MODE_NIGHT:
- return QVariant::fromValue(QCameraExposure::ExposureNight);
+ return QVariant::fromValue(QCamera::ExposureNight);
case GST_PHOTOGRAPHY_SCENE_MODE_MANUAL:
- return QVariant::fromValue(QCameraExposure::ExposureManual);
+ return QVariant::fromValue(QCamera::ExposureManual);
case GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE:
- return QVariant::fromValue(QCameraExposure::ExposureLandscape);
+ return QVariant::fromValue(QCamera::ExposureLandscape);
case GST_PHOTOGRAPHY_SCENE_MODE_SNOW:
- return QVariant::fromValue(QCameraExposure::ExposureSnow);
+ return QVariant::fromValue(QCamera::ExposureSnow);
case GST_PHOTOGRAPHY_SCENE_MODE_BEACH:
- return QVariant::fromValue(QCameraExposure::ExposureBeach);
+ return QVariant::fromValue(QCamera::ExposureBeach);
case GST_PHOTOGRAPHY_SCENE_MODE_ACTION:
- return QVariant::fromValue(QCameraExposure::ExposureAction);
+ return QVariant::fromValue(QCamera::ExposureAction);
case GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT:
- return QVariant::fromValue(QCameraExposure::ExposureNightPortrait);
+ return QVariant::fromValue(QCamera::ExposureNightPortrait);
case GST_PHOTOGRAPHY_SCENE_MODE_THEATRE:
- return QVariant::fromValue(QCameraExposure::ExposureTheatre);
+ return QVariant::fromValue(QCamera::ExposureTheatre);
case GST_PHOTOGRAPHY_SCENE_MODE_SUNSET:
- return QVariant::fromValue(QCameraExposure::ExposureSunset);
+ return QVariant::fromValue(QCamera::ExposureSunset);
case GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO:
- return QVariant::fromValue(QCameraExposure::ExposureSteadyPhoto);
+ return QVariant::fromValue(QCamera::ExposureSteadyPhoto);
case GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS:
- return QVariant::fromValue(QCameraExposure::ExposureFireworks);
+ return QVariant::fromValue(QCamera::ExposureFireworks);
case GST_PHOTOGRAPHY_SCENE_MODE_PARTY:
- return QVariant::fromValue(QCameraExposure::ExposureParty);
+ return QVariant::fromValue(QCamera::ExposureParty);
case GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT:
- return QVariant::fromValue(QCameraExposure::ExposureCandlelight);
+ return QVariant::fromValue(QCamera::ExposureCandlelight);
case GST_PHOTOGRAPHY_SCENE_MODE_BARCODE:
- return QVariant::fromValue(QCameraExposure::ExposureBarcode);
+ return QVariant::fromValue(QCamera::ExposureBarcode);
//no direct mapping available so mapping to auto mode
case GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP:
case GST_PHOTOGRAPHY_SCENE_MODE_AUTO:
default:
- return QVariant::fromValue(QCameraExposure::ExposureAuto);
+ return QVariant::fromValue(QCamera::ExposureAuto);
}
}
default:
@@ -219,61 +219,61 @@ bool QGstreamerCameraExposure::setValue(ExposureParameter parameter, const QVari
break;
case QPlatformCameraExposure::ExposureMode:
{
- QCameraExposure::ExposureMode mode = value.value<QCameraExposure::ExposureMode>();
+ QCamera::ExposureMode mode = value.value<QCamera::ExposureMode>();
GstPhotographySceneMode sceneMode;
gst_photography_get_scene_mode(m_camera->photography(), &sceneMode);
switch (mode) {
- case QCameraExposure::ExposureManual:
+ case QCamera::ExposureManual:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_MANUAL;
break;
- case QCameraExposure::ExposurePortrait:
+ case QCamera::ExposurePortrait:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT;
break;
- case QCameraExposure::ExposureSports:
+ case QCamera::ExposureSports:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_SPORT;
break;
- case QCameraExposure::ExposureNight:
+ case QCamera::ExposureNight:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT;
break;
- case QCameraExposure::ExposureAuto:
+ case QCamera::ExposureAuto:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO;
break;
- case QCameraExposure::ExposureLandscape:
+ case QCamera::ExposureLandscape:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE;
break;
- case QCameraExposure::ExposureSnow:
+ case QCamera::ExposureSnow:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_SNOW;
break;
- case QCameraExposure::ExposureBeach:
+ case QCamera::ExposureBeach:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_BEACH;
break;
- case QCameraExposure::ExposureAction:
+ case QCamera::ExposureAction:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_ACTION;
break;
- case QCameraExposure::ExposureNightPortrait:
+ case QCamera::ExposureNightPortrait:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT;
break;
- case QCameraExposure::ExposureTheatre:
+ case QCamera::ExposureTheatre:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_THEATRE;
break;
- case QCameraExposure::ExposureSunset:
+ case QCamera::ExposureSunset:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_SUNSET;
break;
- case QCameraExposure::ExposureSteadyPhoto:
+ case QCamera::ExposureSteadyPhoto:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO;
break;
- case QCameraExposure::ExposureFireworks:
+ case QCamera::ExposureFireworks:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS;
break;
- case QCameraExposure::ExposureParty:
+ case QCamera::ExposureParty:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_PARTY;
break;
- case QCameraExposure::ExposureCandlelight:
+ case QCamera::ExposureCandlelight:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT;
break;
- case QCameraExposure::ExposureBarcode:
+ case QCamera::ExposureBarcode:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_BARCODE;
break;
default:
@@ -306,33 +306,33 @@ bool QGstreamerCameraExposure::setValue(ExposureParameter parameter, const QVari
return false;
}
-QCameraExposure::FlashMode QGstreamerCameraExposure::flashMode() const
+QCamera::FlashMode QGstreamerCameraExposure::flashMode() const
{
#if QT_CONFIG(gstreamer_photography)
if (hasPhotography) {
GstPhotographyFlashMode flashMode;
gst_photography_get_flash_mode(m_camera->photography(), &flashMode);
- QCameraExposure::FlashMode mode;
+ QCamera::FlashMode mode;
switch (flashMode) {
default:
case GST_PHOTOGRAPHY_FLASH_MODE_AUTO:
- mode = QCameraExposure::FlashAuto;
+ mode = QCamera::FlashAuto;
break;
case GST_PHOTOGRAPHY_FLASH_MODE_OFF:
- mode = QCameraExposure::FlashOff;
+ mode = QCamera::FlashOff;
break;
case GST_PHOTOGRAPHY_FLASH_MODE_ON:
- mode = QCameraExposure::FlashOn;
+ mode = QCamera::FlashOn;
break;
}
return mode;
}
#endif
- return QCameraExposure::FlashAuto;
+ return QCamera::FlashAuto;
}
-void QGstreamerCameraExposure::setFlashMode(QCameraExposure::FlashMode mode)
+void QGstreamerCameraExposure::setFlashMode(QCamera::FlashMode mode)
{
Q_UNUSED(mode);
@@ -342,13 +342,13 @@ void QGstreamerCameraExposure::setFlashMode(QCameraExposure::FlashMode mode)
gst_photography_get_flash_mode(m_camera->photography(), &flashMode);
switch (mode) {
- case QCameraExposure::FlashAuto:
+ case QCamera::FlashAuto:
flashMode = GST_PHOTOGRAPHY_FLASH_MODE_AUTO;
break;
- case QCameraExposure::FlashOff:
+ case QCamera::FlashOff:
flashMode = GST_PHOTOGRAPHY_FLASH_MODE_OFF;
break;
- case QCameraExposure::FlashOn:
+ case QCamera::FlashOn:
flashMode = GST_PHOTOGRAPHY_FLASH_MODE_ON;
break;
}
@@ -358,14 +358,14 @@ void QGstreamerCameraExposure::setFlashMode(QCameraExposure::FlashMode mode)
#endif
}
-bool QGstreamerCameraExposure::isFlashModeSupported(QCameraExposure::FlashMode mode) const
+bool QGstreamerCameraExposure::isFlashModeSupported(QCamera::FlashMode mode) const
{
#if QT_CONFIG(gstreamer_photography)
if (hasPhotography)
return true;
#endif
- return mode == QCameraExposure::FlashAuto;
+ return mode == QCamera::FlashAuto;
}
bool QGstreamerCameraExposure::isFlashReady() const
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure_p.h b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure_p.h
index dd8ba34de..ecbd72e77 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure_p.h
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure_p.h
@@ -72,9 +72,9 @@ public:
QVariant actualValue(ExposureParameter parameter) const override;
bool setValue(ExposureParameter parameter, const QVariant &value) override;
- QCameraExposure::FlashMode flashMode() const override;
- void setFlashMode(QCameraExposure::FlashMode mode) override;
- bool isFlashModeSupported(QCameraExposure::FlashMode mode) const override;
+ QCamera::FlashMode flashMode() const override;
+ void setFlashMode(QCamera::FlashMode mode) override;
+ bool isFlashModeSupported(QCamera::FlashMode mode) const override;
bool isFlashReady() const override;
diff --git a/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp b/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp
index 4f5698b9d..63b0aade6 100644
--- a/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp
+++ b/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
BbCameraExposureControl::BbCameraExposureControl(BbCameraSession *session, QObject *parent)
: QPlatformCameraExposure(parent)
, m_session(session)
- , m_requestedExposureMode(QCameraExposure::ExposureAuto)
+ , m_requestedExposureMode(QCamera::ExposureAuto)
{
connect(m_session, SIGNAL(statusChanged(QCamera::Status)), this, SLOT(statusChanged(QCamera::Status)));
}
@@ -101,22 +101,22 @@ QVariantList BbCameraExposureControl::supportedParameterRange(ExposureParameter
for (int i = 0; i < supported; ++i) {
switch (modes[i]) {
case CAMERA_SCENE_AUTO:
- exposureModes << QVariant::fromValue(QCameraExposure::ExposureAuto);
+ exposureModes << QVariant::fromValue(QCamera::ExposureAuto);
break;
case CAMERA_SCENE_SPORTS:
- exposureModes << QVariant::fromValue(QCameraExposure::ExposureSports);
+ exposureModes << QVariant::fromValue(QCamera::ExposureSports);
break;
case CAMERA_SCENE_CLOSEUP:
- exposureModes << QVariant::fromValue(QCameraExposure::ExposurePortrait);
+ exposureModes << QVariant::fromValue(QCamera::ExposurePortrait);
break;
case CAMERA_SCENE_ACTION:
- exposureModes << QVariant::fromValue(QCameraExposure::ExposureSports);
+ exposureModes << QVariant::fromValue(QCamera::ExposureSports);
break;
case CAMERA_SCENE_BEACHANDSNOW:
- exposureModes << QVariant::fromValue(QCameraExposure::ExposureBeach) << QVariant::fromValue(QCameraExposure::ExposureSnow);
+ exposureModes << QVariant::fromValue(QCamera::ExposureBeach) << QVariant::fromValue(QCamera::ExposureSnow);
break;
case CAMERA_SCENE_NIGHT:
- exposureModes << QVariant::fromValue(QCameraExposure::ExposureNight);
+ exposureModes << QVariant::fromValue(QCamera::ExposureNight);
break;
default: break;
}
@@ -151,18 +151,18 @@ QVariant BbCameraExposureControl::actualValue(ExposureParameter parameter) const
switch (sceneMode) {
case CAMERA_SCENE_AUTO:
- return QVariant::fromValue(QCameraExposure::ExposureAuto);
+ return QVariant::fromValue(QCamera::ExposureAuto);
case CAMERA_SCENE_SPORTS:
- return QVariant::fromValue(QCameraExposure::ExposureSports);
+ return QVariant::fromValue(QCamera::ExposureSports);
case CAMERA_SCENE_CLOSEUP:
- return QVariant::fromValue(QCameraExposure::ExposurePortrait);
+ return QVariant::fromValue(QCamera::ExposurePortrait);
case CAMERA_SCENE_ACTION:
- return QVariant::fromValue(QCameraExposure::ExposureSports);
+ return QVariant::fromValue(QCamera::ExposureSports);
case CAMERA_SCENE_BEACHANDSNOW:
- return (m_requestedExposureMode == QCameraExposure::ExposureBeach ? QVariant::fromValue(QCameraExposure::ExposureBeach)
- : QVariant::fromValue(QCameraExposure::ExposureSnow));
+ return (m_requestedExposureMode == QCamera::ExposureBeach ? QVariant::fromValue(QCamera::ExposureBeach)
+ : QVariant::fromValue(QCamera::ExposureSnow));
case CAMERA_SCENE_NIGHT:
- return QVariant::fromValue(QCameraExposure::ExposureNight);
+ return QVariant::fromValue(QCamera::ExposureNight);
default:
break;
}
@@ -181,26 +181,26 @@ bool BbCameraExposureControl::setValue(ExposureParameter parameter, const QVaria
camera_scenemode_t sceneMode = CAMERA_SCENE_DEFAULT;
if (value.isValid()) {
- m_requestedExposureMode = value.value<QCameraExposure::ExposureMode>();
+ m_requestedExposureMode = value.value<QCamera::ExposureMode>();
emit requestedValueChanged(QPlatformCameraExposure::ExposureMode);
switch (m_requestedExposureMode) {
- case QCameraExposure::ExposureAuto:
+ case QCamera::ExposureAuto:
sceneMode = CAMERA_SCENE_AUTO;
break;
- case QCameraExposure::ExposureSports:
+ case QCamera::ExposureSports:
sceneMode = CAMERA_SCENE_SPORTS;
break;
- case QCameraExposure::ExposurePortrait:
+ case QCamera::ExposurePortrait:
sceneMode = CAMERA_SCENE_CLOSEUP;
break;
- case QCameraExposure::ExposureBeach:
+ case QCamera::ExposureBeach:
sceneMode = CAMERA_SCENE_BEACHANDSNOW;
break;
- case QCameraExposure::ExposureSnow:
+ case QCamera::ExposureSnow:
sceneMode = CAMERA_SCENE_BEACHANDSNOW;
break;
- case QCameraExposure::ExposureNight:
+ case QCamera::ExposureNight:
sceneMode = CAMERA_SCENE_NIGHT;
break;
default:
@@ -227,12 +227,12 @@ void BbCameraExposureControl::statusChanged(QCamera::Status status)
emit parameterRangeChanged(QPlatformCameraExposure::ExposureMode);
}
-QCameraExposure::FlashModes BbCameraExposureControl::flashMode() const
+QCamera::FlashModes BbCameraExposureControl::flashMode() const
{
return m_flashMode;
}
-void BbCameraExposureControl::setFlashMode(QCameraExposure::FlashModes mode)
+void BbCameraExposureControl::setFlashMode(QCamera::FlashModes mode)
{
if (m_flashMode == mode)
return;
@@ -240,7 +240,7 @@ void BbCameraExposureControl::setFlashMode(QCameraExposure::FlashModes mode)
if (m_session->status() != QCamera::ActiveStatus) // can only be changed when viewfinder is active
return;
-// if (m_flashMode == QCameraExposure::FlashVideoLight) {
+// if (m_flashMode == QCamera::FlashVideoLight) {
// const camera_error_t result = camera_config_videolight(m_session->handle(), CAMERA_VIDEOLIGHT_OFF);
// if (result != CAMERA_EOK)
// qWarning() << "Unable to switch off video light:" << result;
@@ -248,7 +248,7 @@ void BbCameraExposureControl::setFlashMode(QCameraExposure::FlashModes mode)
m_flashMode = mode;
-// if (m_flashMode == QCameraExposure::FlashVideoLight) {
+// if (m_flashMode == QCamera::FlashVideoLight) {
// const camera_error_t result = camera_config_videolight(m_session->handle(), CAMERA_VIDEOLIGHT_ON);
// if (result != CAMERA_EOK)
// qWarning() << "Unable to switch on video light:" << result;
@@ -256,11 +256,11 @@ void BbCameraExposureControl::setFlashMode(QCameraExposure::FlashModes mode)
{
camera_flashmode_t flashMode = CAMERA_FLASH_AUTO;
- if (m_flashMode == QCameraExposure::FlashAuto)
+ if (m_flashMode == QCamera::FlashAuto)
flashMode = CAMERA_FLASH_AUTO;
- else if (mode == QCameraExposure::FlashOff)
+ else if (mode == QCamera::FlashOff)
flashMode = CAMERA_FLASH_OFF;
- else if (mode == QCameraExposure::FlashOn)
+ else if (mode == QCamera::FlashOn)
flashMode = CAMERA_FLASH_ON;
const camera_error_t result = camera_config_flash(m_session->handle(), flashMode);
@@ -269,9 +269,9 @@ void BbCameraExposureControl::setFlashMode(QCameraExposure::FlashModes mode)
}
}
-bool BbCameraExposureControl::isFlashModeSupported(QCameraExposure::FlashModes mode) const
+bool BbCameraExposureControl::isFlashModeSupported(QCamera::FlashModes mode) const
{
- // ### Videolight maps to QCameraExposure::TorchOn.
+ // ### Videolight maps to QCamera::TorchOn.
// bool supportsVideoLight = false;
// if (m_session->handle() != CAMERA_HANDLE_INVALID) {
// supportsVideoLight = camera_has_feature(m_session->handle(), CAMERA_FEATURE_VIDEOLIGHT);
diff --git a/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol_p.h b/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol_p.h
index fec8bf526..60ffcd0f0 100644
--- a/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol_p.h
+++ b/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol_p.h
@@ -69,9 +69,9 @@ public:
QVariant actualValue(ExposureParameter parameter) const override;
bool setValue(ExposureParameter parameter, const QVariant& value) override;
- QCameraExposure::FlashMode flashMode() const override;
- void setFlashMode(QCameraExposure::FlashMode mode) override;
- bool isFlashModeSupported(QCameraExposure::FlashMode mode) const override;
+ QCamera::FlashMode flashMode() const override;
+ void setFlashMode(QCamera::FlashMode mode) override;
+ bool isFlashModeSupported(QCamera::FlashMode mode) const override;
bool isFlashReady() const override;
private Q_SLOTS:
@@ -79,9 +79,9 @@ private Q_SLOTS:
private:
BbCameraSession *m_session;
- QCameraExposure::ExposureMode m_requestedExposureMode;
+ QCamera::ExposureMode m_requestedExposureMode;
- QCameraExposure::FlashMode m_flashMode = QCameraExposure::FlashAuto;
+ QCamera::FlashMode m_flashMode = QCamera::FlashAuto;
};
QT_END_NAMESPACE
diff --git a/src/multimedia/platform/qplatformcameraexposure.cpp b/src/multimedia/platform/qplatformcameraexposure.cpp
index 9b2207cbd..d5bf56fa7 100644
--- a/src/multimedia/platform/qplatformcameraexposure.cpp
+++ b/src/multimedia/platform/qplatformcameraexposure.cpp
@@ -87,7 +87,7 @@ QPlatformCameraExposure::QPlatformCameraExposure(QObject *parent)
Accepted power range is [0..1.0],
with 0 value means no light and 1.0 corresponds to full torch power.
- This value is only used in the \l{QCameraExposure::FlashVideolight}{torch flash mode}.
+ This value is only used in the \l{QCamera::FlashVideolight}{torch flash mode}.
\value ExposureMode
Camera exposure mode.
*/
diff --git a/src/multimedia/platform/qplatformcameraexposure_p.h b/src/multimedia/platform/qplatformcameraexposure_p.h
index 76a7c04c7..11c709e24 100644
--- a/src/multimedia/platform/qplatformcameraexposure_p.h
+++ b/src/multimedia/platform/qplatformcameraexposure_p.h
@@ -54,7 +54,6 @@
#include <QtCore/qobject.h>
#include <QtMultimedia/qtmultimediaglobal.h>
-#include <QtMultimedia/qcameraexposure.h>
#include <QtMultimedia/qcamera.h>
#include <QtMultimedia/qmediaenumdebug.h>
@@ -85,13 +84,13 @@ public:
virtual QVariant actualValue(ExposureParameter parameter) const = 0;
virtual bool setValue(ExposureParameter parameter, const QVariant& value) = 0;
- virtual QCameraExposure::FlashMode flashMode() const = 0;
- virtual void setFlashMode(QCameraExposure::FlashMode mode) = 0;
- virtual bool isFlashModeSupported(QCameraExposure::FlashMode mode) const = 0;
+ virtual QCamera::FlashMode flashMode() const = 0;
+ virtual void setFlashMode(QCamera::FlashMode mode) = 0;
+ virtual bool isFlashModeSupported(QCamera::FlashMode mode) const = 0;
- virtual QCameraExposure::TorchMode torchMode() const { return QCameraExposure::TorchOff; }
- virtual void setTorchMode(QCameraExposure::TorchMode /*mode*/) {}
- virtual bool isTorchModeSupported(QCameraExposure::TorchMode mode) const { return mode == QCameraExposure::TorchOff; }
+ virtual QCamera::TorchMode torchMode() const { return QCamera::TorchOff; }
+ virtual void setTorchMode(QCamera::TorchMode /*mode*/) {}
+ virtual bool isTorchModeSupported(QCamera::TorchMode mode) const { return mode == QCamera::TorchOff; }
virtual bool isFlashReady() const = 0;
diff --git a/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure.cpp b/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure.cpp
index 548d78d9f..e5ec4cf83 100644
--- a/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure.cpp
+++ b/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure.cpp
@@ -78,16 +78,16 @@ bool QWindowsCameraExposure::setValue(ExposureParameter parameter, const QVarian
return false;
}
-QCameraExposure::FlashMode QWindowsCameraExposure::flashMode() const
+QCamera::FlashMode QWindowsCameraExposure::flashMode() const
{
- return QCameraExposure::FlashOff;
+ return QCamera::FlashOff;
}
-void QWindowsCameraExposure::setFlashMode(QCameraExposure::FlashMode mode)
+void QWindowsCameraExposure::setFlashMode(QCamera::FlashMode mode)
{
}
-bool QWindowsCameraExposure::isFlashModeSupported(QCameraExposure::FlashMode mode) const
+bool QWindowsCameraExposure::isFlashModeSupported(QCamera::FlashMode mode) const
{
return false;
}
@@ -97,16 +97,16 @@ bool QWindowsCameraExposure::isFlashReady() const
return false;
}
-QCameraExposure::TorchMode QWindowsCameraExposure::torchMode() const
+QCamera::TorchMode QWindowsCameraExposure::torchMode() const
{
- return QCameraExposure::TorchOff;
+ return QCamera::TorchOff;
}
-void QWindowsCameraExposure::setTorchMode(QCameraExposure::TorchMode mode)
+void QWindowsCameraExposure::setTorchMode(QCamera::TorchMode mode)
{
}
-bool QWindowsCameraExposure::isTorchModeSupported(QCameraExposure::TorchMode mode) const
+bool QWindowsCameraExposure::isTorchModeSupported(QCamera::TorchMode mode) const
{
return false;
}
diff --git a/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure_p.h b/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure_p.h
index 9fecdd53e..aa2b4c421 100644
--- a/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure_p.h
+++ b/src/multimedia/platform/windows/mediacapture/qwindowscameraexposure_p.h
@@ -70,14 +70,14 @@ public:
QVariant actualValue(ExposureParameter parameter) const override;
bool setValue(ExposureParameter parameter, const QVariant& value) override;
- QCameraExposure::FlashMode flashMode() const override;
- void setFlashMode(QCameraExposure::FlashMode mode) override;
- bool isFlashModeSupported(QCameraExposure::FlashMode mode) const override;
+ QCamera::FlashMode flashMode() const override;
+ void setFlashMode(QCamera::FlashMode mode) override;
+ bool isFlashModeSupported(QCamera::FlashMode mode) const override;
bool isFlashReady() const override;
- QCameraExposure::TorchMode torchMode() const override;
- void setTorchMode(QCameraExposure::TorchMode mode) override;
- bool isTorchModeSupported(QCameraExposure::TorchMode mode) const override;
+ QCamera::TorchMode torchMode() const override;
+ void setTorchMode(QCamera::TorchMode mode) override;
+ bool isTorchModeSupported(QCamera::TorchMode mode) const override;
private:
QWindowsCameraSession *m_session;
diff --git a/src/multimedia/qmediametadata.cpp b/src/multimedia/qmediametadata.cpp
index cd7c41c11..663ec4fe0 100644
--- a/src/multimedia/qmediametadata.cpp
+++ b/src/multimedia/qmediametadata.cpp
@@ -131,11 +131,11 @@ QT_BEGIN_NAMESPACE
\row \li LightSource
\li The kind of light source. \li QString
\row \li Flash
- \li Status of flash when the image was shot. \li QCameraExposure::FlashMode
+ \li Status of flash when the image was shot. \li QCamera::FlashMode
\row \li FocalLength
\li The actual focal length of the lens, in mm. \li qreal
\row \li ExposureMode
- \li Indicates the exposure mode set when the image was shot. \li QCameraExposure::ExposureMode
+ \li Indicates the exposure mode set when the image was shot. \li QCamera::ExposureMode
\row \li WhiteBalance
\li Indicates the white balance mode set when the image was shot. \li QCameraImageProcessing::WhiteBalanceMode
\row \li DigitalZoomRatio