summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-12-23 11:49:42 +0100
committerLars Knoll <lars.knoll@qt.io>2021-01-21 19:56:31 +0000
commit4f7daef43da220869475d085ec2fb68083d53696 (patch)
tree12efb8a18fcd9d3cf43b1ca86581b868da746917 /src/plugins/gstreamer
parenta9428fd087035e2f80c8f1230917d12b3d20be4c (diff)
Get rid of the old viewfindersettings backend interface
Change-Id: Id7b82b445ac528a30dd67ead01ffa73af298d3d3 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/plugins/gstreamer')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabin.pro4
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinservice.cpp14
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinservice.h2
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp1
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.h1
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinviewfindersettings.cpp61
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinviewfindersettings.h10
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.cpp73
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.h67
9 files changed, 17 insertions, 216 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabin.pro b/src/plugins/gstreamer/camerabin/camerabin.pro
index ed47ec9c0..ac1b6e28a 100644
--- a/src/plugins/gstreamer/camerabin/camerabin.pro
+++ b/src/plugins/gstreamer/camerabin/camerabin.pro
@@ -25,7 +25,6 @@ HEADERS += \
$$PWD/camerabinvideoencoder.h \
$$PWD/camerabincapturebufferformat.h \
$$PWD/camerabinviewfindersettings.h \
- $$PWD/camerabinviewfindersettings2.h \
SOURCES += \
$$PWD/camerabinserviceplugin.cpp \
@@ -41,8 +40,7 @@ SOURCES += \
$$PWD/camerabinrecorder.cpp \
$$PWD/camerabinvideoencoder.cpp \
$$PWD/camerabinviewfindersettings.cpp \
- $$PWD/camerabinviewfindersettings2.cpp \
- $$PWD/camerabincapturebufferformat.cpp \
+ $$PWD/camerabincapturebufferformat.cpp \
qtConfig(gstreamer_photography) {
HEADERS += \
diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp
index 7b7ae5bbd..bad3d6151 100644
--- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp
@@ -57,7 +57,6 @@
#include "camerabinimageprocessing.h"
#include "camerabincapturebufferformat.h"
#include "camerabinviewfindersettings.h"
-#include "camerabinviewfindersettings2.h"
#include <private/qgstreamerbushelper_p.h>
#include <private/qgstutils_p.h>
@@ -75,10 +74,9 @@
QT_BEGIN_NAMESPACE
-CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *parent):
- QMediaService(parent),
- m_viewfinderSettingsControl(0),
- m_viewfinderSettingsControl2(0)
+CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *parent)
+ : QMediaService(parent),
+ m_viewfinderSettingsControl(0)
{
m_captureSession = 0;
m_metaDataControl = 0;
@@ -216,12 +214,6 @@ QObject *CameraBinService::requestControl(const char *name)
return m_viewfinderSettingsControl;
}
- if (qstrcmp(name, QCameraViewfinderSettingsControl2_iid) == 0) {
- if (!m_viewfinderSettingsControl2)
- m_viewfinderSettingsControl2 = new CameraBinViewfinderSettings2(m_captureSession);
- return m_viewfinderSettingsControl2;
- }
-
return 0;
}
diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.h b/src/plugins/gstreamer/camerabin/camerabinservice.h
index 1651c47db..153b487a8 100644
--- a/src/plugins/gstreamer/camerabin/camerabinservice.h
+++ b/src/plugins/gstreamer/camerabin/camerabinservice.h
@@ -61,7 +61,6 @@ class CameraBinMetaData;
class CameraBinImageCapture;
class CameraBinMetaData;
class CameraBinViewfinderSettings;
-class CameraBinViewfinderSettings2;
class CameraBinService : public QMediaService
{
@@ -95,7 +94,6 @@ private:
CameraBinImageCapture *m_imageCaptureControl;
CameraBinViewfinderSettings *m_viewfinderSettingsControl;
- CameraBinViewfinderSettings2 *m_viewfinderSettingsControl2;
};
QT_END_NAMESPACE
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
index 39a552ae8..88fde5d9e 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
@@ -52,7 +52,6 @@
#endif
#include "camerabinimageprocessing.h"
-#include "camerabinviewfindersettings.h"
#include "camerabincapturebufferformat.h"
#include <private/qgstreamerbushelper_p.h>
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.h b/src/plugins/gstreamer/camerabin/camerabinsession.h
index 5c528a1e2..50f97f3db 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.h
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.h
@@ -75,7 +75,6 @@ class CameraBinZoom;
class CameraBinCaptureDestination;
class CameraBinCaptureBufferFormat;
class QGstreamerVideoRendererInterface;
-class CameraBinViewfinderSettings;
class QGstreamerElementFactory
{
diff --git a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.cpp b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.cpp
index 0e14a15e5..eb7d73062 100644
--- a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.cpp
@@ -1,6 +1,5 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
@@ -38,81 +37,37 @@
**
****************************************************************************/
-
#include "camerabinviewfindersettings.h"
#include "camerabinsession.h"
QT_BEGIN_NAMESPACE
-
CameraBinViewfinderSettings::CameraBinViewfinderSettings(CameraBinSession *session)
: QCameraViewfinderSettingsControl(session)
, m_session(session)
{
+
}
CameraBinViewfinderSettings::~CameraBinViewfinderSettings()
{
+
}
-bool CameraBinViewfinderSettings::isViewfinderParameterSupported(ViewfinderParameter parameter) const
+QList<QCameraViewfinderSettings> CameraBinViewfinderSettings::supportedViewfinderSettings() const
{
- switch (parameter) {
- case Resolution:
- case PixelAspectRatio:
- case MinimumFrameRate:
- case MaximumFrameRate:
- case PixelFormat:
- return true;
- case UserParameter:
- return false;
- }
- return false;
+ return m_session->supportedViewfinderSettings();
}
-QVariant CameraBinViewfinderSettings::viewfinderParameter(ViewfinderParameter parameter) const
+QCameraViewfinderSettings CameraBinViewfinderSettings::viewfinderSettings() const
{
- switch (parameter) {
- case Resolution:
- return m_session->viewfinderSettings().resolution();
- case PixelAspectRatio:
- return m_session->viewfinderSettings().pixelAspectRatio();
- case MinimumFrameRate:
- return m_session->viewfinderSettings().minimumFrameRate();
- case MaximumFrameRate:
- return m_session->viewfinderSettings().maximumFrameRate();
- case PixelFormat:
- return m_session->viewfinderSettings().pixelFormat();
- case UserParameter:
- return QVariant();
- }
- return false;
+ return m_session->viewfinderSettings();
}
-void CameraBinViewfinderSettings::setViewfinderParameter(ViewfinderParameter parameter, const QVariant &value)
+void CameraBinViewfinderSettings::setViewfinderSettings(const QCameraViewfinderSettings &settings)
{
- QCameraViewfinderSettings settings = m_session->viewfinderSettings();
-
- switch (parameter) {
- case Resolution:
- settings.setResolution(value.toSize());
- break;
- case PixelAspectRatio:
- settings.setPixelAspectRatio(value.toSize());
- break;
- case MinimumFrameRate:
- settings.setMinimumFrameRate(value.toReal());
- break;
- case MaximumFrameRate:
- settings.setMaximumFrameRate(value.toReal());
- break;
- case PixelFormat:
- settings.setPixelFormat(qvariant_cast<QVideoFrame::PixelFormat>(value));
- case UserParameter:
- break;
- }
-
m_session->setViewfinderSettings(settings);
}
QT_END_NAMESPACE
+
diff --git a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.h b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.h
index 59a0ca8a9..38b119778 100644
--- a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.h
+++ b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.h
@@ -1,6 +1,5 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
@@ -54,9 +53,10 @@ public:
CameraBinViewfinderSettings(CameraBinSession *session);
~CameraBinViewfinderSettings();
- bool isViewfinderParameterSupported(ViewfinderParameter parameter) const override;
- QVariant viewfinderParameter(ViewfinderParameter parameter) const override;
- void setViewfinderParameter(ViewfinderParameter parameter, const QVariant &value) override;
+ QList<QCameraViewfinderSettings> supportedViewfinderSettings() const override;
+
+ QCameraViewfinderSettings viewfinderSettings() const override;
+ void setViewfinderSettings(const QCameraViewfinderSettings &settings) override;
private:
CameraBinSession *m_session;
@@ -64,4 +64,4 @@ private:
QT_END_NAMESPACE
-#endif
+#endif // CAMERABINVIEWFINDERSETTINGS_H
diff --git a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.cpp b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.cpp
deleted file mode 100644
index a7199216e..000000000
--- a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.cpp
+++ /dev/null
@@ -1,73 +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 "camerabinviewfindersettings2.h"
-#include "camerabinsession.h"
-
-QT_BEGIN_NAMESPACE
-
-CameraBinViewfinderSettings2::CameraBinViewfinderSettings2(CameraBinSession *session)
- : QCameraViewfinderSettingsControl2(session)
- , m_session(session)
-{
-
-}
-
-CameraBinViewfinderSettings2::~CameraBinViewfinderSettings2()
-{
-
-}
-
-QList<QCameraViewfinderSettings> CameraBinViewfinderSettings2::supportedViewfinderSettings() const
-{
- return m_session->supportedViewfinderSettings();
-}
-
-QCameraViewfinderSettings CameraBinViewfinderSettings2::viewfinderSettings() const
-{
- return m_session->viewfinderSettings();
-}
-
-void CameraBinViewfinderSettings2::setViewfinderSettings(const QCameraViewfinderSettings &settings)
-{
- m_session->setViewfinderSettings(settings);
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.h b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.h
deleted file mode 100644
index 5e03b007a..000000000
--- a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings2.h
+++ /dev/null
@@ -1,67 +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 CAMERABINVIEWFINDERSETTINGS2_H
-#define CAMERABINVIEWFINDERSETTINGS2_H
-
-#include <qcameraviewfindersettingscontrol.h>
-
-QT_BEGIN_NAMESPACE
-
-class CameraBinSession;
-
-class CameraBinViewfinderSettings2 : public QCameraViewfinderSettingsControl2
-{
- Q_OBJECT
-public:
- CameraBinViewfinderSettings2(CameraBinSession *session);
- ~CameraBinViewfinderSettings2();
-
- QList<QCameraViewfinderSettings> supportedViewfinderSettings() const override;
-
- QCameraViewfinderSettings viewfinderSettings() const override;
- void setViewfinderSettings(const QCameraViewfinderSettings &settings) override;
-
-private:
- CameraBinSession *m_session;
-};
-
-QT_END_NAMESPACE
-
-#endif // CAMERABINVIEWFINDERSETTINGS2_H