diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-01-21 18:06:33 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-01-29 08:50:20 +0000 |
commit | a5bfe043139ae40fa9f7ffc01b71ec37668a5534 (patch) | |
tree | e7088c696cc4e850a4f0404495d033dbae0e1462 | |
parent | 76f97643c74fb80e330f80ee8abd830ea8dbeff4 (diff) |
Completely remove the old plugin infrastructure
Now that nothing relies on QMediaServiceProvider* anymore,
get rid of those classes.
Change-Id: I30d4e878598b7af63f9a5b8cc3cf7cf3daa37f6a
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
63 files changed, 106 insertions, 1413 deletions
diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp index 4b2dce631..a80c2330b 100644 --- a/src/imports/multimedia/qdeclarativeaudio.cpp +++ b/src/imports/multimedia/qdeclarativeaudio.cpp @@ -43,7 +43,6 @@ #include <qmediaplayercontrol.h> #include <qmediaservice.h> -#include <private/qmediaserviceprovider_p.h> #include <private/qdeclarativevideooutput_p.h> #include <qmetadatareadercontrol.h> diff --git a/src/imports/multimedia/qmldir b/src/imports/multimedia/qmldir index e7dcc3dd6..d68049f63 100644 --- a/src/imports/multimedia/qmldir +++ b/src/imports/multimedia/qmldir @@ -4,4 +4,3 @@ classname QMultimediaDeclarativeModule typeinfo plugins.qmltypes typeinfo plugins.qmltypes Video 5.0 Video.qml - diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt index 91c27213a..b75c1432a 100644 --- a/src/multimedia/CMakeLists.txt +++ b/src/multimedia/CMakeLists.txt @@ -64,8 +64,6 @@ qt_internal_add_module(Multimedia qmediametadata.cpp qmediametadata.h qmediapluginloader.cpp qmediapluginloader_p.h qmediaservice.cpp qmediaservice.h qmediaservice_p.h - qmediaserviceprovider.cpp qmediaserviceprovider_p.h - qmediaserviceproviderplugin.h qmediasink.cpp qmediasink.h qmediasource.cpp qmediasource.h qmediasource_p.h qmediastoragelocation.cpp qmediastoragelocation_p.h @@ -253,7 +251,6 @@ qt_internal_extend_target(Multimedia CONDITION QT_FEATURE_gstreamer AND use_came platform/gstreamer/camerabin/camerabinmetadata.cpp platform/gstreamer/camerabin/camerabinmetadata_p.h platform/gstreamer/camerabin/camerabinrecorder.cpp platform/gstreamer/camerabin/camerabinrecorder_p.h platform/gstreamer/camerabin/camerabinservice.cpp platform/gstreamer/camerabin/camerabinservice_p.h - platform/gstreamer/camerabin/camerabinserviceplugin.cpp platform/gstreamer/camerabin/camerabinserviceplugin_p.h platform/gstreamer/camerabin/camerabinsession.cpp platform/gstreamer/camerabin/camerabinsession_p.h platform/gstreamer/camerabin/camerabinvideoencoder.cpp platform/gstreamer/camerabin/camerabinvideoencoder_p.h DEFINES @@ -286,7 +283,6 @@ qt_internal_extend_target(Multimedia CONDITION QT_FEATURE_gstreamer AND NOT use_ platform/gstreamer/mediacapture/qgstreamercameracontrol.cpp platform/gstreamer/mediacapture/qgstreamercameracontrol_p.h platform/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.cpp platform/gstreamer/mediacapture/qgstreamercapturemetadatacontrol_p.h platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h - platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin_p.h platform/gstreamer/mediacapture/qgstreamercapturesession.cpp platform/gstreamer/mediacapture/qgstreamercapturesession_p.h platform/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp platform/gstreamer/mediacapture/qgstreamerimagecapturecontrol_p.h platform/gstreamer/mediacapture/qgstreamerimageencode.cpp platform/gstreamer/mediacapture/qgstreamerimageencode_p.h @@ -385,7 +381,6 @@ qt_internal_extend_target(Multimedia CONDITION ANDROID platform/android/mediaplayer/qandroidmetadatareadercontrol.cpp platform/android/mediaplayer/qandroidmetadatareadercontrol_p.h platform/android/qandroiddevicemanager.cpp platform/android/qandroiddevicemanager_p.h platform/android/qandroidintegration.cpp platform/android/qandroidintegration_p.h - platform/android/qandroidmediaserviceplugin.cpp platform/android/qandroidmediaserviceplugin_p.h platform/android/wrappers/jni/androidcamera.cpp platform/android/wrappers/jni/androidcamera_p.h platform/android/wrappers/jni/androidmediametadataretriever.cpp platform/android/wrappers/jni/androidmediametadataretriever_p.h platform/android/wrappers/jni/androidmediaplayer.cpp platform/android/wrappers/jni/androidmediaplayer_p.h @@ -471,7 +466,6 @@ qt_internal_extend_target(Multimedia CONDITION APPLE AND NOT TVOS AND NOT WATCHO platform/darwin/camera/avfcamerametadatacontrol.mm platform/darwin/camera/avfcamerametadatacontrol_p.h platform/darwin/camera/avfcamerarenderercontrol.mm platform/darwin/camera/avfcamerarenderercontrol_p.h platform/darwin/camera/avfcameraservice.mm platform/darwin/camera/avfcameraservice_p.h - platform/darwin/camera/avfcameraserviceplugin.mm platform/darwin/camera/avfcameraserviceplugin_p.h platform/darwin/camera/avfcamerasession.mm platform/darwin/camera/avfcamerasession_p.h platform/darwin/camera/avfcamerautility.mm platform/darwin/camera/avfcamerautility_p.h platform/darwin/camera/avfcamerawindowcontrol.mm platform/darwin/camera/avfcamerawindowcontrol_p.h diff --git a/src/multimedia/audio/qaudiodecoder.cpp b/src/multimedia/audio/qaudiodecoder.cpp index 85fd3a5d0..b192ddce2 100644 --- a/src/multimedia/audio/qaudiodecoder.cpp +++ b/src/multimedia/audio/qaudiodecoder.cpp @@ -43,7 +43,6 @@ #include "qmediasource_p.h" #include <qmediaservice.h> #include "qaudiodecodercontrol.h" -#include <private/qmediaserviceprovider_p.h> #include <private/qmediaplatformintegration_p.h> diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index fb3a159d8..c6a1df074 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -290,7 +290,7 @@ void QCameraPrivate::_q_updateLockStatus(QCamera::LockType type, QCamera::LockSt QCamera::QCamera(QObject *parent) : QMediaSource(*new QCameraPrivate, parent, - QMediaPlatformIntegration::instance()->createCaptureInterface(QMediaPlatformIntegration::AudioAndVideo)) + QMediaPlatformIntegration::instance()->createCaptureInterface(QMediaRecorder::AudioAndVideo)) { Q_D(QCamera); d->init(); @@ -309,7 +309,7 @@ QCamera::QCamera(QObject *parent) QCamera::QCamera(const QByteArray& deviceName, QObject *parent): QMediaSource(*new QCameraPrivate, parent, - QMediaPlatformIntegration::instance()->createCaptureInterface(QMediaPlatformIntegration::AudioAndVideo)) + QMediaPlatformIntegration::instance()->createCaptureInterface(QMediaRecorder::AudioAndVideo)) { Q_D(QCamera); d->init(); @@ -368,7 +368,7 @@ QCamera::QCamera(const QCameraInfo &cameraInfo, QObject *parent) QCamera::QCamera(QCamera::Position position, QObject *parent) : QMediaSource(*new QCameraPrivate, parent, - QMediaPlatformIntegration::instance()->createCaptureInterface(QMediaPlatformIntegration::AudioAndVideo)) + QMediaPlatformIntegration::instance()->createCaptureInterface(QMediaRecorder::AudioAndVideo)) { Q_D(QCamera); d->init(); diff --git a/src/multimedia/camera/qcamerainfo.cpp b/src/multimedia/camera/qcamerainfo.cpp index 593d5d141..ffc387e50 100644 --- a/src/multimedia/camera/qcamerainfo.cpp +++ b/src/multimedia/camera/qcamerainfo.cpp @@ -40,7 +40,6 @@ #include "qcamerainfo_p.h" #include "qcamera_p.h" -#include "qmediaserviceprovider_p.h" #include <qvideodeviceselectorcontrol.h> diff --git a/src/multimedia/multimedia.pro b/src/multimedia/multimedia.pro index bf8527ec8..16872c739 100644 --- a/src/multimedia/multimedia.pro +++ b/src/multimedia/multimedia.pro @@ -14,7 +14,6 @@ PRIVATE_HEADERS += \ qmediasource_p.h \ qmediapluginloader_p.h \ qmediaservice_p.h \ - qmediaserviceprovider_p.h \ qmediastoragelocation_p.h \ qmultimediautils_p.h @@ -26,7 +25,6 @@ PUBLIC_HEADERS += \ qmediametadata.h \ qmediasource.h \ qmediaservice.h \ - qmediaserviceproviderplugin.h \ qmediatimerange.h \ qmultimedia.h @@ -36,7 +34,6 @@ SOURCES += \ qmediametadata.cpp \ qmediapluginloader.cpp \ qmediaservice.cpp \ - qmediaserviceprovider.cpp \ qmediasource.cpp \ qmediatimerange.cpp \ qmediastoragelocation.cpp \ diff --git a/src/multimedia/platform/android/android.pri b/src/multimedia/platform/android/android.pri index 0806d0538..555d8bec0 100644 --- a/src/multimedia/platform/android/android.pri +++ b/src/multimedia/platform/android/android.pri @@ -1,12 +1,10 @@ QT += opengl core-private network HEADERS += \ - $$PWD/qandroidmediaserviceplugin_p.h \ $$PWD/qandroidintegration_p.h \ $$PWD/qandroiddevicemanager_p.h SOURCES += \ - $$PWD/qandroidmediaserviceplugin.cpp \ $$PWD/qandroidintegration.cpp \ $$PWD/qandroiddevicemanager.cpp diff --git a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp index 2f124f7e8..c34de30af 100644 --- a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp +++ b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp @@ -56,16 +56,13 @@ #include "qandroidmediacontainercontrol_p.h" #include "qandroidmediavideoprobecontrol_p.h" -#include <qmediaserviceproviderplugin.h> - QT_BEGIN_NAMESPACE -QAndroidCaptureService::QAndroidCaptureService(const QString &service, QObject *parent) - : QMediaService(parent) - , m_service(service) +QAndroidCaptureService::QAndroidCaptureService(QMediaRecorder::CaptureMode mode) + : m_videoEnabled(mode == QMediaRecorder::AudioAndVideo) , m_videoRendererControl(0) { - if (m_service == QLatin1String(Q_MEDIASERVICE_CAMERA)) { + if (m_videoEnabled) { m_cameraSession = new QAndroidCameraSession; m_cameraControl = new QAndroidCameraControl(m_cameraSession); m_videoInputControl = new QAndroidVideoDeviceSelectorControl(m_cameraSession); @@ -91,7 +88,7 @@ QAndroidCaptureService::QAndroidCaptureService(const QString &service, QObject * m_audioEncoderSettingsControl = new QAndroidAudioEncoderSettingsControl(m_captureSession); m_mediaContainerControl = new QAndroidMediaContainerControl(m_captureSession); - if (m_service == QLatin1String(Q_MEDIASERVICE_CAMERA)) + if (m_videoEnabled) m_videoEncoderSettingsControl = new QAndroidVideoEncoderSettingsControl(m_captureSession); } @@ -149,7 +146,7 @@ QObject *QAndroidCaptureService::requestControl(const char *name) return m_imageCaptureControl; if (qstrcmp(name, QVideoRendererControl_iid) == 0 - && m_service == QLatin1String(Q_MEDIASERVICE_CAMERA) + && m_videoEnabled && !m_videoRendererControl) { m_videoRendererControl = new QAndroidCameraVideoRendererControl(m_cameraSession); return m_videoRendererControl; diff --git a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h index 2ed755029..f3150e2a0 100644 --- a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h +++ b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h @@ -53,6 +53,8 @@ // #include <qmediaservice.h> +#include <private/qmediaplatformcaptureinterface_p.h> +#include <private/qmediaplatformintegration_p.h> QT_BEGIN_NAMESPACE @@ -71,19 +73,19 @@ class QAndroidAudioEncoderSettingsControl; class QAndroidVideoEncoderSettingsControl; class QAndroidMediaContainerControl; -class QAndroidCaptureService : public QMediaService +class QAndroidCaptureService : public QMediaPlatformCaptureInterface { Q_OBJECT public: - explicit QAndroidCaptureService(const QString &service, QObject *parent = 0); + explicit QAndroidCaptureService(QMediaRecorder::CaptureMode mode); virtual ~QAndroidCaptureService(); QObject *requestControl(const char *name); void releaseControl(QObject *); private: - QString m_service; + bool m_videoEnabled = false; QAndroidMediaRecorderControl *m_recorderControl; QAndroidCaptureSession *m_captureSession; diff --git a/src/multimedia/platform/android/qandroidintegration.cpp b/src/multimedia/platform/android/qandroidintegration.cpp index ad8ca6b13..76102a476 100644 --- a/src/multimedia/platform/android/qandroidintegration.cpp +++ b/src/multimedia/platform/android/qandroidintegration.cpp @@ -40,9 +40,19 @@ #include "qandroidintegration_p.h" #include "qandroiddevicemanager_p.h" #include "private/qandroidmediaservice_p.h" +#include "private/qandroidglobal_p.h" +#include "private/qandroidcaptureservice_p.h" +#include "private/androidmediaplayer_p.h" +#include "private/qandroidcamerasession_p.h" +#include "private/androidsurfacetexture_p.h" +#include "private/androidsurfaceview_p.h" +#include "private/androidcamera_p.h" +#include "private/androidmediarecorder_p.h" QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(qtAndroidMediaPlugin, "qt.multimedia.android") + QAndroidIntegration::QAndroidIntegration() { @@ -60,9 +70,47 @@ QMediaPlatformDeviceManager *QAndroidIntegration::deviceManager() return m_manager; } +QMediaPlatformCaptureInterface *QAndroidIntegration::createCaptureInterface(QMediaRecorder::CaptureMode mode) +{ + return new QAndroidCaptureService(mode); +} + QMediaPlatformPlayerInterface *QAndroidIntegration::createPlayerInterface() { return new QAndroidMediaService(); } +Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*reserved*/) +{ + static bool initialized = false; + if (initialized) + return JNI_VERSION_1_6; + initialized = true; + + QT_USE_NAMESPACE + typedef union { + JNIEnv *nativeEnvironment; + void *venv; + } UnionJNIEnvToVoid; + + UnionJNIEnvToVoid uenv; + uenv.venv = NULL; + + if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_6) != JNI_OK) + return JNI_ERR; + + JNIEnv *jniEnv = uenv.nativeEnvironment; + + if (!AndroidMediaPlayer::initJNI(jniEnv) || + !AndroidCamera::initJNI(jniEnv) || + !AndroidMediaRecorder::initJNI(jniEnv) || + !AndroidSurfaceHolder::initJNI(jniEnv)) { + return JNI_ERR; + } + + AndroidSurfaceTexture::initJNI(jniEnv); + + return JNI_VERSION_1_6; +} + QT_END_NAMESPACE diff --git a/src/multimedia/platform/android/qandroidintegration_p.h b/src/multimedia/platform/android/qandroidintegration_p.h index d7e62242f..d4cf5bb6a 100644 --- a/src/multimedia/platform/android/qandroidintegration_p.h +++ b/src/multimedia/platform/android/qandroidintegration_p.h @@ -66,6 +66,7 @@ public: QMediaPlatformDeviceManager *deviceManager() override; + QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode mode) override; QMediaPlatformPlayerInterface *createPlayerInterface() override; QAndroidDeviceManager *m_manager = nullptr; diff --git a/src/multimedia/platform/android/qandroidmediaserviceplugin.cpp b/src/multimedia/platform/android/qandroidmediaserviceplugin.cpp deleted file mode 100644 index bc5a54acb..000000000 --- a/src/multimedia/platform/android/qandroidmediaserviceplugin.cpp +++ /dev/null @@ -1,112 +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 "qandroidmediaserviceplugin_p.h" - -#include "qandroidmediaservice_p.h" -#include "qandroidcaptureservice_p.h" -#include "qandroidcamerasession_p.h" -#include "androidmediaplayer_p.h" -#include "androidsurfacetexture_p.h" -#include "androidcamera_p.h" -#include "androidmultimediautils_p.h" -#include "androidmediarecorder_p.h" -#include "androidsurfaceview_p.h" -#include "qandroidglobal_p.h" - -QT_BEGIN_NAMESPACE - -Q_LOGGING_CATEGORY(qtAndroidMediaPlugin, "qt.multimedia.android") - -QAndroidMediaServicePlugin::QAndroidMediaServicePlugin() -{ -} - -QAndroidMediaServicePlugin::~QAndroidMediaServicePlugin() -{ -} - -QMediaService *QAndroidMediaServicePlugin::create(const QString &key) -{ - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA) - return new QAndroidCaptureService(key); - - qCWarning(qtAndroidMediaPlugin) << "Android service plugin: unsupported key:" << key; - return 0; -} - -void QAndroidMediaServicePlugin::release(QMediaService *service) -{ - delete service; -} - -QT_END_NAMESPACE - -Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*reserved*/) -{ - static bool initialized = false; - if (initialized) - return JNI_VERSION_1_6; - initialized = true; - - QT_USE_NAMESPACE - typedef union { - JNIEnv *nativeEnvironment; - void *venv; - } UnionJNIEnvToVoid; - - UnionJNIEnvToVoid uenv; - uenv.venv = NULL; - - if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_6) != JNI_OK) - return JNI_ERR; - - JNIEnv *jniEnv = uenv.nativeEnvironment; - - if (!AndroidMediaPlayer::initJNI(jniEnv) || - !AndroidCamera::initJNI(jniEnv) || - !AndroidMediaRecorder::initJNI(jniEnv) || - !AndroidSurfaceHolder::initJNI(jniEnv)) { - return JNI_ERR; - } - - AndroidSurfaceTexture::initJNI(jniEnv); - - return JNI_VERSION_1_6; -} diff --git a/src/multimedia/platform/android/qandroidmediaserviceplugin_p.h b/src/multimedia/platform/android/qandroidmediaserviceplugin_p.h deleted file mode 100644 index 4beff309b..000000000 --- a/src/multimedia/platform/android/qandroidmediaserviceplugin_p.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 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 QANDROIDMEDIASERVICEPLUGIN_H -#define QANDROIDMEDIASERVICEPLUGIN_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QMediaServiceProviderPlugin> - -QT_BEGIN_NAMESPACE - -class QAndroidMediaServicePlugin - : public QMediaServiceProviderPlugin -{ - Q_OBJECT -public: - QAndroidMediaServicePlugin(); - ~QAndroidMediaServicePlugin(); - - QMediaService* create(QString const& key) override; - void release(QMediaService *service) override; -}; - -QT_END_NAMESPACE - -#endif // QANDROIDMEDIASERVICEPLUGIN_H diff --git a/src/multimedia/platform/darwin/camera/avfcameraservice.mm b/src/multimedia/platform/darwin/camera/avfcameraservice.mm index 80e8a154d..670167d45 100644 --- a/src/multimedia/platform/darwin/camera/avfcameraservice.mm +++ b/src/multimedia/platform/darwin/camera/avfcameraservice.mm @@ -65,10 +65,9 @@ QT_USE_NAMESPACE -AVFCameraService::AVFCameraService(QObject *parent): - QMediaService(parent), - m_videoOutput(nullptr), - m_captureWindowControl(nullptr) +AVFCameraService::AVFCameraService() + : m_videoOutput(nullptr), + m_captureWindowControl(nullptr) { m_session = new AVFCameraSession(this); m_cameraControl = new AVFCameraControl(this); diff --git a/src/multimedia/platform/darwin/camera/avfcameraservice_p.h b/src/multimedia/platform/darwin/camera/avfcameraservice_p.h index f4e8fba50..27d10ba25 100644 --- a/src/multimedia/platform/darwin/camera/avfcameraservice_p.h +++ b/src/multimedia/platform/darwin/camera/avfcameraservice_p.h @@ -53,7 +53,7 @@ #include <QtCore/qobject.h> #include <QtCore/qset.h> -#include <qmediaservice.h> +#include <private/qmediaplatformcaptureinterface_p.h> QT_BEGIN_NAMESPACE @@ -77,11 +77,11 @@ class AVFVideoEncoderSettingsControl; class AVFMediaContainerControl; class AVFCameraWindowControl; -class AVFCameraService : public QMediaService +class AVFCameraService : public QMediaPlatformCaptureInterface { Q_OBJECT public: - AVFCameraService(QObject *parent = nullptr); + AVFCameraService(); ~AVFCameraService(); QObject *requestControl(const char *name); diff --git a/src/multimedia/platform/darwin/camera/avfcameraserviceplugin.mm b/src/multimedia/platform/darwin/camera/avfcameraserviceplugin.mm deleted file mode 100644 index 129f3d334..000000000 --- a/src/multimedia/platform/darwin/camera/avfcameraserviceplugin.mm +++ /dev/null @@ -1,70 +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 <QtCore/qstring.h> -#include <QtCore/qdebug.h> - -#include "avfcameraserviceplugin_p.h" -#include "avfcameraservice_p.h" -#include "avfcamerasession_p.h" - -#include <qmediaserviceproviderplugin.h> - -QT_BEGIN_NAMESPACE - -AVFServicePlugin::AVFServicePlugin() -{ -} - -QMediaService* AVFServicePlugin::create(QString const& key) -{ - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) - return new AVFCameraService; - else - qWarning() << "unsupported key:" << key; - - return nullptr; -} - -void AVFServicePlugin::release(QMediaService *service) -{ - delete service; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/platform/darwin/camera/avfcameraserviceplugin_p.h b/src/multimedia/platform/darwin/camera/avfcameraserviceplugin_p.h deleted file mode 100644 index 499fe5836..000000000 --- a/src/multimedia/platform/darwin/camera/avfcameraserviceplugin_p.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 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 AVFSERVICEPLUGIN_H -#define AVFSERVICEPLUGIN_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <qmediaserviceproviderplugin.h> -#include <QtCore/qmap.h> - -QT_BEGIN_NAMESPACE - -class AVFServicePlugin : public QMediaServiceProviderPlugin, -{ - Q_OBJECT -public: - AVFServicePlugin(); - - QMediaService* create(QString const &key) override; - void release(QMediaService *service) override; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/platform/darwin/camera/camera.pri b/src/multimedia/platform/darwin/camera/camera.pri index 94bbbc8f2..49bd35ba1 100644 --- a/src/multimedia/platform/darwin/camera/camera.pri +++ b/src/multimedia/platform/darwin/camera/camera.pri @@ -1,6 +1,5 @@ HEADERS += \ $$PWD/avfcameradebug_p.h \ - $$PWD/avfcameraserviceplugin_p.h \ $$PWD/avfcameracontrol_p.h \ $$PWD/avfcamerametadatacontrol_p.h \ $$PWD/avfimagecapturecontrol_p.h \ @@ -20,7 +19,6 @@ HEADERS += \ $$PWD/avfcamerawindowcontrol_p.h \ SOURCES += \ - $$PWD/avfcameraserviceplugin.mm \ $$PWD/avfcameracontrol.mm \ $$PWD/avfcamerametadatacontrol.mm \ $$PWD/avfimagecapturecontrol.mm \ diff --git a/src/multimedia/platform/darwin/qdarwinintegration.cpp b/src/multimedia/platform/darwin/qdarwinintegration.cpp index ed38141e1..3f969a43a 100644 --- a/src/multimedia/platform/darwin/qdarwinintegration.cpp +++ b/src/multimedia/platform/darwin/qdarwinintegration.cpp @@ -40,6 +40,7 @@ #include "qdarwinintegration_p.h" #include "qdarwindevicemanager_p.h" #include <private/avfmediaplayerservice_p.h> +#include <private/avfcameraservice_p.h> QT_BEGIN_NAMESPACE @@ -60,6 +61,11 @@ QMediaPlatformDeviceManager *QDarwinIntegration::deviceManager() return m_manager; } +QMediaPlatformCaptureInterface *QDarwinIntegration::createCaptureInterface(QMediaRecorder::CaptureMode) +{ + return new AVFCameraService; +} + QMediaPlatformPlayerInterface *QDarwinIntegration::createPlayerInterface() { return new AVFMediaPlayerService; diff --git a/src/multimedia/platform/darwin/qdarwinintegration_p.h b/src/multimedia/platform/darwin/qdarwinintegration_p.h index af59fb093..ec9e33b78 100644 --- a/src/multimedia/platform/darwin/qdarwinintegration_p.h +++ b/src/multimedia/platform/darwin/qdarwinintegration_p.h @@ -65,6 +65,7 @@ public: QMediaPlatformDeviceManager *deviceManager() override; + QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode /*mode*/) override; QMediaPlatformPlayerInterface *createPlayerInterface() override; QDarwinDeviceManager *m_manager = nullptr; diff --git a/src/multimedia/platform/gstreamer/camerabin/camerabin.pri b/src/multimedia/platform/gstreamer/camerabin/camerabin.pri index 2cacd56b0..d4d661110 100644 --- a/src/multimedia/platform/gstreamer/camerabin/camerabin.pri +++ b/src/multimedia/platform/gstreamer/camerabin/camerabin.pri @@ -1,6 +1,5 @@ HEADERS += \ - $$PWD/camerabinserviceplugin_p.h \ $$PWD/camerabinservice_p.h \ $$PWD/camerabinsession_p.h \ $$PWD/camerabincontrol_p.h \ @@ -14,7 +13,6 @@ HEADERS += \ $$PWD/camerabinvideoencoder_p.h \ SOURCES += \ - $$PWD/camerabinserviceplugin.cpp \ $$PWD/camerabinservice.cpp \ $$PWD/camerabinsession.cpp \ $$PWD/camerabincontrol.cpp \ diff --git a/src/multimedia/platform/gstreamer/camerabin/camerabinservice.cpp b/src/multimedia/platform/gstreamer/camerabin/camerabinservice.cpp index 8359b5f59..c48207396 100644 --- a/src/multimedia/platform/gstreamer/camerabin/camerabinservice.cpp +++ b/src/multimedia/platform/gstreamer/camerabin/camerabinservice.cpp @@ -62,7 +62,6 @@ #include <private/qgstreamervideowindow_p.h> #include <private/qgstreamervideorenderer_p.h> -#include <private/qmediaserviceprovider_p.h> #include <QtCore/qdebug.h> diff --git a/src/multimedia/platform/gstreamer/camerabin/camerabinserviceplugin.cpp b/src/multimedia/platform/gstreamer/camerabin/camerabinserviceplugin.cpp deleted file mode 100644 index d15c424c7..000000000 --- a/src/multimedia/platform/gstreamer/camerabin/camerabinserviceplugin.cpp +++ /dev/null @@ -1,114 +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 <QtCore/qstring.h> -#include <QtCore/qdebug.h> -#include <QtCore/QDir> -#include <QtCore/QDebug> - -#include "camerabinserviceplugin.h" - -#include "camerabinservice.h" -#include <private/qgstutils_p.h> - -QT_BEGIN_NAMESPACE - -template <typename T, int N> static int lengthOf(const T(&)[N]) { return N; } - -CameraBinServicePlugin::CameraBinServicePlugin() - : m_sourceFactory(0) -{ -} - -CameraBinServicePlugin::~CameraBinServicePlugin() -{ - if (m_sourceFactory) - gst_object_unref(GST_OBJECT(m_sourceFactory)); -} - -QMediaService* CameraBinServicePlugin::create(const QString &key) -{ - QGstUtils::initializeGst(); - - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) { - if (!CameraBinService::isCameraBinAvailable()) { - guint major, minor, micro, nano; - gst_version(&major, &minor, µ, &nano); - qWarning("Error: cannot create camera service, the 'camerabin' plugin is missing for " - "GStreamer %u.%u." - "\nPlease install the 'bad' GStreamer plugin package.", - major, minor); - return nullptr; - } - - return new CameraBinService(sourceFactory()); - } - - qWarning() << "Gstreamer camerabin service plugin: unsupported key:" << key; - return 0; -} - -void CameraBinServicePlugin::release(QMediaService *service) -{ - delete service; -} - -GstElementFactory *CameraBinServicePlugin::sourceFactory() const -{ - if (!m_sourceFactory) { - GstElementFactory *factory = 0; - const QByteArray envCandidate = qgetenv("QT_GSTREAMER_CAMERABIN_SRC"); - if (!envCandidate.isEmpty()) - factory = gst_element_factory_find(envCandidate.constData()); - - static const char *candidates[] = { "subdevsrc", "wrappercamerabinsrc" }; - for (int i = 0; !factory && i < lengthOf(candidates); ++i) - factory = gst_element_factory_find(candidates[i]); - - if (factory) { - m_sourceFactory = GST_ELEMENT_FACTORY(gst_plugin_feature_load( - GST_PLUGIN_FEATURE(factory))); - gst_object_unref((GST_OBJECT(factory))); - } - } - - return m_sourceFactory; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/platform/gstreamer/camerabin/camerabinserviceplugin_p.h b/src/multimedia/platform/gstreamer/camerabin/camerabinserviceplugin_p.h deleted file mode 100644 index 05661e3d5..000000000 --- a/src/multimedia/platform/gstreamer/camerabin/camerabinserviceplugin_p.h +++ /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$ -** -****************************************************************************/ - - -#ifndef CAMERABINSERVICEPLUGIN_H -#define CAMERABINSERVICEPLUGIN_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <qmediaserviceproviderplugin.h> -#include <private/qgstreamervideoinputdevicecontrol_p.h> - -#include <gst/gst.h> - -QT_BEGIN_NAMESPACE - -class CameraBinServicePlugin - : public QMediaServiceProviderPlugin -{ - Q_OBJECT -public: - CameraBinServicePlugin(); - ~CameraBinServicePlugin(); - - QMediaService* create(const QString &key) override; - void release(QMediaService *service) override; - -private: - GstElementFactory *sourceFactory() const; - - mutable GstElementFactory *m_sourceFactory; -}; - -QT_END_NAMESPACE - -#endif // QGSTREAMERCAPTURESERVICEPLUGIN_H diff --git a/src/multimedia/platform/gstreamer/mediacapture/mediacapture.pri b/src/multimedia/platform/gstreamer/mediacapture/mediacapture.pri index f87e95200..a8a4d2d47 100644 --- a/src/multimedia/platform/gstreamer/mediacapture/mediacapture.pri +++ b/src/multimedia/platform/gstreamer/mediacapture/mediacapture.pri @@ -9,8 +9,7 @@ HEADERS += $$PWD/qgstreamercaptureservice_p.h \ $$PWD/qgstreamercameracontrol_p.h \ $$PWD/qgstreamercapturemetadatacontrol_p.h \ $$PWD/qgstreamerimagecapturecontrol_p.h \ - $$PWD/qgstreamerimageencode_p.h \ - $$PWD/qgstreamercaptureserviceplugin_p.h + $$PWD/qgstreamerimageencode_p.h SOURCES += $$PWD/qgstreamercaptureservice.cpp \ $$PWD/qgstreamercapturesession.cpp \ @@ -21,8 +20,7 @@ SOURCES += $$PWD/qgstreamercaptureservice.cpp \ $$PWD/qgstreamercameracontrol.cpp \ $$PWD/qgstreamercapturemetadatacontrol.cpp \ $$PWD/qgstreamerimagecapturecontrol.cpp \ - $$PWD/qgstreamerimageencode.cpp \ - $$PWD/qgstreamercaptureserviceplugin.cpp + $$PWD/qgstreamerimageencode.cpp # Camera usage with gstreamer needs to have CONFIG += use_gstreamer_camera diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp index 1d1cfd480..f841665c2 100644 --- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp +++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp @@ -59,11 +59,9 @@ #include <private/qgstreamervideorenderer_p.h> #include <private/qgstreamervideowindow_p.h> -#include <qmediaserviceproviderplugin.h> - QT_BEGIN_NAMESPACE -QGstreamerCaptureService::QGstreamerCaptureService(QMediaPlatformIntegration::CaptureMode mode) +QGstreamerCaptureService::QGstreamerCaptureService(QMediaRecorder::CaptureMode mode) : QMediaPlatformCaptureInterface() , m_captureSession(0) , m_cameraControl(0) @@ -78,7 +76,7 @@ QGstreamerCaptureService::QGstreamerCaptureService(QMediaPlatformIntegration::Ca , m_imageCaptureControl(0) , m_audioProbeControl(0) { - if (mode == QMediaPlatformIntegration::AudioOnly) { + if (mode == QMediaRecorder::AudioOnly) { m_captureSession = new QGstreamerCaptureSession(QGstreamerCaptureSession::Audio, this); } diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h index 8b89d4ea4..f768f63ac 100644 --- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h +++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h @@ -76,7 +76,7 @@ class QGstreamerCaptureService : public QMediaPlatformCaptureInterface Q_OBJECT public: - QGstreamerCaptureService(QMediaPlatformIntegration::CaptureMode mode); + QGstreamerCaptureService(QMediaRecorder::CaptureMode mode); virtual ~QGstreamerCaptureService(); QObject *requestControl(const char *name) override; diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp deleted file mode 100644 index b056dec18..000000000 --- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp +++ /dev/null @@ -1,100 +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 <QtCore/qstring.h> -#include <QtCore/qdebug.h> -#include <QtCore/QDir> -#include <QtCore/QDebug> - -#include "qgstreamercaptureserviceplugin_p.h" -#include "private/qmediaplatformintegration_p.h" -#include "private/qmediaplatformdevicemanager_p.h" -#include "qcamerainfo.h" - -//#define QT_SUPPORTEDMIMETYPES_DEBUG - -#include "qgstreamercaptureservice_p.h" -#include <private/qgstutils_p.h> - -QMediaService* QGstreamerCaptureServicePlugin::create(const QString &key) -{ - QGstUtils::initializeGst(); - -#if defined(USE_GSTREAMER_CAMERA) - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) - return new QGstreamerCaptureService(QMediaPlatformIntegration::AudioAndVideo); -#endif - - qWarning() << "Gstreamer capture service plugin: unsupported key:" << key; - return 0; -} - -void QGstreamerCaptureServicePlugin::release(QMediaService *service) -{ - delete service; -} - -#if 0 -// #### Find a better way to enumerate supported formats -QMultimedia::SupportEstimate QGstreamerCaptureServicePlugin::hasSupport(const QString &mimeType, - const QStringList& codecs) const -{ - if (m_supportedMimeTypeSet.isEmpty()) - updateSupportedMimeTypes(); - - return QGstUtils::hasSupport(mimeType, codecs, m_supportedMimeTypeSet); -} - - -static bool isEncoderOrMuxer(GstElementFactory *factory) -{ - return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_MUXER) - || gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_ENCODER); -} - -void QGstreamerCaptureServicePlugin::updateSupportedMimeTypes() const -{ - m_supportedMimeTypeSet = QGstUtils::supportedMimeTypes(isEncoderOrMuxer); -} - -QStringList QGstreamerCaptureServicePlugin::supportedMimeTypes() const -{ - return QStringList(); -} -#endif diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin_p.h b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin_p.h deleted file mode 100644 index acfd4f27c..000000000 --- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureserviceplugin_p.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 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 QGSTREAMERCAPTURESERVICEPLUGIN_H -#define QGSTREAMERCAPTURESERVICEPLUGIN_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <qmediaserviceproviderplugin.h> -#include <QtCore/qset.h> -#include <QtCore/QObject> - -QT_BEGIN_NAMESPACE - -class QGstreamerCaptureServicePlugin - : public QMediaServiceProviderPlugin -{ - Q_OBJECT -public: - QMediaService* create(const QString &key) override; - void release(QMediaService *service) override; -}; - -QT_END_NAMESPACE - -#endif // QGSTREAMERCAPTURESERVICEPLUGIN_H diff --git a/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp b/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp index 4ba8f1d43..f31133f21 100644 --- a/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp +++ b/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp @@ -68,7 +68,7 @@ QAudioDecoderControl *QGstreamerIntegration::createAudioDecoder() return new QGstreamerAudioDecoderControl(nullptr); } -QMediaPlatformCaptureInterface *QGstreamerIntegration::createCaptureInterface(CaptureMode mode) +QMediaPlatformCaptureInterface *QGstreamerIntegration::createCaptureInterface(QMediaRecorder::CaptureMode mode) { return new QGstreamerCaptureService(mode); } diff --git a/src/multimedia/platform/gstreamer/qgstreamerintegration_p.h b/src/multimedia/platform/gstreamer/qgstreamerintegration_p.h index 5f79c8c09..54c51748f 100644 --- a/src/multimedia/platform/gstreamer/qgstreamerintegration_p.h +++ b/src/multimedia/platform/gstreamer/qgstreamerintegration_p.h @@ -67,7 +67,7 @@ public: QMediaPlatformDeviceManager *deviceManager() override; QAudioDecoderControl *createAudioDecoder() override; - QMediaPlatformCaptureInterface *createCaptureInterface(CaptureMode mode) override; + QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode mode) override; QMediaPlatformPlayerInterface *createPlayerInterface() override; QGstreamerDeviceManager *m_manager = nullptr; diff --git a/src/multimedia/platform/qmediaplatformintegration_p.h b/src/multimedia/platform/qmediaplatformintegration_p.h index ed0be7959..a049c704b 100644 --- a/src/multimedia/platform/qmediaplatformintegration_p.h +++ b/src/multimedia/platform/qmediaplatformintegration_p.h @@ -51,6 +51,7 @@ // #include <private/qtmultimediaglobal_p.h> +#include <qmediarecorder.h> QT_BEGIN_NAMESPACE @@ -71,13 +72,8 @@ public: virtual ~QMediaPlatformIntegration(); virtual QMediaPlatformDeviceManager *deviceManager() = 0; - enum CaptureMode { - AudioOnly, - AudioAndVideo - }; - virtual QAudioDecoderControl *createAudioDecoder() { return nullptr; } - virtual QMediaPlatformCaptureInterface *createCaptureInterface(CaptureMode /*mode*/) { return nullptr; } + virtual QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode /*mode*/) { return nullptr; } virtual QMediaPlatformPlayerInterface *createPlayerInterface() { return nullptr; } }; diff --git a/src/multimedia/platform/qnx/audio/audio.pri b/src/multimedia/platform/qnx/audio/audio.pri index eac9316b0..c9a345722 100644 --- a/src/multimedia/platform/qnx/audio/audio.pri +++ b/src/multimedia/platform/qnx/audio/audio.pri @@ -5,11 +5,9 @@ HEADERS += \ $$PWD/qnxaudioinput_p.h \ $$PWD/qnxaudiooutput_p.h \ $$PWD/qnxaudioutils_p.h \ - $$PWD/neutrinoserviceplugin_p.h SOURCES += \ $$PWD/qnxaudiodeviceinfo.cpp \ $$PWD/qnxaudioinput.cpp \ $$PWD/qnxaudiooutput.cpp \ $$PWD/qnxaudioutils.cpp \ - $$PWD/neutrinoserviceplugin.cpp diff --git a/src/multimedia/platform/qnx/neutrinoserviceplugin.cpp b/src/multimedia/platform/qnx/neutrinoserviceplugin.cpp deleted file mode 100644 index effde472a..000000000 --- a/src/multimedia/platform/qnx/neutrinoserviceplugin.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 "neutrinoserviceplugin.h" - -#include "mmrenderermediaplayerservice.h" - -QT_BEGIN_NAMESPACE - -NeutrinoServicePlugin::NeutrinoServicePlugin() -{ -} - -QMediaService *NeutrinoServicePlugin::create(const QString &key) -{ - return 0; -} - -void NeutrinoServicePlugin::release(QMediaService *service) -{ - delete service; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/platform/qnx/neutrinoserviceplugin_p.h b/src/multimedia/platform/qnx/neutrinoserviceplugin_p.h deleted file mode 100644 index f35fdf1a8..000000000 --- a/src/multimedia/platform/qnx/neutrinoserviceplugin_p.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 NEUTRINOSERVICEPLUGIN_H -#define NEUTRINOSERVICEPLUGIN_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <qmediaserviceproviderplugin.h> - -QT_BEGIN_NAMESPACE - -class NeutrinoServicePlugin - : public QMediaServiceProviderPlugin -{ - Q_OBJECT -public: - NeutrinoServicePlugin(); - - QMediaService *create(const QString &key) override; - void release(QMediaService *service) override; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/qmediapluginloader.cpp b/src/multimedia/qmediapluginloader.cpp index 9d145d789..db9f2e638 100644 --- a/src/multimedia/qmediapluginloader.cpp +++ b/src/multimedia/qmediapluginloader.cpp @@ -43,8 +43,6 @@ #include <QtCore/qjsonarray.h> #include <private/qfactoryloader_p.h> -#include "qmediaserviceproviderplugin.h" - QT_BEGIN_NAMESPACE QMediaPluginLoader::QMediaPluginLoader(const char *iid, const QString &location, Qt::CaseSensitivity caseSensitivity): diff --git a/src/multimedia/qmediaservice.cpp b/src/multimedia/qmediaservice.cpp index 1e4d9abd9..197bda445 100644 --- a/src/multimedia/qmediaservice.cpp +++ b/src/multimedia/qmediaservice.cpp @@ -72,13 +72,6 @@ QT_BEGIN_NAMESPACE \snippet multimedia-snippets/media.cpp Request control - Media objects can use services loaded dynamically from plug-ins or - implemented statically within an applications. Plug-in based services - should also implement the QMediaServiceProviderPlugin interface. Static - services should implement the QMediaServiceProvider interface. In general, - implementing a QMediaService is outside of the scope of this documentation - and support on the relevant mailing lists or IRC channels should be sought. - \sa QMediaSource, QMediaControl */ diff --git a/src/multimedia/qmediaserviceprovider.cpp b/src/multimedia/qmediaserviceprovider.cpp deleted file mode 100644 index c1f68c80e..000000000 --- a/src/multimedia/qmediaserviceprovider.cpp +++ /dev/null @@ -1,254 +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 <qtmultimediaglobal_p.h> - -#include <QtCore/qdebug.h> -#include <QtCore/qmap.h> - -#include "qmediaservice.h" -#include "qmediaserviceprovider_p.h" -#include "qmediaserviceproviderplugin.h" -#include "qmediapluginloader_p.h" -#include "qmediaplayer.h" -#include "qvideodeviceselectorcontrol.h" - -#if QT_CONFIG(gstreamer) -#include <private/qgstreamercaptureserviceplugin_p.h> -#elif defined(Q_OS_DARWIN) -#include <private/avfcameraserviceplugin_p.h> -#elif defined(Q_OS_ANDROID) -#include <private/qandroidmediaserviceplugin_p.h> -#elif defined(Q_OS_QNX) -#include <private/neutrinoserviceplugin_p.h> -#endif - -QT_BEGIN_NAMESPACE - -class Loader -{ -#define GET_PLUGIN(Key, Class) \ - if (key.toUtf8() == Key) { \ - static QObject *instance = nullptr; \ - if (!instance) \ - instance = new Class; \ - return instance; \ - } - -public: - QObject *instance(const QString &key) { -#if QT_CONFIG(gstreamer) - GET_PLUGIN(Q_MEDIASERVICE_CAMERA, QGstreamerCaptureServicePlugin) - GET_PLUGIN(Q_MEDIASERVICE_AUDIOSOURCE, QGstreamerCaptureServicePlugin) -#elif defined(Q_OS_DARWIN) - GET_PLUGIN(Q_MEDIASERVICE_CAMERA, AVFServicePlugin) -#elif defined(Q_OS_ANDROID) - GET_PLUGIN(Q_MEDIASERVICE_CAMERA, QAndroidMediaServicePlugin) -#endif - return nullptr; - } -}; - -Q_GLOBAL_STATIC(Loader, loader); - -class QPluginServiceProvider : public QMediaServiceProvider -{ - struct MediaServiceData { - QByteArray type; - QMediaServiceProviderPlugin *plugin = nullptr; - }; - - QMap<const QMediaService*, MediaServiceData> mediaServiceData; - -public: - QMediaService* requestService(const QByteArray &type) override - { - QString key(QLatin1String(type.constData())); - - QList<QMediaServiceProviderPlugin *>plugins; - QObject *instance = loader()->instance(key); - QMediaServiceProviderPlugin *plugin = qobject_cast<QMediaServiceProviderPlugin*>(instance); - - if (plugin != nullptr) { - QMediaService *service = plugin->create(key); - if (service != nullptr) { - MediaServiceData d; - d.type = type; - d.plugin = plugin; - mediaServiceData.insert(service, d); - } - - return service; - } - - qWarning() << "defaultServiceProvider::requestService(): no service found for -" << key; - return nullptr; - } - - void releaseService(QMediaService *service) override - { - if (service != nullptr) { - MediaServiceData d = mediaServiceData.take(service); - - if (d.plugin != nullptr) - d.plugin->release(service); - } - } -}; - -Q_GLOBAL_STATIC(QPluginServiceProvider, pluginProvider); - -/*! - \class QMediaServiceProvider - \obsolete - \ingroup multimedia - \ingroup multimedia_control - \ingroup multimedia_core - - \internal - - \brief The QMediaServiceProvider class provides an abstract allocator for media services. -*/ - -/*! - \internal - \fn QMediaServiceProvider::requestService(const QByteArray &type) - - Requests an instance of a \a type service which best matches the given \a - hint. - - Returns a pointer to the requested service, or a null pointer if there is - no suitable service. - - The returned service must be released with releaseService when it is - finished with. -*/ - -/*! - \internal - \fn QMediaServiceProvider::releaseService(QMediaService *service) - - Releases a media \a service requested with requestService(). -*/ - -static QMediaServiceProvider *qt_defaultMediaServiceProvider = nullptr; - -/*! - Sets a media service \a provider as the default. - It's useful for unit tests to provide mock service. - - \internal -*/ -void QMediaServiceProvider::setDefaultServiceProvider(QMediaServiceProvider *provider) -{ - qt_defaultMediaServiceProvider = provider; -} - - -/*! - \internal - Returns a default provider of media services. -*/ -QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider() -{ - return qt_defaultMediaServiceProvider != nullptr - ? qt_defaultMediaServiceProvider - : static_cast<QMediaServiceProvider *>(pluginProvider()); -} - -/*! - \class QMediaServiceProviderPlugin - \obsolete - \inmodule QtMultimedia - \brief The QMediaServiceProviderPlugin class interface provides an interface for QMediaService - plug-ins. - - A media service provider plug-in may implement one or more of - QMediaServiceSupportedFormatsInterface and QMediaServiceSupportedDevicesInterface - to identify the features it supports. -*/ - -/*! - \fn QMediaServiceProviderPlugin::create(const QString &key) - - Constructs a new instance of the QMediaService identified by \a key. - - The QMediaService returned must be destroyed with release(). -*/ - -/*! - \fn QMediaServiceProviderPlugin::release(QMediaService *service) - - Destroys a media \a service constructed with create(). -*/ - - -/*! - \class QMediaServiceSupportedFormatsInterface - \obsolete - \inmodule QtMultimedia - \brief The QMediaServiceSupportedFormatsInterface class interface - identifies if a media service plug-in supports a media format. - - A QMediaServiceProviderPlugin may implement this interface. -*/ - -/*! - \fn QMediaServiceSupportedFormatsInterface::~QMediaServiceSupportedFormatsInterface() - - Destroys a media service supported formats interface. -*/ - -/*! - \fn QMediaServiceSupportedFormatsInterface::hasSupport(const QString &mimeType, const QStringList& codecs) const - - Returns the level of support a media service plug-in has for a \a mimeType - and set of \a codecs. -*/ - -/*! - \fn QMediaServiceSupportedFormatsInterface::supportedMimeTypes() const - - Returns a list of MIME types supported by the media service plug-in. -*/ - -QT_END_NAMESPACE - -#include "moc_qmediaserviceprovider_p.cpp" -#include "moc_qmediaserviceproviderplugin.cpp" diff --git a/src/multimedia/qmediaserviceprovider_p.h b/src/multimedia/qmediaserviceprovider_p.h deleted file mode 100644 index 53709ca68..000000000 --- a/src/multimedia/qmediaserviceprovider_p.h +++ /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$ -** -****************************************************************************/ - -#ifndef QMEDIASERVICEPROVIDER_H -#define QMEDIASERVICEPROVIDER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qobject.h> -#include <QtCore/qshareddata.h> -#include <qtmultimediaglobal.h> -#include "qmultimedia.h" -#include "qmediaserviceproviderplugin.h" - -QT_BEGIN_NAMESPACE - - -class QMediaService; - -class Q_MULTIMEDIA_EXPORT QMediaServiceProvider : public QObject -{ - Q_OBJECT - -public: - virtual QMediaService* requestService(const QByteArray &type) = 0; - virtual void releaseService(QMediaService *service) = 0; - - static QMediaServiceProvider* defaultServiceProvider(); - static void setDefaultServiceProvider(QMediaServiceProvider *provider); -}; - -QT_END_NAMESPACE - - -#endif // QMEDIASERVICEPROVIDER_H diff --git a/src/multimedia/qmediaserviceproviderplugin.h b/src/multimedia/qmediaserviceproviderplugin.h deleted file mode 100644 index 639a67dcb..000000000 --- a/src/multimedia/qmediaserviceproviderplugin.h +++ /dev/null @@ -1,89 +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 QMEDIASERVICEPROVIDERPLUGIN_H -#define QMEDIASERVICEPROVIDERPLUGIN_H - -#include <QtCore/qstringlist.h> -#include <QtCore/qplugin.h> -#include <QtMultimedia/qmultimedia.h> -#include <QtMultimedia/qtmultimediaglobal.h> -#include <QtMultimedia/qcamera.h> - -#ifdef Q_MOC_RUN -# pragma Q_MOC_EXPAND_MACROS -#endif - -QT_BEGIN_NAMESPACE - -class Q_MULTIMEDIA_EXPORT QMediaServiceProviderPlugin : public QObject -{ - Q_OBJECT -public: - virtual QMediaService* create(const QString& key) = 0; - virtual void release(QMediaService *service) = 0; -}; - -/*! - Service with support for recording from audio sources - Required Controls: QAudioDeviceControl - Recording Controls (QMediaRecorder): - Required: QMediaRecorderControl - Recommended: QAudioEncoderSettingsControl - Optional: QMediaContainerControl -*/ -#define Q_MEDIASERVICE_AUDIOSOURCE "org.qt-project.qt.audiosource" - -/*! - Service with support for camera use. - Required Controls: QCameraControl - Optional Controls: QCameraExposureControl, QCameraFocusControl, QCameraImageProcessingControl - Still Capture Controls: QCameraImageCaptureControl - Video Capture Controls (QMediaRecorder): - Required: QMediaRecorderControl - Recommended: QAudioEncoderSettingsControl, QVideoEncoderSettingsControl, QMediaContainerControl - Viewfinder Video Output Controls (used by QCameraViewfinder and QGraphicsVideoItem): - Required: QVideoOutputControl - Optional: QVideoWindowControl, QVideoRendererControl -*/ -#define Q_MEDIASERVICE_CAMERA "org.qt-project.qt.camera" - -QT_END_NAMESPACE - -#endif // QMEDIASERVICEPROVIDERPLUGIN_H diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp index 7cef40a4a..05ea09b5e 100644 --- a/src/multimedia/recording/qmediarecorder.cpp +++ b/src/multimedia/recording/qmediarecorder.cpp @@ -43,7 +43,6 @@ #include <qmediarecordercontrol.h> #include "qmediasource_p.h" #include <qmediaservice.h> -#include <qmediaserviceprovider_p.h> #include <qmetadatawritercontrol.h> #include <qaudioencodersettingscontrol.h> #include <qvideoencodersettingscontrol.h> @@ -194,7 +193,7 @@ public: The \a parent is passed to QMediaSource. */ -QMediaRecorder::QMediaRecorder(QMediaRecorder::Mode mode, QObject *parent) +QMediaRecorder::QMediaRecorder(QMediaRecorder::CaptureMode mode, QObject *parent) : QObject(parent), d_ptr(new QMediaRecorderPrivate) { @@ -204,7 +203,7 @@ QMediaRecorder::QMediaRecorder(QMediaRecorder::Mode mode, QObject *parent) d->notifyTimer = new QTimer(this); connect(d->notifyTimer, SIGNAL(timeout()), SLOT(_q_notify())); - QMediaService *service = QMediaPlatformIntegration::instance()->createCaptureInterface(mode == AudioOnly); + QMediaService *service = QMediaPlatformIntegration::instance()->createCaptureInterface(mode); setMediaSource(new QAudioRecorderObject(this, service)); } diff --git a/src/multimedia/recording/qmediarecorder.h b/src/multimedia/recording/qmediarecorder.h index 7a97e07bc..5c633c2e2 100644 --- a/src/multimedia/recording/qmediarecorder.h +++ b/src/multimedia/recording/qmediarecorder.h @@ -108,12 +108,12 @@ public: OutOfSpaceError }; - enum Mode { + enum CaptureMode { AudioOnly, AudioAndVideo }; - QMediaRecorder(Mode mode = AudioOnly, QObject *parent = nullptr); + QMediaRecorder(CaptureMode mode = AudioOnly, QObject *parent = nullptr); explicit QMediaRecorder(QMediaSource *mediaSource, QObject *parent = nullptr); ~QMediaRecorder(); diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp index 68f30a8b9..cba570b7e 100644 --- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp +++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp @@ -44,7 +44,6 @@ #include <qcamerainfo.h> #include <qcameraimagecapture.h> #include <qvideorenderercontrol.h> -#include <private/qmediaserviceprovider_p.h> #include <qmediadevicemanager.h> QT_USE_NAMESPACE diff --git a/tests/auto/unit/mockbackend/CMakeLists.txt b/tests/auto/unit/mockbackend/CMakeLists.txt index c098e8e56..bddc6710b 100644 --- a/tests/auto/unit/mockbackend/CMakeLists.txt +++ b/tests/auto/unit/mockbackend/CMakeLists.txt @@ -29,7 +29,6 @@ target_sources(QtMultimediaMockBackend INTERFACE mockmediarecordercontrol.h mockmediarecorderservice.h mockmediaservice.h - mockmediaserviceprovider.h mockmediasource.h mockmediastreamscontrol.h mockmetadatareadercontrol.h diff --git a/tests/auto/unit/mockbackend/common.pri b/tests/auto/unit/mockbackend/common.pri index dae521d54..9bd00dd6f 100644 --- a/tests/auto/unit/mockbackend/common.pri +++ b/tests/auto/unit/mockbackend/common.pri @@ -1,7 +1,6 @@ INCLUDEPATH += $$PWD HEADERS += \ $$PWD/mockmediaservice.h \ - $$PWD/mockmediaserviceprovider.h \ $$PWD/mockmediasource.h \ $$PWD/mockvideorenderercontrol.h \ $$PWD/mockvideowindowcontrol.h \ diff --git a/tests/auto/unit/mockbackend/mockmediaserviceprovider.h b/tests/auto/unit/mockbackend/mockmediaserviceprovider.h deleted file mode 100644 index 6542bbffa..000000000 --- a/tests/auto/unit/mockbackend/mockmediaserviceprovider.h +++ /dev/null @@ -1,62 +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 MOCKMEDIASERVICEPROVIDER_H -#define MOCKMEDIASERVICEPROVIDER_H - -#include "private/qmediaserviceprovider_p.h" -#include "qmediaservice.h" -#include "mockvideodeviceselectorcontrol.h" - -// Simple provider that lets you set the service -class MockMediaServiceProvider : public QMediaServiceProvider -{ -public: - MockMediaServiceProvider(QMediaService* s = 0, bool del=false) - : service(s), deleteServiceOnRelease(del) - { - } - - QMediaService *requestService(const QByteArray &) - { - return service; - } - - void releaseService(QMediaService *service) - { - if (deleteServiceOnRelease) { - delete service; - this->service = 0; - } - } - - QMediaService *service; - bool deleteServiceOnRelease; -}; - -#endif // MOCKMEDIASERVICEPROVIDER_H diff --git a/tests/auto/unit/mockbackend/qmockintegration.cpp b/tests/auto/unit/mockbackend/qmockintegration.cpp index 92c612f60..cc532e17d 100644 --- a/tests/auto/unit/mockbackend/qmockintegration.cpp +++ b/tests/auto/unit/mockbackend/qmockintegration.cpp @@ -81,7 +81,7 @@ QMediaPlatformPlayerInterface *QMockIntegration::createPlayerInterface() return m_lastPlayerService; } -QMediaPlatformCaptureInterface *QMockIntegration::createCaptureInterface(QMediaPlatformIntegration::CaptureMode mode) +QMediaPlatformCaptureInterface *QMockIntegration::createCaptureInterface(QMediaRecorder::CaptureMode mode) { Q_UNUSED(mode); if (m_flags & NoCaptureInterface) diff --git a/tests/auto/unit/mockbackend/qmockintegration_p.h b/tests/auto/unit/mockbackend/qmockintegration_p.h index 619c8ba88..fb2ccfd79 100644 --- a/tests/auto/unit/mockbackend/qmockintegration_p.h +++ b/tests/auto/unit/mockbackend/qmockintegration_p.h @@ -70,7 +70,7 @@ public: QAudioDecoderControl *createAudioDecoder() override; QMediaPlatformPlayerInterface *createPlayerInterface() override; - QMediaPlatformCaptureInterface *createCaptureInterface(CaptureMode mode) override; + QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode mode) override; enum Flag { NoPlayerInterface = 0x1, diff --git a/tests/auto/unit/multimedia/qaudioprobe/tst_qaudioprobe.cpp b/tests/auto/unit/multimedia/qaudioprobe/tst_qaudioprobe.cpp index f84f84107..2d9069cc6 100644 --- a/tests/auto/unit/multimedia/qaudioprobe/tst_qaudioprobe.cpp +++ b/tests/auto/unit/multimedia/qaudioprobe/tst_qaudioprobe.cpp @@ -34,7 +34,6 @@ //TESTED_COMPONENT=src/multimedia -#include "mockmediaserviceprovider.h" #include "mockmediarecorderservice.h" #include "mockmediasource.h" #include "qmockintegration_p.h" diff --git a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp index cac5c1ca7..9d8629baf 100644 --- a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp +++ b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp @@ -40,7 +40,6 @@ //TESTED_COMPONENT=src/multimedia -#include "mockmediaserviceprovider.h" #include "mockmediarecorderservice.h" #include "qmockintegration_p.h" diff --git a/tests/auto/unit/multimedia/qcamera/tst_qcamera.cpp b/tests/auto/unit/multimedia/qcamera/tst_qcamera.cpp index ed288ca16..5e5118331 100644 --- a/tests/auto/unit/multimedia/qcamera/tst_qcamera.cpp +++ b/tests/auto/unit/multimedia/qcamera/tst_qcamera.cpp @@ -45,7 +45,6 @@ #include <qvideorenderercontrol.h> #include <qmediadevicemanager.h> -#include "mockmediaserviceprovider.h" #include "mockvideosurface.h" #include "mockvideorenderercontrol.h" #include "mockvideowindowcontrol.h" diff --git a/tests/auto/unit/multimedia/qcameraimagecapture/tst_qcameraimagecapture.cpp b/tests/auto/unit/multimedia/qcameraimagecapture/tst_qcameraimagecapture.cpp index 1a196ae71..6a7281274 100644 --- a/tests/auto/unit/multimedia/qcameraimagecapture/tst_qcameraimagecapture.cpp +++ b/tests/auto/unit/multimedia/qcameraimagecapture/tst_qcameraimagecapture.cpp @@ -49,7 +49,6 @@ Reviewer Name Date Coverage ( Full / Test Case IDs ). #include <qcamera.h> #include <qcameraimagecapture.h> -#include "mockmediaserviceprovider.h" #include "mockmediarecorderservice.h" #include "qmockintegration_p.h" diff --git a/tests/auto/unit/multimedia/qcamerainfo/tst_qcamerainfo.cpp b/tests/auto/unit/multimedia/qcamerainfo/tst_qcamerainfo.cpp index b36d48c9a..139eb0130 100644 --- a/tests/auto/unit/multimedia/qcamerainfo/tst_qcamerainfo.cpp +++ b/tests/auto/unit/multimedia/qcamerainfo/tst_qcamerainfo.cpp @@ -33,7 +33,6 @@ #include <qcamerainfo.h> #include <qmediadevicemanager.h> -#include "mockmediaserviceprovider.h" #include "qmockintegration_p.h" #include "mockmediarecorderservice.h" diff --git a/tests/auto/unit/multimedia/qmediapluginloader/tst_qmediapluginloader.cpp b/tests/auto/unit/multimedia/qmediapluginloader/tst_qmediapluginloader.cpp index a07370921..2a34cfabf 100644 --- a/tests/auto/unit/multimedia/qmediapluginloader/tst_qmediapluginloader.cpp +++ b/tests/auto/unit/multimedia/qmediapluginloader/tst_qmediapluginloader.cpp @@ -29,7 +29,6 @@ //TESTED_COMPONENT=src/multimedia #include <private/qmediapluginloader_p.h> -#include <qmediaserviceproviderplugin.h> #include <QtTest/QtTest> #include <QDebug> diff --git a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp index 12418bfdf..2fe2e6be4 100644 --- a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp +++ b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp @@ -117,7 +117,7 @@ void tst_QMediaRecorder::initTestCase() qRegisterMetaType<QMediaRecorder::Error>("QMediaRecorder::Error"); mockIntegration = new QMockIntegration; - object = new MockMediaSource(this, mockIntegration->createCaptureInterface(QMockIntegration::AudioAndVideo)); + object = new MockMediaSource(this, mockIntegration->createCaptureInterface(QMediaRecorder::AudioAndVideo)); capture = new QMediaRecorder(object); service = mockIntegration->lastCaptureService(); mock = service->mockControl; @@ -1110,7 +1110,7 @@ void tst_QMediaRecorder::testAvailabilityStatus() QCOMPARE(recorder.isAvailable(), false); } { - mockIntegration->createCaptureInterface(QMockIntegration::AudioAndVideo); + mockIntegration->createCaptureInterface(QMediaRecorder::AudioAndVideo); auto *service1 = mockIntegration->lastCaptureService(); service1->mockMetaDataControl->populateMetaData(); MockMediaSource object1(nullptr, service1); @@ -1119,7 +1119,7 @@ void tst_QMediaRecorder::testAvailabilityStatus() QCOMPARE(recorder1.isAvailable(), true); } { - mockIntegration->createCaptureInterface(QMockIntegration::AudioAndVideo); + mockIntegration->createCaptureInterface(QMediaRecorder::AudioAndVideo); auto *service1 = mockIntegration->lastCaptureService(); service1->mockMetaDataControl->populateMetaData(); MockMediaSource object1(nullptr, service1); @@ -1137,7 +1137,7 @@ void tst_QMediaRecorder::testIsAvailable() QMediaRecorder recorder(&object); QCOMPARE(recorder.isAvailable(), false); - mockIntegration->createCaptureInterface(QMockIntegration::AudioAndVideo); + mockIntegration->createCaptureInterface(QMediaRecorder::AudioAndVideo); auto *service1 = mockIntegration->lastCaptureService(); service1->mockMetaDataControl->populateMetaData(); MockMediaSource object1(nullptr, service1); diff --git a/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp b/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp index 905c0f1ac..217b50c09 100644 --- a/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp +++ b/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp @@ -38,7 +38,6 @@ #include <qmetadatareadercontrol.h> #include "mockmediarecorderservice.h" -#include "mockmediaserviceprovider.h" #include "mockmetadatareadercontrol.h" class QtTestMediaObjectService : public QMediaService diff --git a/tests/auto/unit/multimedia/qvideoprobe/tst_qvideoprobe.cpp b/tests/auto/unit/multimedia/qvideoprobe/tst_qvideoprobe.cpp index 3d8f9a81d..2e2cea637 100644 --- a/tests/auto/unit/multimedia/qvideoprobe/tst_qvideoprobe.cpp +++ b/tests/auto/unit/multimedia/qvideoprobe/tst_qvideoprobe.cpp @@ -35,7 +35,6 @@ //TESTED_COMPONENT=src/multimedia -#include "mockmediaserviceprovider.h" #include "mockmediarecorderservice.h" #include "mockmediaplayerservice.h" #include "mockmediasource.h" diff --git a/tests/auto/unit/multimediawidgets/qcamerawidgets/tst_qcamerawidgets.cpp b/tests/auto/unit/multimediawidgets/qcamerawidgets/tst_qcamerawidgets.cpp index a5353a285..768903447 100644 --- a/tests/auto/unit/multimediawidgets/qcamerawidgets/tst_qcamerawidgets.cpp +++ b/tests/auto/unit/multimediawidgets/qcamerawidgets/tst_qcamerawidgets.cpp @@ -46,7 +46,6 @@ #include <qvideowidget.h> #include <qvideowindowcontrol.h> -#include "mockmediaserviceprovider.h" #include "mockvideosurface.h" #include "mockvideorenderercontrol.h" #include "mockvideowindowcontrol.h" diff --git a/tests/auto/unit/multimediawidgets/qmediaplayerwidgets/tst_qmediaplayerwidgets.cpp b/tests/auto/unit/multimediawidgets/qmediaplayerwidgets/tst_qmediaplayerwidgets.cpp index 159449552..ae15bcdff 100644 --- a/tests/auto/unit/multimediawidgets/qmediaplayerwidgets/tst_qmediaplayerwidgets.cpp +++ b/tests/auto/unit/multimediawidgets/qmediaplayerwidgets/tst_qmediaplayerwidgets.cpp @@ -37,7 +37,6 @@ #include <qmediaplayer.h> #include <qmediaplayercontrol.h> -#include "mockmediaserviceprovider.h" #include "mockmediaplayerservice.h" #include "mockvideosurface.h" #include "qmockintegration_p.h" diff --git a/tests/auto/unit/qml/qdeclarativeaudio/tst_qdeclarativeaudio.cpp b/tests/auto/unit/qml/qdeclarativeaudio/tst_qdeclarativeaudio.cpp index 6b3bf757f..2e7ee9c17 100644 --- a/tests/auto/unit/qml/qdeclarativeaudio/tst_qdeclarativeaudio.cpp +++ b/tests/auto/unit/qml/qdeclarativeaudio/tst_qdeclarativeaudio.cpp @@ -33,7 +33,6 @@ #include "qdeclarativeaudio_p.h" #include "qdeclarativemediametadata_p.h" -#include "mockmediaserviceprovider.h" #include "mockmediaplayerservice.h" #include "mockmetadatareadercontrol.h" #include "qmockintegration_p.h" @@ -41,7 +40,6 @@ #include <QtMultimedia/qmediametadata.h> #include <qmediaplayercontrol.h> #include <qmediaservice.h> -#include <private/qmediaserviceprovider_p.h> #include <private/qdeclarativevideooutput_p.h> #include <qmetadatareadercontrol.h> #include <QAbstractVideoSurface> @@ -801,16 +799,13 @@ void tst_QDeclarativeAudio::audioRole() void tst_QDeclarativeAudio::customAudioRole() { - MockMediaPlayerService mockService; - MockMediaServiceProvider mockProvider(&mockService); - QMediaServiceProvider::setDefaultServiceProvider(&mockProvider); - QQmlEngine engine; QQmlComponent component(&engine); component.setData("import QtQuick 2.0 \n import QtMultimedia 5.11 \n Audio { }", QUrl()); + auto *service = mockIntegration->lastPlayerService(); { - mockService.mockControl->hasCustomAudioRole = false; + service->player()->hasCustomAudioRole = false; QObject *audio = component.create(); QVERIFY(audio); @@ -830,8 +825,7 @@ void tst_QDeclarativeAudio::customAudioRole() } { - mockService.reset(); - mockService.mockControl->hasAudioRole = false; + service->player()->hasAudioRole = false; QObject *audio = component.create(); QVERIFY(audio); @@ -852,8 +846,6 @@ void tst_QDeclarativeAudio::customAudioRole() } { - mockService.reset(); - QObject *audio = component.create(); QVERIFY(audio); diff --git a/tests/auto/unit/qml/qdeclarativevideo/qdeclarativevideo.pro b/tests/auto/unit/qml/qdeclarativevideo/qdeclarativevideo.pro index 27e2abc5b..8428f19dd 100644 --- a/tests/auto/unit/qml/qdeclarativevideo/qdeclarativevideo.pro +++ b/tests/auto/unit/qml/qdeclarativevideo/qdeclarativevideo.pro @@ -3,6 +3,8 @@ TARGET = tst_qdeclarativevideo QT += multimedia-private qml testlib +include (../../mockbackend/mockbackend.pri) + HEADERS += \ ../../../../src/imports/multimedia/qdeclarativevideo_p.h \ ../../../../src/imports/multimedia/qdeclarativemediabase_p.h \ diff --git a/tests/auto/unit/qml/qdeclarativevideo/tst_qdeclarativevideo.cpp b/tests/auto/unit/qml/qdeclarativevideo/tst_qdeclarativevideo.cpp index 3bbca7a6b..27585facc 100644 --- a/tests/auto/unit/qml/qdeclarativevideo/tst_qdeclarativevideo.cpp +++ b/tests/auto/unit/qml/qdeclarativevideo/tst_qdeclarativevideo.cpp @@ -37,10 +37,10 @@ #include <qgraphicsvideoitem.h> #include <qmediaplayercontrol.h> #include <qmediaservice.h> -#include <qmediaserviceprovider.h> #include <qvideorenderercontrol.h> #include <qvideowindowcontrol.h> #include <qvideosurfaceformat.h> +#include <qmockintegration_p.h> #include <QtWidgets/qapplication.h> #include <QtGui/qpainter.h> @@ -63,6 +63,9 @@ private slots: void hasVideo(); void fillMode(); void geometry(); + +private: + QMockIntegration *mockIntegration; }; Q_DECLARE_METATYPE(QDeclarativeVideo::Error); @@ -167,6 +170,7 @@ private: QUrl m_media; }; +# if 0 class QtTestRendererControl : public QVideoRendererControl { public: @@ -323,11 +327,12 @@ public: QtTestMediaService *service; QByteArray requestedService; }; - +#endif void tst_QDeclarativeVideo::initTestCase() { qRegisterMetaType<QDeclarativeVideo::Error>(); + mockIntegration = new QMockIntegration; } void tst_QDeclarativeVideo::nullPlayerControl() |