diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-01-04 09:31:49 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-01-21 19:56:38 +0000 |
commit | f8f33da7964977e30f8d2a3439a9058ba21bc798 (patch) | |
tree | d96edb4f609e491fd5933fa84b41ca58c1aca61e /src/plugins/gstreamer | |
parent | 4f7daef43da220869475d085ec2fb68083d53696 (diff) |
Merge the viewfindersettingscontrol into QCameraControl
Change-Id: I6410cc5fa9e787454a3ed61723b26238012aea6e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/plugins/gstreamer')
8 files changed, 21 insertions, 156 deletions
diff --git a/src/plugins/gstreamer/camerabin/CMakeLists.txt b/src/plugins/gstreamer/camerabin/CMakeLists.txt index c7f4b0d10..9584979b3 100644 --- a/src/plugins/gstreamer/camerabin/CMakeLists.txt +++ b/src/plugins/gstreamer/camerabin/CMakeLists.txt @@ -22,8 +22,6 @@ qt_internal_add_plugin(CameraBinServicePlugin camerabinserviceplugin.cpp camerabinserviceplugin.h camerabinsession.cpp camerabinsession.h camerabinvideoencoder.cpp camerabinvideoencoder.h - camerabinviewfindersettings.cpp camerabinviewfindersettings.h - camerabinviewfindersettings2.cpp camerabinviewfindersettings2.h camerabinzoom.cpp camerabinzoom.h INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/plugins/gstreamer/camerabin/camerabin.pro b/src/plugins/gstreamer/camerabin/camerabin.pro index ac1b6e28a..8f354d799 100644 --- a/src/plugins/gstreamer/camerabin/camerabin.pro +++ b/src/plugins/gstreamer/camerabin/camerabin.pro @@ -24,7 +24,6 @@ HEADERS += \ $$PWD/camerabinmetadata.h \ $$PWD/camerabinvideoencoder.h \ $$PWD/camerabincapturebufferformat.h \ - $$PWD/camerabinviewfindersettings.h \ SOURCES += \ $$PWD/camerabinserviceplugin.cpp \ @@ -39,7 +38,6 @@ SOURCES += \ $$PWD/camerabinmetadata.cpp \ $$PWD/camerabinrecorder.cpp \ $$PWD/camerabinvideoencoder.cpp \ - $$PWD/camerabinviewfindersettings.cpp \ $$PWD/camerabincapturebufferformat.cpp \ qtConfig(gstreamer_photography) { diff --git a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp index 4b9708725..a02e9ab72 100644 --- a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp +++ b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp @@ -414,4 +414,19 @@ void CameraBinControl::unlockWhiteBalance( emit lockStatusChanged(QCamera::LockWhiteBalance, status, reason); } +QList<QCameraViewfinderSettings> CameraBinControl::supportedViewfinderSettings() const +{ + return m_session->supportedViewfinderSettings(); +} + +QCameraViewfinderSettings CameraBinControl::viewfinderSettings() const +{ + return m_session->viewfinderSettings(); +} + +void CameraBinControl::setViewfinderSettings(const QCameraViewfinderSettings &settings) +{ + m_session->setViewfinderSettings(settings); +} + QT_END_NAMESPACE diff --git a/src/plugins/gstreamer/camerabin/camerabincontrol.h b/src/plugins/gstreamer/camerabin/camerabincontrol.h index 4b72e3d14..20039bb72 100644 --- a/src/plugins/gstreamer/camerabin/camerabincontrol.h +++ b/src/plugins/gstreamer/camerabin/camerabincontrol.h @@ -77,6 +77,11 @@ public: void searchAndLock(QCamera::LockTypes locks) override; void unlock(QCamera::LockTypes locks) override; + QList<QCameraViewfinderSettings> supportedViewfinderSettings() const override; + + QCameraViewfinderSettings viewfinderSettings() const override; + void setViewfinderSettings(const QCameraViewfinderSettings &settings) override; + public slots: void reloadLater(); void setViewfinderColorSpaceConversion(bool enabled); diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp index bad3d6151..1006c4ce7 100644 --- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp @@ -56,7 +56,6 @@ #include "camerabinimagecapture.h" #include "camerabinimageprocessing.h" #include "camerabincapturebufferformat.h" -#include "camerabinviewfindersettings.h" #include <private/qgstreamerbushelper_p.h> #include <private/qgstutils_p.h> @@ -75,8 +74,7 @@ QT_BEGIN_NAMESPACE CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *parent) - : QMediaService(parent), - m_viewfinderSettingsControl(0) + : QMediaService(parent) { m_captureSession = 0; m_metaDataControl = 0; @@ -208,12 +206,6 @@ QObject *CameraBinService::requestControl(const char *name) if (qstrcmp(name, QCameraCaptureBufferFormatControl_iid) == 0) return m_captureSession->captureBufferFormatControl(); - if (qstrcmp(name, QCameraViewfinderSettingsControl_iid) == 0) { - if (!m_viewfinderSettingsControl) - m_viewfinderSettingsControl = new CameraBinViewfinderSettings(m_captureSession); - return m_viewfinderSettingsControl; - } - return 0; } diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.h b/src/plugins/gstreamer/camerabin/camerabinservice.h index 153b487a8..0fae02121 100644 --- a/src/plugins/gstreamer/camerabin/camerabinservice.h +++ b/src/plugins/gstreamer/camerabin/camerabinservice.h @@ -60,7 +60,6 @@ class QGstreamerElementFactory; class CameraBinMetaData; class CameraBinImageCapture; class CameraBinMetaData; -class CameraBinViewfinderSettings; class CameraBinService : public QMediaService { @@ -92,8 +91,6 @@ private: QGstreamerVideoWidgetControl *m_videoWidgetControl; #endif CameraBinImageCapture *m_imageCaptureControl; - - CameraBinViewfinderSettings *m_viewfinderSettingsControl; }; QT_END_NAMESPACE diff --git a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.cpp b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.cpp deleted file mode 100644 index eb7d73062..000000000 --- a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.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 "camerabinviewfindersettings.h" -#include "camerabinsession.h" - -QT_BEGIN_NAMESPACE - -CameraBinViewfinderSettings::CameraBinViewfinderSettings(CameraBinSession *session) - : QCameraViewfinderSettingsControl(session) - , m_session(session) -{ - -} - -CameraBinViewfinderSettings::~CameraBinViewfinderSettings() -{ - -} - -QList<QCameraViewfinderSettings> CameraBinViewfinderSettings::supportedViewfinderSettings() const -{ - return m_session->supportedViewfinderSettings(); -} - -QCameraViewfinderSettings CameraBinViewfinderSettings::viewfinderSettings() const -{ - return m_session->viewfinderSettings(); -} - -void CameraBinViewfinderSettings::setViewfinderSettings(const QCameraViewfinderSettings &settings) -{ - m_session->setViewfinderSettings(settings); -} - -QT_END_NAMESPACE - diff --git a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.h b/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.h deleted file mode 100644 index 38b119778..000000000 --- a/src/plugins/gstreamer/camerabin/camerabinviewfindersettings.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 CAMERABINVIEWFINDERSETTINGS_H -#define CAMERABINVIEWFINDERSETTINGS_H - -#include <qcameraviewfindersettingscontrol.h> - -QT_BEGIN_NAMESPACE - -class CameraBinSession; - -class CameraBinViewfinderSettings : public QCameraViewfinderSettingsControl -{ - Q_OBJECT -public: - CameraBinViewfinderSettings(CameraBinSession *session); - ~CameraBinViewfinderSettings(); - - QList<QCameraViewfinderSettings> supportedViewfinderSettings() const override; - - QCameraViewfinderSettings viewfinderSettings() const override; - void setViewfinderSettings(const QCameraViewfinderSettings &settings) override; - -private: - CameraBinSession *m_session; -}; - -QT_END_NAMESPACE - -#endif // CAMERABINVIEWFINDERSETTINGS_H |