summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gsttools/qgstreamervideoinputdevicecontrol.cpp10
-rw-r--r--src/gsttools/qgstreamervideoinputdevicecontrol_p.h2
-rw-r--r--src/multimedia/CMakeLists.txt1
-rw-r--r--src/multimedia/camera/qcamera.cpp18
-rw-r--r--src/multimedia/camera/qcamera_p.h3
-rw-r--r--src/multimedia/camera/qcamerainfo.cpp11
-rw-r--r--src/multimedia/controls/controls.pri2
-rw-r--r--src/multimedia/controls/qcamerainfocontrol.cpp103
-rw-r--r--src/multimedia/controls/qcamerainfocontrol.h69
-rw-r--r--src/multimedia/controls/qvideodeviceselectorcontrol.cpp16
-rw-r--r--src/multimedia/controls/qvideodeviceselectorcontrol.h4
-rw-r--r--src/multimedia/qmediaserviceprovider.cpp127
-rw-r--r--src/multimedia/qmediaserviceproviderplugin.h15
-rw-r--r--src/multimediawidgets/qcameraviewfinder.cpp1
-rw-r--r--src/plugins/android/src/CMakeLists.txt1
-rw-r--r--src/plugins/android/src/mediacapture/mediacapture.pri2
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.cpp80
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.h60
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcaptureservice.cpp7
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcaptureservice.h2
-rw-r--r--src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.cpp16
-rw-r--r--src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.h2
-rw-r--r--src/plugins/android/src/qandroidmediaserviceplugin.cpp11
-rw-r--r--src/plugins/android/src/qandroidmediaserviceplugin.h5
-rw-r--r--src/plugins/avfoundation/camera/CMakeLists.txt1
-rw-r--r--src/plugins/avfoundation/camera/avfcameradevicecontrol.h2
-rw-r--r--src/plugins/avfoundation/camera/avfcameradevicecontrol.mm19
-rw-r--r--src/plugins/avfoundation/camera/avfcamerainfocontrol.h59
-rw-r--r--src/plugins/avfoundation/camera/avfcamerainfocontrol.mm60
-rw-r--r--src/plugins/avfoundation/camera/avfcameraservice.h2
-rw-r--r--src/plugins/avfoundation/camera/avfcameraservice.mm5
-rw-r--r--src/plugins/avfoundation/camera/avfcameraserviceplugin.h7
-rw-r--r--src/plugins/avfoundation/camera/avfcameraserviceplugin.mm10
-rw-r--r--src/plugins/avfoundation/camera/camera.pro2
-rw-r--r--src/plugins/gstreamer/camerabin/CMakeLists.txt1
-rw-r--r--src/plugins/gstreamer/camerabin/camerabin.pro4
-rw-r--r--src/plugins/gstreamer/camerabin/camerabininfocontrol.cpp69
-rw-r--r--src/plugins/gstreamer/camerabin/camerabininfocontrol.h65
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinservice.cpp8
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinservice.h1
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp10
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinserviceplugin.h5
-rw-r--r--src/plugins/qnx/camera/bbcamerainfocontrol.cpp81
-rw-r--r--src/plugins/qnx/camera/bbcamerainfocontrol.h63
-rw-r--r--src/plugins/qnx/camera/bbcameraservice.cpp4
-rw-r--r--src/plugins/qnx/camera/bbcameraservice.h2
-rw-r--r--src/plugins/qnx/camera/bbvideodeviceselectorcontrol.cpp15
-rw-r--r--src/plugins/qnx/camera/bbvideodeviceselectorcontrol.h3
-rw-r--r--src/plugins/qnx/camera/camera.pri2
-rw-r--r--tests/auto/unit/qcamera/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcameraimagecapture/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcamerainfo/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcameraviewfinder/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcamerawidgets/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qdeclarativecamera/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp20
-rw-r--r--tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp20
-rw-r--r--tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp18
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcamera.pri1
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcamerainfocontrol.h72
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcameraservice.h6
-rw-r--r--tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h11
-rw-r--r--tests/auto/unit/qmultimedia_common/mockvideodeviceselectorcontrol.h14
64 files changed, 134 insertions, 1103 deletions
diff --git a/src/gsttools/qgstreamervideoinputdevicecontrol.cpp b/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
index 4d98afa62..54ae8fadc 100644
--- a/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
+++ b/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
@@ -79,6 +79,16 @@ QString QGstreamerVideoInputDeviceControl::deviceDescription(int index) const
return QGstUtils::enumerateCameras(m_factory).value(index).description;
}
+QCamera::Position QGstreamerVideoInputDeviceControl::cameraPosition(int index) const
+{
+ return QGstUtils::enumerateCameras(m_factory).value(index).position;
+}
+
+int QGstreamerVideoInputDeviceControl::cameraOrientation(int index) const
+{
+ return QGstUtils::enumerateCameras(m_factory).value(index).orientation;
+}
+
int QGstreamerVideoInputDeviceControl::defaultDevice() const
{
return 0;
diff --git a/src/gsttools/qgstreamervideoinputdevicecontrol_p.h b/src/gsttools/qgstreamervideoinputdevicecontrol_p.h
index 9d8dffd72..c8080a724 100644
--- a/src/gsttools/qgstreamervideoinputdevicecontrol_p.h
+++ b/src/gsttools/qgstreamervideoinputdevicecontrol_p.h
@@ -72,6 +72,8 @@ public:
QString deviceName(int index) const override;
QString deviceDescription(int index) const override;
+ QCamera::Position cameraPosition(int index) const override;
+ int cameraOrientation(int index) const override;
int defaultDevice() const override;
int selectedDevice() const override;
diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt
index f3e3facd7..101fecbc3 100644
--- a/src/multimedia/CMakeLists.txt
+++ b/src/multimedia/CMakeLists.txt
@@ -40,7 +40,6 @@ qt_add_module(Multimedia
controls/qcamerafocuscontrol.cpp controls/qcamerafocuscontrol.h
controls/qcameraimagecapturecontrol.cpp controls/qcameraimagecapturecontrol.h
controls/qcameraimageprocessingcontrol.cpp controls/qcameraimageprocessingcontrol.h
- controls/qcamerainfocontrol.cpp controls/qcamerainfocontrol.h
controls/qcameralockscontrol.cpp controls/qcameralockscontrol.h
controls/qcameraviewfindersettingscontrol.cpp controls/qcameraviewfindersettingscontrol.h
controls/qcamerazoomcontrol.cpp controls/qcamerazoomcontrol.h
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index b4515cfad..95a815c34 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -50,7 +50,6 @@
#include <qcameraimageprocessingcontrol.h>
#include <qcameraimagecapturecontrol.h>
#include <qvideodeviceselectorcontrol.h>
-#include <qcamerainfocontrol.h>
#include <qcameraviewfindersettingscontrol.h>
#include <QDebug>
@@ -185,7 +184,6 @@ void QCameraPrivate::initControls()
control = qobject_cast<QCameraControl *>(service->requestControl(QCameraControl_iid));
locksControl = qobject_cast<QCameraLocksControl *>(service->requestControl(QCameraLocksControl_iid));
deviceControl = qobject_cast<QVideoDeviceSelectorControl*>(service->requestControl(QVideoDeviceSelectorControl_iid));
- infoControl = qobject_cast<QCameraInfoControl*>(service->requestControl(QCameraInfoControl_iid));
viewfinderSettingsControl2 = qobject_cast<QCameraViewfinderSettingsControl2*>(service->requestControl(QCameraViewfinderSettingsControl2_iid));
if (!viewfinderSettingsControl2)
viewfinderSettingsControl = qobject_cast<QCameraViewfinderSettingsControl*>(service->requestControl(QCameraViewfinderSettingsControl_iid));
@@ -209,7 +207,6 @@ void QCameraPrivate::initControls()
control = nullptr;
locksControl = nullptr;
deviceControl = nullptr;
- infoControl = nullptr;
viewfinderSettingsControl = nullptr;
viewfinderSettingsControl2 = nullptr;
@@ -231,8 +228,6 @@ void QCameraPrivate::clear()
service->releaseControl(locksControl);
if (deviceControl)
service->releaseControl(deviceControl);
- if (infoControl)
- service->releaseControl(infoControl);
if (viewfinderSettingsControl)
service->releaseControl(viewfinderSettingsControl);
if (viewfinderSettingsControl2)
@@ -247,7 +242,6 @@ void QCameraPrivate::clear()
control = nullptr;
locksControl = nullptr;
deviceControl = nullptr;
- infoControl = nullptr;
viewfinderSettingsControl = nullptr;
viewfinderSettingsControl2 = nullptr;
service = nullptr;
@@ -341,8 +335,7 @@ QCamera::QCamera(QObject *parent):
QCamera::QCamera(const QByteArray& deviceName, QObject *parent):
QMediaObject(*new QCameraPrivate, parent,
- QMediaServiceProvider::defaultServiceProvider()->requestService(Q_MEDIASERVICE_CAMERA,
- QMediaServiceProviderHint(deviceName)))
+ QMediaServiceProvider::defaultServiceProvider()->requestService(Q_MEDIASERVICE_CAMERA))
{
Q_D(QCamera);
d->init();
@@ -367,12 +360,9 @@ QCamera::QCamera(const QByteArray& deviceName, QObject *parent):
d->service->releaseControl(d->control);
if (d->deviceControl)
d->service->releaseControl(d->deviceControl);
- if (d->infoControl)
- d->service->releaseControl(d->infoControl);
}
d->control = nullptr;
d->deviceControl = nullptr;
- d->infoControl = nullptr;
d->error = QCamera::ServiceMissingError;
d->errorString = QCamera::tr("The camera service is missing");
}
@@ -404,7 +394,7 @@ QCamera::QCamera(const QCameraInfo &cameraInfo, QObject *parent)
QCamera::QCamera(QCamera::Position position, QObject *parent)
: QMediaObject(*new QCameraPrivate,
parent,
- QMediaServiceProvider::defaultServiceProvider()->requestService(Q_MEDIASERVICE_CAMERA, QMediaServiceProviderHint(position)))
+ QMediaServiceProvider::defaultServiceProvider()->requestService(Q_MEDIASERVICE_CAMERA))
{
Q_D(QCamera);
d->init();
@@ -412,9 +402,9 @@ QCamera::QCamera(QCamera::Position position, QObject *parent)
if (d->service != nullptr && d->deviceControl) {
bool selectDefault = true;
- if (d->infoControl && position != UnspecifiedPosition) {
+ if (d->deviceControl && position != UnspecifiedPosition) {
for (int i = 0; i < d->deviceControl->deviceCount(); i++) {
- if (d->infoControl->cameraPosition(d->deviceControl->deviceName(i)) == position) {
+ if (d->deviceControl->cameraPosition(i) == position) {
d->deviceControl->setSelectedDevice(i);
selectDefault = false;
break;
diff --git a/src/multimedia/camera/qcamera_p.h b/src/multimedia/camera/qcamera_p.h
index 99759dbd3..258c894e0 100644
--- a/src/multimedia/camera/qcamera_p.h
+++ b/src/multimedia/camera/qcamera_p.h
@@ -61,7 +61,6 @@ class QMediaServiceProvider;
class QCameraControl;
class QVideoDeviceSelectorControl;
class QCameraLocksControl;
-class QCameraInfoControl;
class QCameraViewfinderSettingsControl;
class QCameraViewfinderSettingsControl2;
@@ -75,7 +74,6 @@ public:
control(nullptr),
deviceControl(nullptr),
locksControl(nullptr),
- infoControl(nullptr),
viewfinderSettingsControl(nullptr),
viewfinderSettingsControl2(nullptr),
cameraExposure(nullptr),
@@ -103,7 +101,6 @@ public:
QCameraControl *control;
QVideoDeviceSelectorControl *deviceControl;
QCameraLocksControl *locksControl;
- QCameraInfoControl *infoControl;
QCameraViewfinderSettingsControl *viewfinderSettingsControl;
QCameraViewfinderSettingsControl2 *viewfinderSettingsControl2;
diff --git a/src/multimedia/camera/qcamerainfo.cpp b/src/multimedia/camera/qcamerainfo.cpp
index 1e7511851..056b25803 100644
--- a/src/multimedia/camera/qcamerainfo.cpp
+++ b/src/multimedia/camera/qcamerainfo.cpp
@@ -43,7 +43,6 @@
#include "qmediaserviceprovider_p.h"
#include <qvideodeviceselectorcontrol.h>
-#include <qcamerainfocontrol.h>
QT_BEGIN_NAMESPACE
@@ -106,13 +105,8 @@ QCameraInfo::QCameraInfo(const QCamera &camera)
const int selectedDevice = deviceControl->selectedDevice();
d->deviceName = deviceControl->deviceName(selectedDevice);
d->description = deviceControl->deviceDescription(selectedDevice);
- d->isNull = false;
- }
-
- const QCameraInfoControl *infoControl = camera.d_func()->infoControl;
- if (infoControl) {
- d->position = infoControl->cameraPosition(d->deviceName);
- d->orientation = infoControl->cameraOrientation(d->deviceName);
+ d->position = deviceControl->cameraPosition(selectedDevice);
+ d->orientation = deviceControl->cameraOrientation(selectedDevice);
d->isNull = false;
}
}
@@ -128,6 +122,7 @@ QCameraInfo::QCameraInfo(const QByteArray &name)
if (!name.isNull()) {
QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider();
const QByteArray service(Q_MEDIASERVICE_CAMERA);
+
if (provider->devices(service).contains(name)) {
d->deviceName = QString::fromLatin1(name);
d->description = provider->deviceDescription(service, name);
diff --git a/src/multimedia/controls/controls.pri b/src/multimedia/controls/controls.pri
index 477b0fe17..9d01004a3 100644
--- a/src/multimedia/controls/controls.pri
+++ b/src/multimedia/controls/controls.pri
@@ -9,7 +9,6 @@ PUBLIC_HEADERS += \
controls/qcameracapturebufferformatcontrol.h \
controls/qcameracapturedestinationcontrol.h \
controls/qcameracontrol.h \
- controls/qcamerainfocontrol.h \
controls/qcameraexposurecontrol.h \
controls/qcameraflashcontrol.h \
controls/qcamerafocuscontrol.h \
@@ -36,7 +35,6 @@ SOURCES += \
controls/qcameracapturebufferformatcontrol.cpp \
controls/qcameracapturedestinationcontrol.cpp \
controls/qcameracontrol.cpp \
- controls/qcamerainfocontrol.cpp \
controls/qcameraexposurecontrol.cpp \
controls/qcameraflashcontrol.cpp \
controls/qcamerafocuscontrol.cpp \
diff --git a/src/multimedia/controls/qcamerainfocontrol.cpp b/src/multimedia/controls/qcamerainfocontrol.cpp
deleted file mode 100644
index 8a4ef3b44..000000000
--- a/src/multimedia/controls/qcamerainfocontrol.cpp
+++ /dev/null
@@ -1,103 +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 "qcamerainfocontrol.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QCameraInfoControl
- \obsolete
- \since 5.3
-
- \brief The QCameraInfoControl class provides a camera info media control.
- \inmodule QtMultimedia
-
- \ingroup multimedia_control
-
- The QCameraInfoControl class provides information about the camera devices
- available on the system.
-
- The interface name of QCameraInfoControl is \c org.qt-project.qt.camerainfocontrol/5.3 as
- defined in QCameraInfoControl_iid.
-*/
-
-/*!
- \macro QCameraInfoControl_iid
-
- \c org.qt-project.qt.camerainfocontrol/5.3
-
- Defines the interface name of the QCameraInfoControl class.
-
- \relates QVideoDeviceSelectorControl
-*/
-
-/*!
- Constructs a camera info control with the given \a parent.
-*/
-QCameraInfoControl::QCameraInfoControl(QObject *parent)
- : QMediaControl(parent)
-{
-}
-
-/*!
- Destroys a camera info control.
-*/
-QCameraInfoControl::~QCameraInfoControl()
-{
-}
-
-/*!
- \fn QCameraInfoControl::cameraPosition(const QString &deviceName) const
-
- Returns the physical position of the camera named \a deviceName on the hardware system.
-*/
-
-/*!
- \fn QCameraInfoControl::cameraOrientation(const QString &deviceName) const
-
- Returns the physical orientation of the sensor for the camera named \a deviceName.
-
- The value is the orientation angle (clockwise, in steps of 90 degrees) of the camera sensor
- in relation to the display in its natural orientation.
-*/
-
-QT_END_NAMESPACE
-
-#include "moc_qcamerainfocontrol.cpp"
diff --git a/src/multimedia/controls/qcamerainfocontrol.h b/src/multimedia/controls/qcamerainfocontrol.h
deleted file mode 100644
index 9ee0a3abf..000000000
--- a/src/multimedia/controls/qcamerainfocontrol.h
+++ /dev/null
@@ -1,69 +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 QCAMERAINFOCONTROL_H
-#define QCAMERAINFOCONTROL_H
-
-#include <QtMultimedia/qcamera.h>
-
-QT_BEGIN_NAMESPACE
-
-// Required for QDoc workaround
-class QString;
-
-class Q_MULTIMEDIA_EXPORT QCameraInfoControl : public QMediaControl
-{
- Q_OBJECT
-
-public:
- virtual ~QCameraInfoControl();
-
- virtual QCamera::Position cameraPosition(const QString &deviceName) const = 0;
- virtual int cameraOrientation(const QString &deviceName) const = 0;
-
-protected:
- explicit QCameraInfoControl(QObject *parent = nullptr);
-};
-
-#define QCameraInfoControl_iid "org.qt-project.qt.camerainfocontrol/5.3"
-Q_MEDIA_DECLARE_CONTROL(QCameraInfoControl, QCameraInfoControl_iid)
-
-QT_END_NAMESPACE
-
-#endif // QCAMERAINFOCONTROL_H
diff --git a/src/multimedia/controls/qvideodeviceselectorcontrol.cpp b/src/multimedia/controls/qvideodeviceselectorcontrol.cpp
index 420ba9150..3472299ce 100644
--- a/src/multimedia/controls/qvideodeviceselectorcontrol.cpp
+++ b/src/multimedia/controls/qvideodeviceselectorcontrol.cpp
@@ -103,6 +103,22 @@ QVideoDeviceSelectorControl::~QVideoDeviceSelectorControl()
*/
/*!
+ \fn QVideoDeviceSelectorControl::cameraPosition(int index) const
+
+ Returns the physical position of the camera at \a index.
+*/
+
+/*!
+ \fn QVideoDeviceSelectorControl::cameraOrientation(const QString &deviceName) const
+
+ Returns the physical orientation of the sensor for the camera at \a index.
+
+ The value is the orientation angle (clockwise, in steps of 90 degrees) of the camera sensor
+ in relation to the display in its natural orientation.
+*/
+
+
+/*!
\fn QVideoDeviceSelectorControl::defaultDevice() const
Returns the index of the default video device.
diff --git a/src/multimedia/controls/qvideodeviceselectorcontrol.h b/src/multimedia/controls/qvideodeviceselectorcontrol.h
index 4697196ce..2f9b91d44 100644
--- a/src/multimedia/controls/qvideodeviceselectorcontrol.h
+++ b/src/multimedia/controls/qvideodeviceselectorcontrol.h
@@ -41,6 +41,7 @@
#define QVIDEODEVICESELECTORCONTROL_H
#include <QtMultimedia/qmediacontrol.h>
+#include <QtMultimedia/qcamera.h>
QT_BEGIN_NAMESPACE
@@ -59,6 +60,9 @@ public:
virtual QString deviceName(int index) const = 0;
virtual QString deviceDescription(int index) const = 0;
+ virtual QCamera::Position cameraPosition(int index) const = 0;
+ virtual int cameraOrientation(int index) const = 0;
+
virtual int defaultDevice() const = 0;
virtual int selectedDevice() const = 0;
diff --git a/src/multimedia/qmediaserviceprovider.cpp b/src/multimedia/qmediaserviceprovider.cpp
index 93b560d8c..4d6ce266b 100644
--- a/src/multimedia/qmediaserviceprovider.cpp
+++ b/src/multimedia/qmediaserviceprovider.cpp
@@ -45,6 +45,7 @@
#include "qmediaserviceproviderplugin.h"
#include "qmediapluginloader_p.h"
#include "qmediaplayer.h"
+#include "qvideodeviceselectorcontrol.h"
QT_BEGIN_NAMESPACE
@@ -64,7 +65,6 @@ public:
:QSharedData(other),
type(other.type),
device(other.device),
- cameraPosition(other.cameraPosition),
mimeType(other.mimeType),
codecs(other.codecs),
features(other.features)
@@ -77,7 +77,6 @@ public:
QMediaServiceProviderHint::Type type;
QByteArray device;
- QCamera::Position cameraPosition = QCamera::UnspecifiedPosition;
QString mimeType;
QStringList codecs;
QMediaServiceProviderHint::Features features;
@@ -167,19 +166,6 @@ QMediaServiceProviderHint::QMediaServiceProviderHint(const QByteArray &device)
}
/*!
- \since 5.3
-
- Constructs a CameraPosition media service provider hint.
-
- This type of hint describes a media service that has a camera in the specific \a position.
-*/
-QMediaServiceProviderHint::QMediaServiceProviderHint(QCamera::Position position)
- :d(new QMediaServiceProviderHintPrivate(CameraPosition))
-{
- d->cameraPosition = position;
-}
-
-/*!
Constructs a SupportedFeatures media service provider hint.
This type of hint describes a service which supports a specific set of \a features.
@@ -224,7 +210,6 @@ bool QMediaServiceProviderHint::operator == (const QMediaServiceProviderHint &ot
return (d == other.d) ||
(d->type == other.d->type &&
d->device == other.d->device &&
- d->cameraPosition == other.d->cameraPosition &&
d->mimeType == other.d->mimeType &&
d->codecs == other.d->codecs &&
d->features == other.d->features);
@@ -281,17 +266,6 @@ QByteArray QMediaServiceProviderHint::device() const
}
/*!
- \since 5.3
-
- Returns the camera's position a media service is expected to utilize.
-*/
-QCamera::Position QMediaServiceProviderHint::cameraPosition() const
-{
- return d->cameraPosition;
-}
-
-
-/*!
Returns a set of features a media service is expected to provide.
*/
QMediaServiceProviderHint::Features QMediaServiceProviderHint::features() const
@@ -379,29 +353,6 @@ public:
}
}
break;
- case QMediaServiceProviderHint::CameraPosition: {
- plugin = plugins[0];
- if (type == QByteArray(Q_MEDIASERVICE_CAMERA)
- && hint.cameraPosition() != QCamera::UnspecifiedPosition) {
- for (QMediaServiceProviderPlugin *currentPlugin : qAsConst(plugins)) {
- const QMediaServiceSupportedDevicesInterface *deviceIface =
- qobject_cast<QMediaServiceSupportedDevicesInterface*>(currentPlugin);
- const QMediaServiceCameraInfoInterface *cameraIface =
- qobject_cast<QMediaServiceCameraInfoInterface*>(currentPlugin);
-
- if (deviceIface && cameraIface) {
- const QList<QByteArray> cameras = deviceIface->devices(type);
- for (const QByteArray &camera : cameras) {
- if (cameraIface->cameraPosition(camera) == hint.cameraPosition()) {
- plugin = currentPlugin;
- break;
- }
- }
- }
- }
- }
- }
- break;
case QMediaServiceProviderHint::ContentType: {
QMultimedia::SupportEstimate estimate = QMultimedia::NotSupported;
for (QMediaServiceProviderPlugin *currentPlugin : qAsConst(plugins)) {
@@ -628,42 +579,32 @@ public:
QCamera::Position cameraPosition(const QByteArray &device) const override
{
- const QByteArray serviceType(Q_MEDIASERVICE_CAMERA);
- const auto instances = loader()->instances(QString::fromLatin1(serviceType));
- for (QObject *obj : instances) {
- const QMediaServiceSupportedDevicesInterface *deviceIface =
- qobject_cast<QMediaServiceSupportedDevicesInterface*>(obj);
- const QMediaServiceCameraInfoInterface *cameraIface =
- qobject_cast<QMediaServiceCameraInfoInterface*>(obj);
-
- if (cameraIface) {
- if (deviceIface && !deviceIface->devices(serviceType).contains(device))
- continue;
- return cameraIface->cameraPosition(device);
+ QMediaService *service = const_cast<QPluginServiceProvider *>(this)->requestService(Q_MEDIASERVICE_CAMERA, QMediaServiceProviderHint());
+ auto *deviceControl = qobject_cast<QVideoDeviceSelectorControl *>(service->requestControl(QVideoDeviceSelectorControl_iid));
+ auto pos = QCamera::UnspecifiedPosition;
+ for (int i = 0; i < deviceControl->deviceCount(); i++) {
+ if (deviceControl->deviceName(i) == QString::fromUtf8(device)) {
+ pos = deviceControl->cameraPosition(i);
+ break;
}
}
-
- return QCamera::UnspecifiedPosition;
+ service->releaseControl(deviceControl);
+ return pos;
}
int cameraOrientation(const QByteArray &device) const override
{
- const QByteArray serviceType(Q_MEDIASERVICE_CAMERA);
- const auto instances = loader()->instances(QString::fromLatin1(serviceType));
- for (QObject *obj : instances) {
- const QMediaServiceSupportedDevicesInterface *deviceIface =
- qobject_cast<QMediaServiceSupportedDevicesInterface*>(obj);
- const QMediaServiceCameraInfoInterface *cameraIface =
- qobject_cast<QMediaServiceCameraInfoInterface*>(obj);
-
- if (cameraIface) {
- if (deviceIface && !deviceIface->devices(serviceType).contains(device))
- continue;
- return cameraIface->cameraOrientation(device);
+ QMediaService *service = const_cast<QPluginServiceProvider *>(this)->requestService(Q_MEDIASERVICE_CAMERA, QMediaServiceProviderHint());
+ auto *deviceControl = qobject_cast<QVideoDeviceSelectorControl *>(service->requestControl(QVideoDeviceSelectorControl_iid));
+ int orientation = 0;
+ for (int i = 0; i < deviceControl->deviceCount(); i++) {
+ if (deviceControl->deviceName(i) == QString::fromUtf8(device)) {
+ orientation = deviceControl->cameraOrientation(i);
+ break;
}
}
-
- return 0;
+ service->releaseControl(deviceControl);
+ return orientation;
}
};
@@ -948,36 +889,6 @@ QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider()
*/
/*!
- \class QMediaServiceCameraInfoInterface
- \obsolete
- \inmodule QtMultimedia
- \since 5.3
- \brief The QMediaServiceCameraInfoInterface class interface
- provides camera-specific information about devices supported by a camera service plug-in.
-
- A QMediaServiceProviderPlugin may implement this interface, in that case it also needs to
- implement the QMediaServiceSupportedDevicesInterface.
-*/
-
-/*!
- \fn QMediaServiceCameraInfoInterface::~QMediaServiceCameraInfoInterface()
-
- Destroys a media service camera info interface.
-*/
-
-/*!
- \fn QMediaServiceCameraInfoInterface::cameraPosition(const QByteArray &device) const
-
- Returns the physical position of a camera \a device supported by a camera service plug-in.
-*/
-
-/*!
- \fn QMediaServiceCameraInfoInterface::cameraOrientation(const QByteArray &device) const
-
- Returns the physical orientation of a camera \a device supported by a camera service plug-in.
-*/
-
-/*!
\class QMediaServiceFeaturesInterface
\obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/qmediaserviceproviderplugin.h b/src/multimedia/qmediaserviceproviderplugin.h
index 702ca4f55..ae278d6ba 100644
--- a/src/multimedia/qmediaserviceproviderplugin.h
+++ b/src/multimedia/qmediaserviceproviderplugin.h
@@ -61,7 +61,7 @@ class QMediaServiceProviderHintPrivate;
class Q_MULTIMEDIA_EXPORT QMediaServiceProviderHint
{
public:
- enum Type { Null, ContentType, Device, SupportedFeatures, CameraPosition };
+ enum Type { Null, ContentType, Device, SupportedFeatures };
enum Feature {
LowLatencyPlayback = 0x01,
@@ -74,7 +74,6 @@ public:
QMediaServiceProviderHint();
QMediaServiceProviderHint(const QString &mimeType, const QStringList& codecs);
QMediaServiceProviderHint(const QByteArray &device);
- QMediaServiceProviderHint(QCamera::Position position);
QMediaServiceProviderHint(Features features);
QMediaServiceProviderHint(const QMediaServiceProviderHint &other);
~QMediaServiceProviderHint();
@@ -92,7 +91,6 @@ public:
QStringList codecs() const;
QByteArray device() const;
- QCamera::Position cameraPosition() const;
Features features() const;
@@ -161,17 +159,6 @@ struct Q_MULTIMEDIA_EXPORT QMediaServiceDefaultDeviceInterface
"org.qt-project.qt.mediaservicedefaultdevice/5.3"
Q_DECLARE_INTERFACE(QMediaServiceDefaultDeviceInterface, QMediaServiceDefaultDeviceInterface_iid)
-struct Q_MULTIMEDIA_EXPORT QMediaServiceCameraInfoInterface
-{
- virtual ~QMediaServiceCameraInfoInterface() {}
- virtual QCamera::Position cameraPosition(const QByteArray &device) const = 0;
- virtual int cameraOrientation(const QByteArray &device) const = 0;
-};
-
-#define QMediaServiceCameraInfoInterface_iid \
- "org.qt-project.qt.mediaservicecamerainfo/5.3"
-Q_DECLARE_INTERFACE(QMediaServiceCameraInfoInterface, QMediaServiceCameraInfoInterface_iid)
-
// Required for QDoc workaround
class QString;
diff --git a/src/multimediawidgets/qcameraviewfinder.cpp b/src/multimediawidgets/qcameraviewfinder.cpp
index b48e892fa..adc55de3f 100644
--- a/src/multimediawidgets/qcameraviewfinder.cpp
+++ b/src/multimediawidgets/qcameraviewfinder.cpp
@@ -41,7 +41,6 @@
#include "qvideowidget_p.h"
#include <qcamera.h>
-#include <qvideodeviceselectorcontrol.h>
#include <private/qmediaobject_p.h>
#include <QtCore/QDebug>
diff --git a/src/plugins/android/src/CMakeLists.txt b/src/plugins/android/src/CMakeLists.txt
index 9043eb5e8..e5262dd16 100644
--- a/src/plugins/android/src/CMakeLists.txt
+++ b/src/plugins/android/src/CMakeLists.txt
@@ -21,7 +21,6 @@ qt_internal_add_plugin(QAndroidMediaServicePlugin
mediacapture/qandroidcamerafocuscontrol.cpp mediacapture/qandroidcamerafocuscontrol.h
mediacapture/qandroidcameraimagecapturecontrol.cpp mediacapture/qandroidcameraimagecapturecontrol.h
mediacapture/qandroidcameraimageprocessingcontrol.cpp mediacapture/qandroidcameraimageprocessingcontrol.h
- mediacapture/qandroidcamerainfocontrol.cpp mediacapture/qandroidcamerainfocontrol.h
mediacapture/qandroidcameralockscontrol.cpp mediacapture/qandroidcameralockscontrol.h
mediacapture/qandroidcamerasession.cpp mediacapture/qandroidcamerasession.h
mediacapture/qandroidcameravideorenderercontrol.cpp mediacapture/qandroidcameravideorenderercontrol.h
diff --git a/src/plugins/android/src/mediacapture/mediacapture.pri b/src/plugins/android/src/mediacapture/mediacapture.pri
index a42a6a40c..f3da6831a 100644
--- a/src/plugins/android/src/mediacapture/mediacapture.pri
+++ b/src/plugins/android/src/mediacapture/mediacapture.pri
@@ -23,7 +23,6 @@ SOURCES += \
$$PWD/qandroidvideoencodersettingscontrol.cpp \
$$PWD/qandroidaudioinputselectorcontrol.cpp \
$$PWD/qandroidmediavideoprobecontrol.cpp \
- $$PWD/qandroidcamerainfocontrol.cpp \
$$PWD/qandroidcameravideorenderercontrol.cpp
HEADERS += \
@@ -49,5 +48,4 @@ HEADERS += \
$$PWD/qandroidvideoencodersettingscontrol.h \
$$PWD/qandroidaudioinputselectorcontrol.h \
$$PWD/qandroidmediavideoprobecontrol.h \
- $$PWD/qandroidcamerainfocontrol.h \
$$PWD/qandroidcameravideorenderercontrol.h
diff --git a/src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.cpp b/src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.cpp
deleted file mode 100644
index 911ffc3ca..000000000
--- a/src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.cpp
+++ /dev/null
@@ -1,80 +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 "qandroidcamerainfocontrol.h"
-
-#include "qandroidcamerasession.h"
-
-QT_BEGIN_NAMESPACE
-
-QCamera::Position QAndroidCameraInfoControl::position(const QString &deviceName)
-{
- const QList<AndroidCameraInfo> &cameras = QAndroidCameraSession::availableCameras();
- for (int i = 0; i < cameras.count(); ++i) {
- const AndroidCameraInfo &info = cameras.at(i);
- if (QString::fromLatin1(info.name) == deviceName)
- return info.position;
- }
-
- return QCamera::UnspecifiedPosition;
-}
-
-int QAndroidCameraInfoControl::orientation(const QString &deviceName)
-{
- const QList<AndroidCameraInfo> &cameras = QAndroidCameraSession::availableCameras();
- for (int i = 0; i < cameras.count(); ++i) {
- const AndroidCameraInfo &info = cameras.at(i);
- if (QString::fromLatin1(info.name) == deviceName)
- return info.orientation;
- }
-
- return 0;
-}
-
-QCamera::Position QAndroidCameraInfoControl::cameraPosition(const QString &deviceName) const
-{
- return position(deviceName);
-}
-
-int QAndroidCameraInfoControl::cameraOrientation(const QString &deviceName) const
-{
- return orientation(deviceName);
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.h b/src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.h
deleted file mode 100644
index 349c73c97..000000000
--- a/src/plugins/android/src/mediacapture/qandroidcamerainfocontrol.h
+++ /dev/null
@@ -1,60 +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 QANDROIDCAMERAINFOCONTROL_H
-#define QANDROIDCAMERAINFOCONTROL_H
-
-#include <qcamerainfocontrol.h>
-
-QT_BEGIN_NAMESPACE
-
-class QAndroidCameraInfoControl : public QCameraInfoControl
-{
- Q_OBJECT
-public:
- QCamera::Position cameraPosition(const QString &deviceName) const;
- int cameraOrientation(const QString &deviceName) const;
-
- static QCamera::Position position(const QString &deviceName);
- static int orientation(const QString &deviceName);
-};
-
-QT_END_NAMESPACE
-
-#endif // QANDROIDCAMERAINFOCONTROL_H
diff --git a/src/plugins/android/src/mediacapture/qandroidcaptureservice.cpp b/src/plugins/android/src/mediacapture/qandroidcaptureservice.cpp
index 65df54c3f..f976a24c7 100644
--- a/src/plugins/android/src/mediacapture/qandroidcaptureservice.cpp
+++ b/src/plugins/android/src/mediacapture/qandroidcaptureservice.cpp
@@ -43,7 +43,6 @@
#include "qandroidmediarecordercontrol.h"
#include "qandroidcapturesession.h"
#include "qandroidcameracontrol.h"
-#include "qandroidcamerainfocontrol.h"
#include "qandroidvideodeviceselectorcontrol.h"
#include "qandroidaudioinputselectorcontrol.h"
#include "qandroidcamerasession.h"
@@ -76,7 +75,6 @@ QAndroidCaptureService::QAndroidCaptureService(const QString &service, QObject *
if (m_service == QLatin1String(Q_MEDIASERVICE_CAMERA)) {
m_cameraSession = new QAndroidCameraSession;
m_cameraControl = new QAndroidCameraControl(m_cameraSession);
- m_cameraInfoControl = new QAndroidCameraInfoControl;
m_videoInputControl = new QAndroidVideoDeviceSelectorControl(m_cameraSession);
m_cameraZoomControl = new QAndroidCameraZoomControl(m_cameraSession);
m_cameraExposureControl = new QAndroidCameraExposureControl(m_cameraSession);
@@ -93,7 +91,6 @@ QAndroidCaptureService::QAndroidCaptureService(const QString &service, QObject *
} else {
m_cameraSession = 0;
m_cameraControl = 0;
- m_cameraInfoControl = 0;
m_videoInputControl = 0;
m_cameraZoomControl = 0;
m_cameraExposureControl = 0;
@@ -130,7 +127,6 @@ QAndroidCaptureService::~QAndroidCaptureService()
delete m_recorderControl;
delete m_captureSession;
delete m_cameraControl;
- delete m_cameraInfoControl;
delete m_audioInputControl;
delete m_videoInputControl;
delete m_videoRendererControl;
@@ -165,9 +161,6 @@ QMediaControl *QAndroidCaptureService::requestControl(const char *name)
if (qstrcmp(name, QCameraControl_iid) == 0)
return m_cameraControl;
- if (qstrcmp(name, QCameraInfoControl_iid) == 0)
- return m_cameraInfoControl;
-
if (qstrcmp(name, QAudioInputSelectorControl_iid) == 0)
return m_audioInputControl;
diff --git a/src/plugins/android/src/mediacapture/qandroidcaptureservice.h b/src/plugins/android/src/mediacapture/qandroidcaptureservice.h
index 85816fdd6..547f164b2 100644
--- a/src/plugins/android/src/mediacapture/qandroidcaptureservice.h
+++ b/src/plugins/android/src/mediacapture/qandroidcaptureservice.h
@@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE
class QAndroidMediaRecorderControl;
class QAndroidCaptureSession;
class QAndroidCameraControl;
-class QAndroidCameraInfoControl;
class QAndroidVideoDeviceSelectorControl;
class QAndroidAudioInputSelectorControl;
class QAndroidCameraSession;
@@ -86,7 +85,6 @@ private:
QAndroidMediaRecorderControl *m_recorderControl;
QAndroidCaptureSession *m_captureSession;
QAndroidCameraControl *m_cameraControl;
- QAndroidCameraInfoControl *m_cameraInfoControl;
QAndroidVideoDeviceSelectorControl *m_videoInputControl;
QAndroidAudioInputSelectorControl *m_audioInputControl;
QAndroidCameraSession *m_cameraSession;
diff --git a/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.cpp b/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.cpp
index 65005c796..0c7756693 100644
--- a/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.cpp
+++ b/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.cpp
@@ -76,6 +76,22 @@ QString QAndroidVideoDeviceSelectorControl::deviceDescription(int index) const
return QAndroidCameraSession::availableCameras().at(index).description;
}
+QCamera::Position QAndroidVideoDeviceSelectorControl::cameraPosition(int index) const
+{
+ if (index < 0 || index >= QAndroidCameraSession::availableCameras().count())
+ return QCamera::UnspecifiedPosition;
+
+ return QAndroidCameraSession::availableCameras().at(index).position;
+}
+
+int QAndroidVideoDeviceSelectorControl::cameraOrientation(int index) const
+{
+ if (index < 0 || index >= QAndroidCameraSession::availableCameras().count())
+ return QCamera::UnspecifiedPosition;
+
+ return QAndroidCameraSession::availableCameras().at(index).orientation;
+}
+
int QAndroidVideoDeviceSelectorControl::defaultDevice() const
{
return 0;
diff --git a/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.h b/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.h
index b6cc30b2d..cdfffcaf0 100644
--- a/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.h
+++ b/src/plugins/android/src/mediacapture/qandroidvideodeviceselectorcontrol.h
@@ -58,6 +58,8 @@ public:
QString deviceName(int index) const;
QString deviceDescription(int index) const;
+ QCamera::Position cameraPosition(int index) const;
+ int cameraOrientation(int index) const;
int defaultDevice() const;
int selectedDevice() const;
diff --git a/src/plugins/android/src/qandroidmediaserviceplugin.cpp b/src/plugins/android/src/qandroidmediaserviceplugin.cpp
index a66b85f98..c9b0d411f 100644
--- a/src/plugins/android/src/qandroidmediaserviceplugin.cpp
+++ b/src/plugins/android/src/qandroidmediaserviceplugin.cpp
@@ -42,7 +42,6 @@
#include "qandroidmediaservice.h"
#include "qandroidcaptureservice.h"
#include "qandroidaudioinputselectorcontrol.h"
-#include "qandroidcamerainfocontrol.h"
#include "qandroidcamerasession.h"
#include "androidmediaplayer.h"
#include "androidsurfacetexture.h"
@@ -138,16 +137,6 @@ QString QAndroidMediaServicePlugin::deviceDescription(const QByteArray &service,
return QString();
}
-QCamera::Position QAndroidMediaServicePlugin::cameraPosition(const QByteArray &device) const
-{
- return QAndroidCameraInfoControl::position(device);
-}
-
-int QAndroidMediaServicePlugin::cameraOrientation(const QByteArray &device) const
-{
- return QAndroidCameraInfoControl::orientation(device);
-}
-
QT_END_NAMESPACE
Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*reserved*/)
diff --git a/src/plugins/android/src/qandroidmediaserviceplugin.h b/src/plugins/android/src/qandroidmediaserviceplugin.h
index 3ae1a36b6..74aa683ab 100644
--- a/src/plugins/android/src/qandroidmediaserviceplugin.h
+++ b/src/plugins/android/src/qandroidmediaserviceplugin.h
@@ -48,13 +48,11 @@ class QAndroidMediaServicePlugin
: public QMediaServiceProviderPlugin
, public QMediaServiceSupportedDevicesInterface
, public QMediaServiceDefaultDeviceInterface
- , public QMediaServiceCameraInfoInterface
, public QMediaServiceFeaturesInterface
{
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
- Q_INTERFACES(QMediaServiceCameraInfoInterface)
Q_INTERFACES(QMediaServiceFeaturesInterface)
Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0"
FILE "android_mediaservice.json")
@@ -71,9 +69,6 @@ public:
QByteArray defaultDevice(const QByteArray &service) const override;
QList<QByteArray> devices(const QByteArray &service) const override;
QString deviceDescription(const QByteArray &service, const QByteArray &device) override;
-
- QCamera::Position cameraPosition(const QByteArray &device) const override;
- int cameraOrientation(const QByteArray &device) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/avfoundation/camera/CMakeLists.txt b/src/plugins/avfoundation/camera/CMakeLists.txt
index e878b5192..8af2b75db 100644
--- a/src/plugins/avfoundation/camera/CMakeLists.txt
+++ b/src/plugins/avfoundation/camera/CMakeLists.txt
@@ -16,7 +16,6 @@ qt_internal_add_plugin(AVFServicePlugin
avfcameraexposurecontrol.h avfcameraexposurecontrol.mm
avfcameraflashcontrol.h avfcameraflashcontrol.mm
avfcamerafocuscontrol.h avfcamerafocuscontrol.mm
- avfcamerainfocontrol.h avfcamerainfocontrol.mm
avfcamerametadatacontrol.h avfcamerametadatacontrol.mm
avfcamerarenderercontrol.h avfcamerarenderercontrol.mm
avfcameraservice.h avfcameraservice.mm
diff --git a/src/plugins/avfoundation/camera/avfcameradevicecontrol.h b/src/plugins/avfoundation/camera/avfcameradevicecontrol.h
index 0a16c0408..0b0d560e8 100644
--- a/src/plugins/avfoundation/camera/avfcameradevicecontrol.h
+++ b/src/plugins/avfoundation/camera/avfcameradevicecontrol.h
@@ -61,6 +61,8 @@ public:
QString deviceName(int index) const override;
QString deviceDescription(int index) const override;
+ QCamera::Position cameraPosition(int index) const override;
+ int cameraOrientation(int index) const override;
int defaultDevice() const override;
int selectedDevice() const override;
diff --git a/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm b/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm
index 907373b61..cf6343754 100644
--- a/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm
@@ -80,6 +80,25 @@ QString AVFCameraDeviceControl::deviceDescription(int index) const
return devices.at(index).description;
}
+QCamera::Position AVFCameraDeviceControl::cameraPosition(int index) const
+{
+ const QList<AVFCameraInfo> &devices = AVFCameraSession::availableCameraDevices();
+ if (index < 0 || index >= devices.count())
+ return QCamera::UnspecifiedPosition;
+
+ return devices.at(index).position;
+}
+
+int AVFCameraDeviceControl::cameraOrientation(int index) const
+{
+ const QList<AVFCameraInfo> &devices = AVFCameraSession::availableCameraDevices();
+ if (index < 0 || index >= devices.count())
+ return 0;
+
+ return devices.at(index).orientation;
+}
+
+
int AVFCameraDeviceControl::defaultDevice() const
{
return AVFCameraSession::defaultCameraIndex();
diff --git a/src/plugins/avfoundation/camera/avfcamerainfocontrol.h b/src/plugins/avfoundation/camera/avfcamerainfocontrol.h
deleted file mode 100644
index c3aa11918..000000000
--- a/src/plugins/avfoundation/camera/avfcamerainfocontrol.h
+++ /dev/null
@@ -1,59 +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 AVFCAMERAINFOCONTROL_H
-#define AVFCAMERAINFOCONTROL_H
-
-#include <qcamerainfocontrol.h>
-
-QT_BEGIN_NAMESPACE
-
-class AVFCameraInfoControl : public QCameraInfoControl
-{
- Q_OBJECT
-public:
- explicit AVFCameraInfoControl(QObject *parent = nullptr);
-
- QCamera::Position cameraPosition(const QString &deviceName) const override;
- int cameraOrientation(const QString &deviceName) const override;
-};
-
-QT_END_NAMESPACE
-
-#endif // AVFCAMERAINFOCONTROL_H
diff --git a/src/plugins/avfoundation/camera/avfcamerainfocontrol.mm b/src/plugins/avfoundation/camera/avfcamerainfocontrol.mm
deleted file mode 100644
index 26905b0c2..000000000
--- a/src/plugins/avfoundation/camera/avfcamerainfocontrol.mm
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** 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 "avfcamerainfocontrol.h"
-#include "avfcamerasession.h"
-
-QT_BEGIN_NAMESPACE
-
-AVFCameraInfoControl::AVFCameraInfoControl(QObject *parent)
- : QCameraInfoControl(parent)
-{
-}
-
-QCamera::Position AVFCameraInfoControl::cameraPosition(const QString &deviceName) const
-{
- return AVFCameraSession::cameraDeviceInfo(deviceName.toUtf8()).position;
-}
-
-int AVFCameraInfoControl::cameraOrientation(const QString &deviceName) const
-{
- return AVFCameraSession::cameraDeviceInfo(deviceName.toUtf8()).orientation;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/avfoundation/camera/avfcameraservice.h b/src/plugins/avfoundation/camera/avfcameraservice.h
index 1397a7dee..635144119 100644
--- a/src/plugins/avfoundation/camera/avfcameraservice.h
+++ b/src/plugins/avfoundation/camera/avfcameraservice.h
@@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE
class QCameraControl;
class QMediaRecorderControl;
class AVFCameraControl;
-class AVFCameraInfoControl;
class AVFCameraMetaDataControl;
class AVFVideoWindowControl;
class AVFVideoWidgetControl;
@@ -106,7 +105,6 @@ public:
private:
AVFCameraSession *m_session;
AVFCameraControl *m_cameraControl;
- AVFCameraInfoControl *m_cameraInfoControl;
AVFCameraDeviceControl *m_videoDeviceControl;
AVFAudioInputSelectorControl *m_audioInputSelectorControl;
AVFCameraRendererControl *m_videoOutput;
diff --git a/src/plugins/avfoundation/camera/avfcameraservice.mm b/src/plugins/avfoundation/camera/avfcameraservice.mm
index 742b83b75..7c7e1bd0a 100644
--- a/src/plugins/avfoundation/camera/avfcameraservice.mm
+++ b/src/plugins/avfoundation/camera/avfcameraservice.mm
@@ -42,7 +42,6 @@
#include "avfcameraservice.h"
#include "avfcameracontrol.h"
-#include "avfcamerainfocontrol.h"
#include "avfcamerasession.h"
#include "avfcameradevicecontrol.h"
#include "avfaudioinputselectorcontrol.h"
@@ -80,7 +79,6 @@ AVFCameraService::AVFCameraService(QObject *parent):
{
m_session = new AVFCameraSession(this);
m_cameraControl = new AVFCameraControl(this);
- m_cameraInfoControl = new AVFCameraInfoControl(this);
m_videoDeviceControl = new AVFCameraDeviceControl(this);
m_audioInputSelectorControl = new AVFAudioInputSelectorControl(this);
@@ -162,9 +160,6 @@ QMediaControl *AVFCameraService::requestControl(const char *name)
if (qstrcmp(name, QCameraControl_iid) == 0)
return m_cameraControl;
- if (qstrcmp(name, QCameraInfoControl_iid) == 0)
- return m_cameraInfoControl;
-
if (qstrcmp(name, QVideoDeviceSelectorControl_iid) == 0)
return m_videoDeviceControl;
diff --git a/src/plugins/avfoundation/camera/avfcameraserviceplugin.h b/src/plugins/avfoundation/camera/avfcameraserviceplugin.h
index bd5f83249..21f362bd6 100644
--- a/src/plugins/avfoundation/camera/avfcameraserviceplugin.h
+++ b/src/plugins/avfoundation/camera/avfcameraserviceplugin.h
@@ -48,13 +48,11 @@ QT_BEGIN_NAMESPACE
class AVFServicePlugin : public QMediaServiceProviderPlugin,
public QMediaServiceSupportedDevicesInterface,
- public QMediaServiceDefaultDeviceInterface,
- public QMediaServiceCameraInfoInterface
+ public QMediaServiceDefaultDeviceInterface
{
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
- Q_INTERFACES(QMediaServiceCameraInfoInterface)
Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "avfcamera.json")
public:
@@ -66,9 +64,6 @@ public:
QByteArray defaultDevice(const QByteArray &service) const override;
QList<QByteArray> devices(const QByteArray &service) const override;
QString deviceDescription(const QByteArray &service, const QByteArray &device) override;
-
- QCamera::Position cameraPosition(const QByteArray &device) const override;
- int cameraOrientation(const QByteArray &device) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm b/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm
index 08bd8c9bd..a94325e34 100644
--- a/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm
+++ b/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm
@@ -100,14 +100,4 @@ QString AVFServicePlugin::deviceDescription(const QByteArray &service, const QBy
return QString();
}
-QCamera::Position AVFServicePlugin::cameraPosition(const QByteArray &device) const
-{
- return AVFCameraSession::cameraDeviceInfo(device).position;
-}
-
-int AVFServicePlugin::cameraOrientation(const QByteArray &device) const
-{
- return AVFCameraSession::cameraDeviceInfo(device).orientation;
-}
-
QT_END_NAMESPACE
diff --git a/src/plugins/avfoundation/camera/camera.pro b/src/plugins/avfoundation/camera/camera.pro
index 76aa8af85..d9de4b8c5 100644
--- a/src/plugins/avfoundation/camera/camera.pro
+++ b/src/plugins/avfoundation/camera/camera.pro
@@ -30,7 +30,6 @@ HEADERS += \
avfcamerasession.h \
avfstoragelocation.h \
avfaudioinputselectorcontrol.h \
- avfcamerainfocontrol.h \
avfmediavideoprobecontrol.h \
avfcamerarenderercontrol.h \
avfcameradevicecontrol.h \
@@ -55,7 +54,6 @@ OBJECTIVE_SOURCES += \
avfcamerasession.mm \
avfstoragelocation.mm \
avfaudioinputselectorcontrol.mm \
- avfcamerainfocontrol.mm \
avfmediavideoprobecontrol.mm \
avfcameradevicecontrol.mm \
avfcamerarenderercontrol.mm \
diff --git a/src/plugins/gstreamer/camerabin/CMakeLists.txt b/src/plugins/gstreamer/camerabin/CMakeLists.txt
index 6d331d67e..069d606d8 100644
--- a/src/plugins/gstreamer/camerabin/CMakeLists.txt
+++ b/src/plugins/gstreamer/camerabin/CMakeLists.txt
@@ -16,7 +16,6 @@ qt_internal_add_plugin(CameraBinServicePlugin
camerabinimagecapture.cpp camerabinimagecapture.h
camerabinimageencoder.cpp camerabinimageencoder.h
camerabinimageprocessing.cpp camerabinimageprocessing.h
- camerabininfocontrol.cpp camerabininfocontrol.h
camerabinmetadata.cpp camerabinmetadata.h
camerabinrecorder.cpp camerabinrecorder.h
camerabinservice.cpp camerabinservice.h
diff --git a/src/plugins/gstreamer/camerabin/camerabin.pro b/src/plugins/gstreamer/camerabin/camerabin.pro
index 1fa3b3534..a3dce177b 100644
--- a/src/plugins/gstreamer/camerabin/camerabin.pro
+++ b/src/plugins/gstreamer/camerabin/camerabin.pro
@@ -28,7 +28,6 @@ HEADERS += \
$$PWD/camerabincapturebufferformat.h \
$$PWD/camerabinviewfindersettings.h \
$$PWD/camerabinviewfindersettings2.h \
- $$PWD/camerabininfocontrol.h
SOURCES += \
$$PWD/camerabinserviceplugin.cpp \
@@ -47,8 +46,7 @@ SOURCES += \
$$PWD/camerabincapturedestination.cpp \
$$PWD/camerabinviewfindersettings.cpp \
$$PWD/camerabinviewfindersettings2.cpp \
- $$PWD/camerabincapturebufferformat.cpp \
- $$PWD/camerabininfocontrol.cpp
+ $$PWD/camerabincapturebufferformat.cpp \
qtConfig(gstreamer_photography) {
HEADERS += \
diff --git a/src/plugins/gstreamer/camerabin/camerabininfocontrol.cpp b/src/plugins/gstreamer/camerabin/camerabininfocontrol.cpp
deleted file mode 100644
index 6aa3aeb61..000000000
--- a/src/plugins/gstreamer/camerabin/camerabininfocontrol.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Jolla 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 "camerabininfocontrol.h"
-
-#include <private/qgstutils_p.h>
-
-QT_BEGIN_NAMESPACE
-
-CameraBinInfoControl::CameraBinInfoControl(GstElementFactory *sourceFactory, QObject *parent)
- : QCameraInfoControl(parent)
- , m_sourceFactory(sourceFactory)
-{
- gst_object_ref(GST_OBJECT(m_sourceFactory));
-}
-
-CameraBinInfoControl::~CameraBinInfoControl()
-{
- gst_object_unref(GST_OBJECT(m_sourceFactory));
-}
-
-QCamera::Position CameraBinInfoControl::cameraPosition(const QString &device) const
-{
- return QGstUtils::cameraPosition(device, m_sourceFactory);
-}
-
-int CameraBinInfoControl::cameraOrientation(const QString &device) const
-{
- return QGstUtils::cameraOrientation(device, m_sourceFactory);
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/gstreamer/camerabin/camerabininfocontrol.h b/src/plugins/gstreamer/camerabin/camerabininfocontrol.h
deleted file mode 100644
index 9c801e804..000000000
--- a/src/plugins/gstreamer/camerabin/camerabininfocontrol.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Jolla 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 CAMERABININFOCONTROL_H
-#define CAMERABININFOCONTROL_H
-
-#include <qcamerainfocontrol.h>
-
-#include <gst/gst.h>
-
-QT_BEGIN_NAMESPACE
-
-class CameraBinInfoControl : public QCameraInfoControl
-{
- Q_OBJECT
-public:
- CameraBinInfoControl(GstElementFactory *sourceFactory, QObject *parent);
- ~CameraBinInfoControl();
-
- QCamera::Position cameraPosition(const QString &deviceName) const override;
- int cameraOrientation(const QString &deviceName) const override;
-
-private:
- GstElementFactory * const m_sourceFactory;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp
index a68ecfdbe..a434700f2 100644
--- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp
@@ -47,7 +47,6 @@
#include "camerabinimageencoder.h"
#include "camerabincontrol.h"
#include "camerabinmetadata.h"
-#include "camerabininfocontrol.h"
#if QT_CONFIG(gstreamer_photography)
#include "camerabinexposure.h"
@@ -82,7 +81,6 @@ QT_BEGIN_NAMESPACE
CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *parent):
QMediaService(parent),
- m_cameraInfoControl(0),
m_viewfinderSettingsControl(0),
m_viewfinderSettingsControl2(0)
{
@@ -240,12 +238,6 @@ QMediaControl *CameraBinService::requestControl(const char *name)
return m_viewfinderSettingsControl2;
}
- if (qstrcmp(name, QCameraInfoControl_iid) == 0) {
- if (!m_cameraInfoControl)
- m_cameraInfoControl = new CameraBinInfoControl(m_captureSession->sourceFactory(), this);
- return m_cameraInfoControl;
- }
-
return 0;
}
diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.h b/src/plugins/gstreamer/camerabin/camerabinservice.h
index 44afef25f..c6fc74ec2 100644
--- a/src/plugins/gstreamer/camerabin/camerabinservice.h
+++ b/src/plugins/gstreamer/camerabin/camerabinservice.h
@@ -93,7 +93,6 @@ private:
QGstreamerVideoWidgetControl *m_videoWidgetControl;
#endif
CameraBinImageCapture *m_imageCaptureControl;
- QMediaControl *m_cameraInfoControl;
CameraBinViewfinderSettings *m_viewfinderSettingsControl;
CameraBinViewfinderSettings2 *m_viewfinderSettingsControl2;
diff --git a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
index 4f45a0a2f..177e230b0 100644
--- a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
@@ -128,16 +128,6 @@ QVariant CameraBinServicePlugin::deviceProperty(const QByteArray &service, const
return QVariant();
}
-QCamera::Position CameraBinServicePlugin::cameraPosition(const QByteArray &deviceName) const
-{
- return QGstUtils::cameraPosition(deviceName, m_sourceFactory);
-}
-
-int CameraBinServicePlugin::cameraOrientation(const QByteArray &deviceName) const
-{
- return QGstUtils::cameraOrientation(deviceName, m_sourceFactory);
-}
-
GstElementFactory *CameraBinServicePlugin::sourceFactory() const
{
if (!m_sourceFactory) {
diff --git a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.h b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.h
index b31e44459..e16a0d9cc 100644
--- a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.h
+++ b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.h
@@ -53,13 +53,11 @@ class CameraBinServicePlugin
, public QMediaServiceSupportedDevicesInterface
, public QMediaServiceDefaultDeviceInterface
, public QMediaServiceFeaturesInterface
- , public QMediaServiceCameraInfoInterface
{
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
Q_INTERFACES(QMediaServiceFeaturesInterface)
- Q_INTERFACES(QMediaServiceCameraInfoInterface)
Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "camerabin.json")
public:
CameraBinServicePlugin();
@@ -75,9 +73,6 @@ public:
QString deviceDescription(const QByteArray &service, const QByteArray &device) override;
QVariant deviceProperty(const QByteArray &service, const QByteArray &device, const QByteArray &property);
- QCamera::Position cameraPosition(const QByteArray &device) const override;
- int cameraOrientation(const QByteArray &device) const override;
-
private:
GstElementFactory *sourceFactory() const;
diff --git a/src/plugins/qnx/camera/bbcamerainfocontrol.cpp b/src/plugins/qnx/camera/bbcamerainfocontrol.cpp
deleted file mode 100644
index 3d0481408..000000000
--- a/src/plugins/qnx/camera/bbcamerainfocontrol.cpp
+++ /dev/null
@@ -1,81 +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 "bbcamerainfocontrol.h"
-
-#include "bbcamerasession.h"
-
-QT_BEGIN_NAMESPACE
-
-BbCameraInfoControl::BbCameraInfoControl(QObject *parent)
- : QCameraInfoControl(parent)
-{
-}
-
-QCamera::Position BbCameraInfoControl::position(const QString &deviceName)
-{
- if (deviceName == QString::fromUtf8(BbCameraSession::cameraIdentifierFront()))
- return QCamera::FrontFace;
- else if (deviceName == QString::fromUtf8(BbCameraSession::cameraIdentifierRear()))
- return QCamera::BackFace;
- else
- return QCamera::UnspecifiedPosition;
-}
-
-int BbCameraInfoControl::orientation(const QString &deviceName)
-{
- // The camera sensor orientation could be retrieved with camera_get_native_orientation()
- // but since the sensor angular offset is compensated with camera_set_videovf_property() and
- // camera_set_photovf_property() we should always return 0 here.
- Q_UNUSED(deviceName);
- return 0;
-}
-
-QCamera::Position BbCameraInfoControl::cameraPosition(const QString &deviceName) const
-{
- return position(deviceName);
-}
-
-int BbCameraInfoControl::cameraOrientation(const QString &deviceName) const
-{
- return orientation(deviceName);
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/plugins/qnx/camera/bbcamerainfocontrol.h b/src/plugins/qnx/camera/bbcamerainfocontrol.h
deleted file mode 100644
index 1c51410f7..000000000
--- a/src/plugins/qnx/camera/bbcamerainfocontrol.h
+++ /dev/null
@@ -1,63 +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 BBCAMERAINFOCONTROL_H
-#define BBCAMERAINFOCONTROL_H
-
-#include <qcamerainfocontrol.h>
-
-QT_BEGIN_NAMESPACE
-
-class BbCameraInfoControl : public QCameraInfoControl
-{
- Q_OBJECT
-public:
- explicit BbCameraInfoControl(QObject *parent = 0);
-
- QCamera::Position cameraPosition(const QString &deviceName) const;
- int cameraOrientation(const QString &deviceName) const;
-
- static QCamera::Position position(const QString &deviceName);
- static int orientation(const QString &deviceName);
-};
-
-QT_END_NAMESPACE
-
-#endif // BBCAMERAINFOCONTROL_H
-
diff --git a/src/plugins/qnx/camera/bbcameraservice.cpp b/src/plugins/qnx/camera/bbcameraservice.cpp
index 2879f6981..74de23873 100644
--- a/src/plugins/qnx/camera/bbcameraservice.cpp
+++ b/src/plugins/qnx/camera/bbcameraservice.cpp
@@ -47,7 +47,6 @@
#include "bbcamerafocuscontrol.h"
#include "bbcameraimagecapturecontrol.h"
#include "bbcameraimageprocessingcontrol.h"
-#include "bbcamerainfocontrol.h"
#include "bbcameralockscontrol.h"
#include "bbcameramediarecordercontrol.h"
#include "bbcamerasession.h"
@@ -75,7 +74,6 @@ BbCameraService::BbCameraService(QObject *parent)
, m_cameraFocusControl(new BbCameraFocusControl(m_cameraSession, this))
, m_cameraImageCaptureControl(new BbCameraImageCaptureControl(m_cameraSession, this))
, m_cameraImageProcessingControl(new BbCameraImageProcessingControl(m_cameraSession, this))
- , m_cameraInfoControl(new BbCameraInfoControl(this))
, m_cameraLocksControl(new BbCameraLocksControl(m_cameraSession, this))
, m_cameraMediaRecorderControl(new BbCameraMediaRecorderControl(m_cameraSession, this))
, m_cameraVideoEncoderSettingsControl(new BbCameraVideoEncoderSettingsControl(m_cameraSession, this))
@@ -101,8 +99,6 @@ QMediaControl* BbCameraService::requestControl(const char *name)
return m_cameraCaptureDestinationControl;
else if (qstrcmp(name, QCameraControl_iid) == 0)
return m_cameraControl;
- else if (qstrcmp(name, QCameraInfoControl_iid) == 0)
- return m_cameraInfoControl;
else if (qstrcmp(name, QCameraExposureControl_iid) == 0)
return m_cameraExposureControl;
else if (qstrcmp(name, QCameraFlashControl_iid) == 0)
diff --git a/src/plugins/qnx/camera/bbcameraservice.h b/src/plugins/qnx/camera/bbcameraservice.h
index b13da6a4a..1ca4fd749 100644
--- a/src/plugins/qnx/camera/bbcameraservice.h
+++ b/src/plugins/qnx/camera/bbcameraservice.h
@@ -54,7 +54,6 @@ class BbCameraFlashControl;
class BbCameraFocusControl;
class BbCameraImageCaptureControl;
class BbCameraImageProcessingControl;
-class BbCameraInfoControl;
class BbCameraLocksControl;
class BbCameraMediaRecorderControl;
class BbCameraSession;
@@ -88,7 +87,6 @@ private:
BbCameraFocusControl* m_cameraFocusControl;
BbCameraImageCaptureControl* m_cameraImageCaptureControl;
BbCameraImageProcessingControl* m_cameraImageProcessingControl;
- BbCameraInfoControl* m_cameraInfoControl;
BbCameraLocksControl* m_cameraLocksControl;
BbCameraMediaRecorderControl* m_cameraMediaRecorderControl;
BbCameraVideoEncoderSettingsControl* m_cameraVideoEncoderSettingsControl;
diff --git a/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.cpp b/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.cpp
index fd7deb179..791c4af54 100644
--- a/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.cpp
+++ b/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.cpp
@@ -79,6 +79,21 @@ QString BbVideoDeviceSelectorControl::deviceDescription(int index) const
return m_descriptions.at(index);
}
+QCamera::Position BbVideoDeviceSelectorControl::cameraPosition(int index) const
+{
+ if (deviceName(index) == QString::fromUtf8(BbCameraSession::cameraIdentifierFront()))
+ return QCamera::FrontFace;
+ else if (deviceName(index) == QString::fromUtf8(BbCameraSession::cameraIdentifierRear()))
+ return QCamera::BackFace;
+ else
+ return QCamera::UnspecifiedPosition;
+}
+
+int BbVideoDeviceSelectorControl::cameraOrientation(int index) const
+{
+ return 0;
+}
+
int BbVideoDeviceSelectorControl::defaultDevice() const
{
return m_default;
diff --git a/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.h b/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.h
index 08d6cbb14..fdaa7fc0d 100644
--- a/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.h
+++ b/src/plugins/qnx/camera/bbvideodeviceselectorcontrol.h
@@ -55,6 +55,9 @@ public:
int deviceCount() const override;
QString deviceName(int index) const override;
QString deviceDescription(int index) const override;
+ QCamera::Position cameraPosition(int index) const;
+ int cameraOrientation(int index) const;
+
int defaultDevice() const override;
int selectedDevice() const override;
diff --git a/src/plugins/qnx/camera/camera.pri b/src/plugins/qnx/camera/camera.pri
index 886351862..38d32a379 100644
--- a/src/plugins/qnx/camera/camera.pri
+++ b/src/plugins/qnx/camera/camera.pri
@@ -10,7 +10,6 @@ HEADERS += \
$$PWD/bbcamerafocuscontrol.h \
$$PWD/bbcameraimagecapturecontrol.h \
$$PWD/bbcameraimageprocessingcontrol.h \
- $$PWD/bbcamerainfocontrol.h \
$$PWD/bbcameralockscontrol.h \
$$PWD/bbcameramediarecordercontrol.h \
$$PWD/bbcameraorientationhandler.h \
@@ -34,7 +33,6 @@ SOURCES += \
$$PWD/bbcamerafocuscontrol.cpp \
$$PWD/bbcameraimagecapturecontrol.cpp \
$$PWD/bbcameraimageprocessingcontrol.cpp \
- $$PWD/bbcamerainfocontrol.cpp \
$$PWD/bbcameralockscontrol.cpp \
$$PWD/bbcameramediarecordercontrol.cpp \
$$PWD/bbcameraorientationhandler.cpp \
diff --git a/tests/auto/unit/qcamera/CMakeLists.txt b/tests/auto/unit/qcamera/CMakeLists.txt
index c79c8e3d5..6eecf7997 100644
--- a/tests/auto/unit/qcamera/CMakeLists.txt
+++ b/tests/auto/unit/qcamera/CMakeLists.txt
@@ -14,7 +14,6 @@ qt_add_test(tst_qcamera
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
- ../qmultimedia_common/mockcamerainfocontrol.h
../qmultimedia_common/mockcameralockscontrol.h
../qmultimedia_common/mockcameraservice.h
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qcameraimagecapture/CMakeLists.txt b/tests/auto/unit/qcameraimagecapture/CMakeLists.txt
index 9aadd38cc..247768b9d 100644
--- a/tests/auto/unit/qcameraimagecapture/CMakeLists.txt
+++ b/tests/auto/unit/qcameraimagecapture/CMakeLists.txt
@@ -14,7 +14,6 @@ qt_add_test(tst_qcameraimagecapture
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
- ../qmultimedia_common/mockcamerainfocontrol.h
../qmultimedia_common/mockcameralockscontrol.h
../qmultimedia_common/mockcameraservice.h
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qcamerainfo/CMakeLists.txt b/tests/auto/unit/qcamerainfo/CMakeLists.txt
index 5383e5e59..b2ddf0c4f 100644
--- a/tests/auto/unit/qcamerainfo/CMakeLists.txt
+++ b/tests/auto/unit/qcamerainfo/CMakeLists.txt
@@ -14,7 +14,6 @@ qt_add_test(tst_qcamerainfo
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
- ../qmultimedia_common/mockcamerainfocontrol.h
../qmultimedia_common/mockcameralockscontrol.h
../qmultimedia_common/mockcameraservice.h
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qcameraviewfinder/CMakeLists.txt b/tests/auto/unit/qcameraviewfinder/CMakeLists.txt
index e171c041f..93422349a 100644
--- a/tests/auto/unit/qcameraviewfinder/CMakeLists.txt
+++ b/tests/auto/unit/qcameraviewfinder/CMakeLists.txt
@@ -14,7 +14,6 @@ qt_add_test(tst_qcameraviewfinder
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
- ../qmultimedia_common/mockcamerainfocontrol.h
../qmultimedia_common/mockcameralockscontrol.h
../qmultimedia_common/mockcameraservice.h
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qcamerawidgets/CMakeLists.txt b/tests/auto/unit/qcamerawidgets/CMakeLists.txt
index 574d62e95..c217a0f96 100644
--- a/tests/auto/unit/qcamerawidgets/CMakeLists.txt
+++ b/tests/auto/unit/qcamerawidgets/CMakeLists.txt
@@ -14,7 +14,6 @@ qt_add_test(tst_qcamerawidgets
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
- ../qmultimedia_common/mockcamerainfocontrol.h
../qmultimedia_common/mockcameralockscontrol.h
../qmultimedia_common/mockcameraservice.h
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qdeclarativecamera/CMakeLists.txt b/tests/auto/unit/qdeclarativecamera/CMakeLists.txt
index eefbce755..b2d070182 100644
--- a/tests/auto/unit/qdeclarativecamera/CMakeLists.txt
+++ b/tests/auto/unit/qdeclarativecamera/CMakeLists.txt
@@ -16,7 +16,6 @@ qt_add_test(tst_qdeclarativecamera
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
- ../qmultimedia_common/mockcamerainfocontrol.h
../qmultimedia_common/mockcameralockscontrol.h
../qmultimedia_common/mockcameraservice.h
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt b/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt
index 3ae6c96f2..4dd73b6b3 100644
--- a/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt
+++ b/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt
@@ -16,7 +16,6 @@ qt_add_test(tst_qdeclarativemultimediaglobal
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
- ../qmultimedia_common/mockcamerainfocontrol.h
../qmultimedia_common/mockcameralockscontrol.h
../qmultimedia_common/mockcameraservice.h
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp
index 2b50392b7..25c34729d 100644
--- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp
+++ b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp
@@ -32,13 +32,11 @@
class MockServicePlugin3 : public QMediaServiceProviderPlugin,
public QMediaServiceSupportedDevicesInterface,
- public QMediaServiceDefaultDeviceInterface,
- public QMediaServiceCameraInfoInterface
+ public QMediaServiceDefaultDeviceInterface
{
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
- Q_INTERFACES(QMediaServiceCameraInfoInterface)
Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "mockserviceplugin3.json")
public:
QStringList keys() const
@@ -92,22 +90,6 @@ public:
else
return QString();
}
-
- QCamera::Position cameraPosition(const QByteArray &device) const
- {
- if (device == "frontcamera")
- return QCamera::FrontFace;
-
- return QCamera::UnspecifiedPosition;
- }
-
- int cameraOrientation(const QByteArray &device) const
- {
- if (device == "frontcamera")
- return 270;
-
- return 0;
- }
};
#include "mockserviceplugin3.moc"
diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp
index 5340a055d..8e8fd85f9 100644
--- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp
+++ b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp
@@ -32,13 +32,11 @@
class MockServicePlugin5 : public QMediaServiceProviderPlugin,
public QMediaServiceSupportedDevicesInterface,
- public QMediaServiceDefaultDeviceInterface,
- public QMediaServiceCameraInfoInterface
+ public QMediaServiceDefaultDeviceInterface
{
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
- Q_INTERFACES(QMediaServiceCameraInfoInterface)
Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "mockserviceplugin5.json")
public:
QStringList keys() const
@@ -83,22 +81,6 @@ public:
else
return QString();
}
-
- QCamera::Position cameraPosition(const QByteArray &device) const
- {
- if (device == "backcamera")
- return QCamera::BackFace;
-
- return QCamera::UnspecifiedPosition;
- }
-
- int cameraOrientation(const QByteArray &device) const
- {
- if (device == "backcamera")
- return 90;
-
- return 0;
- }
};
#include "mockserviceplugin5.moc"
diff --git a/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp b/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp
index e4bb719e6..f461e710b 100644
--- a/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp
+++ b/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp
@@ -189,7 +189,6 @@ void tst_QMediaServiceProvider::testProviderHints()
QVERIFY(hint.isNull());
QCOMPARE(hint.type(), QMediaServiceProviderHint::Null);
QVERIFY(hint.device().isEmpty());
- QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition);
QVERIFY(hint.mimeType().isEmpty());
QVERIFY(hint.codecs().isEmpty());
QCOMPARE(hint.features(), 0);
@@ -201,18 +200,6 @@ void tst_QMediaServiceProvider::testProviderHints()
QVERIFY(!hint.isNull());
QCOMPARE(hint.type(), QMediaServiceProviderHint::Device);
QCOMPARE(hint.device(), deviceName);
- QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition);
- QVERIFY(hint.mimeType().isEmpty());
- QVERIFY(hint.codecs().isEmpty());
- QCOMPARE(hint.features(), 0);
- }
-
- {
- QMediaServiceProviderHint hint(QCamera::FrontFace);
- QVERIFY(!hint.isNull());
- QCOMPARE(hint.type(), QMediaServiceProviderHint::CameraPosition);
- QVERIFY(hint.device().isEmpty());
- QCOMPARE(hint.cameraPosition(), QCamera::FrontFace);
QVERIFY(hint.mimeType().isEmpty());
QVERIFY(hint.codecs().isEmpty());
QCOMPARE(hint.features(), 0);
@@ -223,7 +210,6 @@ void tst_QMediaServiceProvider::testProviderHints()
QVERIFY(!hint.isNull());
QCOMPARE(hint.type(), QMediaServiceProviderHint::SupportedFeatures);
QVERIFY(hint.device().isEmpty());
- QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition);
QVERIFY(hint.mimeType().isEmpty());
QVERIFY(hint.codecs().isEmpty());
QCOMPARE(hint.features(), QMediaServiceProviderHint::LowLatencyPlayback);
@@ -234,7 +220,6 @@ void tst_QMediaServiceProvider::testProviderHints()
QVERIFY(!hint.isNull());
QCOMPARE(hint.type(), QMediaServiceProviderHint::SupportedFeatures);
QVERIFY(hint.device().isEmpty());
- QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition);
QVERIFY(hint.mimeType().isEmpty());
QVERIFY(hint.codecs().isEmpty());
QCOMPARE(hint.features(), QMediaServiceProviderHint::RecordingSupport);
@@ -249,7 +234,6 @@ void tst_QMediaServiceProvider::testProviderHints()
QVERIFY(!hint.isNull());
QCOMPARE(hint.type(), QMediaServiceProviderHint::ContentType);
QVERIFY(hint.device().isEmpty());
- QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition);
QCOMPARE(hint.mimeType(), mimeType);
QCOMPARE(hint.codecs(), codecs);
@@ -258,7 +242,6 @@ void tst_QMediaServiceProvider::testProviderHints()
QVERIFY(!hint2.isNull());
QCOMPARE(hint2.type(), QMediaServiceProviderHint::ContentType);
QVERIFY(hint2.device().isEmpty());
- QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition);
QCOMPARE(hint2.mimeType(), mimeType);
QCOMPARE(hint2.codecs(), codecs);
@@ -268,7 +251,6 @@ void tst_QMediaServiceProvider::testProviderHints()
QVERIFY(!hint3.isNull());
QCOMPARE(hint3.type(), QMediaServiceProviderHint::ContentType);
QVERIFY(hint3.device().isEmpty());
- QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition);
QCOMPARE(hint3.mimeType(), mimeType);
QCOMPARE(hint3.codecs(), codecs);
diff --git a/tests/auto/unit/qmultimedia_common/mockcamera.pri b/tests/auto/unit/qmultimedia_common/mockcamera.pri
index f6f97de1e..2c59aa8c5 100644
--- a/tests/auto/unit/qmultimedia_common/mockcamera.pri
+++ b/tests/auto/unit/qmultimedia_common/mockcamera.pri
@@ -18,7 +18,6 @@ HEADERS *= \
../qmultimedia_common/mockimageencodercontrol.h \
../qmultimedia_common/mockcameracontrol.h \
../qmultimedia_common/mockvideodeviceselectorcontrol.h \
- ../qmultimedia_common/mockcamerainfocontrol.h \
../qmultimedia_common/mockcameraviewfindersettingscontrol.h
diff --git a/tests/auto/unit/qmultimedia_common/mockcamerainfocontrol.h b/tests/auto/unit/qmultimedia_common/mockcamerainfocontrol.h
deleted file mode 100644
index 359bb7a5c..000000000
--- a/tests/auto/unit/qmultimedia_common/mockcamerainfocontrol.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** 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 General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** 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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MOCKCAMERAINFOCONTROL_H
-#define MOCKCAMERAINFOCONTROL_H
-
-#include <qcamerainfocontrol.h>
-
-class MockCameraInfoControl : public QCameraInfoControl
-{
- Q_OBJECT
-public:
- MockCameraInfoControl(QObject *parent)
- : QCameraInfoControl(parent)
- {
- }
-
- ~MockCameraInfoControl() { }
-
- QCamera::Position cameraPosition(const QString &deviceName) const
- {
- return position(deviceName.toLatin1());
- }
-
- int cameraOrientation(const QString &deviceName) const
- {
- return orientation(deviceName.toLatin1());
- }
-
- static QCamera::Position position(const QByteArray &camera)
- {
- if (camera == "backcamera")
- return QCamera::BackFace;
- else
- return QCamera::UnspecifiedPosition;
- }
-
- static int orientation(const QByteArray &camera)
- {
- if (camera == "backcamera")
- return 90;
- else
- return 0;
- }
-};
-
-#endif // MOCKCAMERAINFOCONTROL_H
diff --git a/tests/auto/unit/qmultimedia_common/mockcameraservice.h b/tests/auto/unit/qmultimedia_common/mockcameraservice.h
index d6612ddc3..432e04d81 100644
--- a/tests/auto/unit/qmultimedia_common/mockcameraservice.h
+++ b/tests/auto/unit/qmultimedia_common/mockcameraservice.h
@@ -45,7 +45,6 @@
#include "../qmultimedia_common/mockvideorenderercontrol.h"
#include "../qmultimedia_common/mockvideowindowcontrol.h"
#include "../qmultimedia_common/mockvideodeviceselectorcontrol.h"
-#include "../qmultimedia_common/mockcamerainfocontrol.h"
#include "../qmultimedia_common/mockcameraviewfindersettingscontrol.h"
class MockSimpleCameraService : public QMediaService
@@ -96,7 +95,6 @@ public:
rendererControl = new MockVideoRendererControl(this);
windowControl = new MockVideoWindowControl(this);
mockVideoDeviceSelectorControl = new MockVideoDeviceSelectorControl(this);
- mockCameraInfoControl = new MockCameraInfoControl(this);
mockViewfinderSettingsControl = new MockCameraViewfinderSettingsControl(this);
rendererRef = 0;
windowRef = 0;
@@ -144,9 +142,6 @@ public:
if (qstrcmp(iid, QVideoDeviceSelectorControl_iid) == 0)
return mockVideoDeviceSelectorControl;
- if (qstrcmp(iid, QCameraInfoControl_iid) == 0)
- return mockCameraInfoControl;
-
if (qstrcmp(iid, QVideoRendererControl_iid) == 0) {
if (rendererRef == 0) {
rendererRef += 1;
@@ -189,7 +184,6 @@ public:
MockVideoRendererControl *rendererControl;
MockVideoWindowControl *windowControl;
MockVideoDeviceSelectorControl *mockVideoDeviceSelectorControl;
- MockCameraInfoControl *mockCameraInfoControl;
MockCameraViewfinderSettingsControl *mockViewfinderSettingsControl;
int rendererRef;
int windowRef;
diff --git a/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h b/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
index 49f945cd6..f533e03f6 100644
--- a/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
+++ b/tests/auto/unit/qmultimedia_common/mockmediaserviceprovider.h
@@ -32,7 +32,6 @@
#include "qmediaserviceprovider_p.h"
#include "qmediaservice.h"
#include "mockvideodeviceselectorcontrol.h"
-#include "mockcamerainfocontrol.h"
// Simple provider that lets you set the service
class MockMediaServiceProvider : public QMediaServiceProvider
@@ -90,16 +89,6 @@ public:
return QString();
}
- QCamera::Position cameraPosition(const QByteArray &device) const
- {
- return MockCameraInfoControl::position(device);
- }
-
- int cameraOrientation(const QByteArray &device) const
- {
- return MockCameraInfoControl::orientation(device);
- }
-
QMediaService *service;
bool deleteServiceOnRelease;
QMediaServiceProviderHint::Features features;
diff --git a/tests/auto/unit/qmultimedia_common/mockvideodeviceselectorcontrol.h b/tests/auto/unit/qmultimedia_common/mockvideodeviceselectorcontrol.h
index b391a282d..764c062b9 100644
--- a/tests/auto/unit/qmultimedia_common/mockvideodeviceselectorcontrol.h
+++ b/tests/auto/unit/qmultimedia_common/mockvideodeviceselectorcontrol.h
@@ -47,6 +47,20 @@ public:
QString deviceName(int index) const { return QString::fromLatin1(availableCameras().at(index)); }
QString deviceDescription(int index) const { return cameraDescription(availableCameras().at(index)); }
+ QCamera::Position cameraPosition(int index) const
+ {
+ if (deviceName(index) == "backcamera")
+ return QCamera::BackFace;
+ else
+ return QCamera::UnspecifiedPosition;
+ }
+ int cameraOrientation(int index) const
+ {
+ if (deviceName(index) == "backcamera")
+ return 90;
+ else
+ return 0;
+ }
int defaultDevice() const { return availableCameras().indexOf(defaultCamera()); }
int selectedDevice() const { return m_selectedDevice; }