diff options
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinservice.cpp')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinservice.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp index e4aa594d5..25fd44817 100644 --- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -55,12 +55,13 @@ #include "camerabincapturebufferformat.h" #include "camerabincapturedestination.h" #include "camerabinviewfindersettings.h" +#include "camerabinviewfindersettings2.h" #include <private/qgstreamerbushelper_p.h> +#include <private/qgstutils_p.h> #include <private/qgstreameraudioinputselector_p.h> #include <private/qgstreamervideoinputdevicecontrol_p.h> - #if defined(HAVE_WIDGETS) #include <private/qgstreamervideowidget_p.h> #endif @@ -84,7 +85,9 @@ QT_BEGIN_NAMESPACE CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *parent): QMediaService(parent), - m_cameraInfoControl(0) + m_cameraInfoControl(0), + m_viewfinderSettingsControl(0), + m_viewfinderSettingsControl2(0) { m_captureSession = 0; m_metaDataControl = 0; @@ -127,7 +130,6 @@ CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *pa delete m_videoWindow; m_videoWindow = 0; } - #if defined(HAVE_WIDGETS) m_videoWidgetControl = new QGstreamerVideoWidgetControl(this); @@ -164,8 +166,6 @@ QMediaControl *CameraBinService::requestControl(const char *name) if (!m_captureSession) return 0; - //qDebug() << "Request control" << name; - if (!m_videoOutput) { if (qstrcmp(name, QVideoRendererControl_iid) == 0) { m_videoOutput = m_videoRenderer; @@ -241,8 +241,17 @@ QMediaControl *CameraBinService::requestControl(const char *name) if (qstrcmp(name, QCameraCaptureBufferFormatControl_iid) == 0) return m_captureSession->captureBufferFormatControl(); - if (qstrcmp(name, QCameraViewfinderSettingsControl_iid) == 0) - return m_captureSession->viewfinderSettingsControl(); + if (qstrcmp(name, QCameraViewfinderSettingsControl_iid) == 0) { + if (!m_viewfinderSettingsControl) + m_viewfinderSettingsControl = new CameraBinViewfinderSettings(m_captureSession); + return m_viewfinderSettingsControl; + } + + if (qstrcmp(name, QCameraViewfinderSettingsControl2_iid) == 0) { + if (!m_viewfinderSettingsControl2) + m_viewfinderSettingsControl2 = new CameraBinViewfinderSettings2(m_captureSession); + return m_viewfinderSettingsControl2; + } if (qstrcmp(name, QCameraInfoControl_iid) == 0) { if (!m_cameraInfoControl) @@ -263,7 +272,7 @@ void CameraBinService::releaseControl(QMediaControl *control) bool CameraBinService::isCameraBinAvailable() { - GstElementFactory *factory = gst_element_factory_find("camerabin2"); + GstElementFactory *factory = gst_element_factory_find(QT_GSTREAMER_CAMERABIN_ELEMENT_NAME); if (factory) { gst_object_unref(GST_OBJECT(factory)); return true; |