From 480dbd6e5e4c75373c40867154dc972fe17df031 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 12 Feb 2021 17:55:35 +0100 Subject: Next steps in consistent class naming All platform interfaces should be named QPlatformMediaFoo. This is consistent with QPA in qtbase, where the backend for QFoo is called QPlatformFoo. Change-Id: I40e7b035638eb27e670210e149f6f8b717e21a63 Reviewed-by: Doris Verria Reviewed-by: Lars Knoll --- src/imports/multimedia/qdeclarativetorch.cpp | 2 +- src/multimedia/CMakeLists.txt | 8 +- src/multimedia/audio/qaudiodecoder.cpp | 4 +- src/multimedia/audio/qaudiodeviceinfo.cpp | 4 +- src/multimedia/audio/qaudioinput.cpp | 6 +- src/multimedia/audio/qaudiooutput.cpp | 6 +- src/multimedia/camera/qcamera.cpp | 8 +- src/multimedia/camera/qcamera.h | 4 +- src/multimedia/camera/qcamera_p.h | 4 +- src/multimedia/camera/qcameraimagecapture.cpp | 4 +- .../platform/alsa/qalsadevicemanager.cpp | 2 +- .../platform/alsa/qalsadevicemanager_p.h | 4 +- src/multimedia/platform/alsa/qalsaintegration.cpp | 2 +- src/multimedia/platform/alsa/qalsaintegration_p.h | 6 +- .../mediacapture/qandroidcaptureservice_p.h | 6 +- .../platform/android/qandroiddevicemanager.cpp | 2 +- .../platform/android/qandroiddevicemanager_p.h | 4 +- .../platform/android/qandroidformatsinfo_p.h | 4 +- .../platform/android/qandroidintegration.cpp | 6 +- .../platform/android/qandroidintegration_p.h | 12 +-- .../platform/darwin/camera/avfcameraservice_p.h | 4 +- .../platform/darwin/qdarwindevicemanager.mm | 2 +- .../platform/darwin/qdarwindevicemanager_p.h | 4 +- .../platform/darwin/qdarwinformatsinfo_p.h | 4 +- .../platform/darwin/qdarwinintegration.cpp | 6 +- .../platform/darwin/qdarwinintegration_p.h | 12 +-- .../gstreamer/audio/qaudiodeviceinfo_gstreamer.cpp | 4 +- .../gstreamer/audio/qaudioengine_gstreamer.cpp | 8 +- .../gstreamer/camerabin/camerabinsession.cpp | 4 +- .../mediacapture/qgstreamercaptureservice_p.h | 6 +- .../platform/gstreamer/qgstreamerdevicemanager.cpp | 2 +- .../platform/gstreamer/qgstreamerdevicemanager_p.h | 4 +- .../platform/gstreamer/qgstreamerformatsinfo_p.h | 4 +- .../platform/gstreamer/qgstreamerintegration.cpp | 6 +- .../platform/gstreamer/qgstreamerintegration_p.h | 12 +-- src/multimedia/platform/platform.pri | 16 +-- .../pulseaudio/qpulseaudiodevicemanager.cpp | 2 +- .../pulseaudio/qpulseaudiodevicemanager_p.h | 4 +- .../platform/pulseaudio/qpulseaudiointegration.cpp | 2 +- .../platform/pulseaudio/qpulseaudiointegration_p.h | 6 +- .../platform/qmediaplatformcaptureinterface.cpp | 50 --------- .../platform/qmediaplatformcaptureinterface_p.h | 75 ------------- .../platform/qmediaplatformdevicemanager.cpp | 110 ------------------- .../platform/qmediaplatformdevicemanager_p.h | 98 ----------------- .../platform/qmediaplatformformatinfo.cpp | 117 --------------------- .../platform/qmediaplatformformatinfo_p.h | 85 --------------- .../platform/qmediaplatformintegration.cpp | 98 ----------------- .../platform/qmediaplatformintegration_p.h | 86 --------------- .../platform/qnx/camera/bbcameraservice_p.h | 4 +- .../mediaplayer/mmrenderermediaplayerservice_p.h | 6 +- src/multimedia/platform/qnx/qqnxdevicemanager_p.h | 4 +- src/multimedia/platform/qnx/qqnxintegration_p.h | 8 +- src/multimedia/platform/qplatformmediacapture.cpp | 50 +++++++++ src/multimedia/platform/qplatformmediacapture_p.h | 75 +++++++++++++ .../platform/qplatformmediadevicemanager.cpp | 110 +++++++++++++++++++ .../platform/qplatformmediadevicemanager_p.h | 98 +++++++++++++++++ .../platform/qplatformmediaformatinfo.cpp | 117 +++++++++++++++++++++ .../platform/qplatformmediaformatinfo_p.h | 85 +++++++++++++++ .../platform/qplatformmediaintegration.cpp | 98 +++++++++++++++++ .../platform/qplatformmediaintegration_p.h | 86 +++++++++++++++ .../platform/windows/qwindowsdevicemanager.cpp | 2 +- .../platform/windows/qwindowsdevicemanager_p.h | 4 +- .../platform/windows/qwindowsformatinfo_p.h | 4 +- .../platform/windows/qwindowsintegration.cpp | 4 +- .../platform/windows/qwindowsintegration_p.h | 8 +- src/multimedia/playback/qmediaplayer.cpp | 4 +- src/multimedia/qmediadevicemanager.cpp | 8 +- src/multimedia/qmediaformat.cpp | 14 +-- src/multimedia/recording/qmediaencodersettings.cpp | 6 +- src/multimedia/recording/qmediarecorder.cpp | 6 +- 70 files changed, 865 insertions(+), 865 deletions(-) delete mode 100644 src/multimedia/platform/qmediaplatformcaptureinterface.cpp delete mode 100644 src/multimedia/platform/qmediaplatformcaptureinterface_p.h delete mode 100644 src/multimedia/platform/qmediaplatformdevicemanager.cpp delete mode 100644 src/multimedia/platform/qmediaplatformdevicemanager_p.h delete mode 100644 src/multimedia/platform/qmediaplatformformatinfo.cpp delete mode 100644 src/multimedia/platform/qmediaplatformformatinfo_p.h delete mode 100644 src/multimedia/platform/qmediaplatformintegration.cpp delete mode 100644 src/multimedia/platform/qmediaplatformintegration_p.h create mode 100644 src/multimedia/platform/qplatformmediacapture.cpp create mode 100644 src/multimedia/platform/qplatformmediacapture_p.h create mode 100644 src/multimedia/platform/qplatformmediadevicemanager.cpp create mode 100644 src/multimedia/platform/qplatformmediadevicemanager_p.h create mode 100644 src/multimedia/platform/qplatformmediaformatinfo.cpp create mode 100644 src/multimedia/platform/qplatformmediaformatinfo_p.h create mode 100644 src/multimedia/platform/qplatformmediaintegration.cpp create mode 100644 src/multimedia/platform/qplatformmediaintegration_p.h (limited to 'src') diff --git a/src/imports/multimedia/qdeclarativetorch.cpp b/src/imports/multimedia/qdeclarativetorch.cpp index 21c594e72..efd213e20 100644 --- a/src/imports/multimedia/qdeclarativetorch.cpp +++ b/src/imports/multimedia/qdeclarativetorch.cpp @@ -38,7 +38,7 @@ ****************************************************************************/ #include -#include +#include #include #include "qdeclarativetorch_p.h" diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt index 25cde55ab..1aa8e5fae 100644 --- a/src/multimedia/CMakeLists.txt +++ b/src/multimedia/CMakeLists.txt @@ -40,10 +40,10 @@ qt_internal_add_module(Multimedia controls/qmediastreamscontrol.cpp controls/qmediastreamscontrol.h controls/qvideorenderercontrol.cpp controls/qvideorenderercontrol.h controls/qvideowindowcontrol.cpp controls/qvideowindowcontrol.h - platform/qmediaplatformcaptureinterface.cpp platform/qmediaplatformcaptureinterface_p.h - platform/qmediaplatformdevicemanager.cpp platform/qmediaplatformdevicemanager_p.h - platform/qmediaplatformintegration.cpp platform/qmediaplatformintegration_p.h - platform/qmediaplatformformatinfo.cpp platform/qmediaplatformformatinfo_p.h + platform/qplatformmediacapture.cpp platform/qplatformmediacapture_p.h + platform/qplatformmediadevicemanager.cpp platform/qplatformmediadevicemanager_p.h + platform/qplatformmediaformatinfo.cpp platform/qplatformmediaformatinfo_p.h + platform/qplatformmediaintegration.cpp platform/qplatformmediaintegration_p.h platform/qplatformmediaplayer.cpp platform/qplatformmediaplayer_p.h playback/qmediaplayer.cpp playback/qmediaplayer.h playback/qmediaplaylist.cpp playback/qmediaplaylist.h playback/qmediaplaylist_p.h diff --git a/src/multimedia/audio/qaudiodecoder.cpp b/src/multimedia/audio/qaudiodecoder.cpp index 33419b85b..7f228bada 100644 --- a/src/multimedia/audio/qaudiodecoder.cpp +++ b/src/multimedia/audio/qaudiodecoder.cpp @@ -42,7 +42,7 @@ #include "qaudiodecodercontrol.h" -#include +#include #include #include @@ -121,7 +121,7 @@ QAudioDecoder::QAudioDecoder(QObject *parent) { Q_D(QAudioDecoder); - d->control = QMediaPlatformIntegration::instance()->createAudioDecoder(); + d->control = QPlatformMediaIntegration::instance()->createAudioDecoder(); if (d->control != nullptr) { connect(d->control, SIGNAL(stateChanged(QAudioDecoder::State)), SLOT(_q_stateChanged(QAudioDecoder::State))); connect(d->control, SIGNAL(error(int,QString)), SLOT(_q_error(int,QString))); diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp index f034d732e..e64d27efc 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo.cpp @@ -39,8 +39,8 @@ #include "qaudiosystem_p.h" #include "qaudiodeviceinfo_p.h" -#include -#include +#include +#include #include diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp index 5ffdf1073..c36092495 100644 --- a/src/multimedia/audio/qaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput.cpp @@ -43,8 +43,8 @@ #include "qaudiosystem_p.h" #include "qaudioinput.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -132,7 +132,7 @@ QAudioInput::QAudioInput(const QAudioFormat &format, QObject *parent) QAudioInput::QAudioInput(const QAudioDeviceInfo &audioDevice, const QAudioFormat &format, QObject *parent): QObject(parent) { - d = QMediaPlatformIntegration::instance()->deviceManager()->audioInputDevice(format, audioDevice); + d = QPlatformMediaIntegration::instance()->deviceManager()->audioInputDevice(format, audioDevice); if (d) { connect(d, SIGNAL(notify()), SIGNAL(notify())); connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp index 0042921cb..bf6d5e0e0 100644 --- a/src/multimedia/audio/qaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput.cpp @@ -43,8 +43,8 @@ #include "qaudiosystem_p.h" #include "qaudiooutput.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -131,7 +131,7 @@ QAudioOutput::QAudioOutput(const QAudioFormat &format, QObject *parent) QAudioOutput::QAudioOutput(const QAudioDeviceInfo &audioDevice, const QAudioFormat &format, QObject *parent): QObject(parent) { - d = QMediaPlatformIntegration::instance()->deviceManager()->audioOutputDevice(format, audioDevice); + d = QPlatformMediaIntegration::instance()->deviceManager()->audioOutputDevice(format, audioDevice); if (d) { connect(d, SIGNAL(notify()), SIGNAL(notify())); connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index 665668474..ee4686f28 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -47,8 +47,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -153,7 +153,7 @@ void QCameraPrivate::initControls() { Q_Q(QCamera); - captureInterface = QMediaPlatformIntegration::instance()->createCaptureInterface(QMediaRecorder::AudioAndVideo); + captureInterface = QPlatformMediaIntegration::instance()->createCaptureInterface(QMediaRecorder::AudioAndVideo); if (captureInterface) { control = captureInterface->cameraControl(); @@ -336,7 +336,7 @@ QString QCamera::errorString() const /*! \internal */ -QMediaPlatformCaptureInterface *QCamera::captureInterface() const +QPlatformMediaCapture *QCamera::captureInterface() const { return d_func()->captureInterface; } diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h index 44afdbd03..bf37db9be 100644 --- a/src/multimedia/camera/qcamera.h +++ b/src/multimedia/camera/qcamera.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE class QAbstractVideoSurface; class QCameraInfo; -class QMediaPlatformCaptureInterface; +class QPlatformMediaCapture; class QCameraPrivate; class Q_MULTIMEDIA_EXPORT QCamera : public QObject @@ -121,7 +121,7 @@ public: Error error() const; QString errorString() const; - QMediaPlatformCaptureInterface *captureInterface() const; + QPlatformMediaCapture *captureInterface() const; public Q_SLOTS: void load(); void unload(); diff --git a/src/multimedia/camera/qcamera_p.h b/src/multimedia/camera/qcamera_p.h index ec61a002b..272f39cd2 100644 --- a/src/multimedia/camera/qcamera_p.h +++ b/src/multimedia/camera/qcamera_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE class QCameraControl; -class QMediaPlatformCaptureInterface; +class QPlatformMediaCapture; class QCameraPrivate : public QObjectPrivate { @@ -78,7 +78,7 @@ public: void clear(); - QMediaPlatformCaptureInterface *captureInterface = nullptr; + QPlatformMediaCapture *captureInterface = nullptr; QCameraControl *control = nullptr; QCameraExposure *cameraExposure = nullptr; diff --git a/src/multimedia/camera/qcameraimagecapture.cpp b/src/multimedia/camera/qcameraimagecapture.cpp index af670ae0b..369f207f0 100644 --- a/src/multimedia/camera/qcameraimagecapture.cpp +++ b/src/multimedia/camera/qcameraimagecapture.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "private/qobject_p.h" #include @@ -137,7 +137,7 @@ QCameraImageCapture::QCameraImageCapture(QCamera *camera) d->q_ptr = this; d->camera = camera; - QMediaPlatformCaptureInterface *service = camera->captureInterface(); + QPlatformMediaCapture *service = camera->captureInterface(); if (service) { d->control = service->imageCaptureControl(); diff --git a/src/multimedia/platform/alsa/qalsadevicemanager.cpp b/src/multimedia/platform/alsa/qalsadevicemanager.cpp index 24662980f..cf18bf0c4 100644 --- a/src/multimedia/platform/alsa/qalsadevicemanager.cpp +++ b/src/multimedia/platform/alsa/qalsadevicemanager.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QAlsaDeviceManager::QAlsaDeviceManager() - : QMediaPlatformDeviceManager() + : QPlatformMediaDeviceManager() { } diff --git a/src/multimedia/platform/alsa/qalsadevicemanager_p.h b/src/multimedia/platform/alsa/qalsadevicemanager_p.h index 26cd1192c..aedb186bf 100644 --- a/src/multimedia/platform/alsa/qalsadevicemanager_p.h +++ b/src/multimedia/platform/alsa/qalsadevicemanager_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE class QAlsaEngine; -class QAlsaDeviceManager : public QMediaPlatformDeviceManager +class QAlsaDeviceManager : public QPlatformMediaDeviceManager { public: QAlsaDeviceManager(); diff --git a/src/multimedia/platform/alsa/qalsaintegration.cpp b/src/multimedia/platform/alsa/qalsaintegration.cpp index d7c7a9fc6..5c5cb598b 100644 --- a/src/multimedia/platform/alsa/qalsaintegration.cpp +++ b/src/multimedia/platform/alsa/qalsaintegration.cpp @@ -51,7 +51,7 @@ QAlsaIntegration::~QAlsaIntegration() delete m_manager; } -QMediaPlatformDeviceManager *QAlsaIntegration::deviceManager() +QPlatformMediaDeviceManager *QAlsaIntegration::deviceManager() { if (!m_manager) m_manager = new QAlsaDeviceManager(); diff --git a/src/multimedia/platform/alsa/qalsaintegration_p.h b/src/multimedia/platform/alsa/qalsaintegration_p.h index c50676cfb..31789e852 100644 --- a/src/multimedia/platform/alsa/qalsaintegration_p.h +++ b/src/multimedia/platform/alsa/qalsaintegration_p.h @@ -51,19 +51,19 @@ // We mean it. // -#include +#include QT_BEGIN_NAMESPACE class QAlsaDeviceManager; -class QAlsaIntegration : public QMediaPlatformIntegration +class QAlsaIntegration : public QPlatformMediaIntegration { public: QAlsaIntegration(); ~QAlsaIntegration(); - QMediaPlatformDeviceManager *deviceManager() override; + QPlatformMediaDeviceManager *deviceManager() override; QAlsaDeviceManager *m_manager = nullptr; }; diff --git a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h index 998015d35..709018a08 100644 --- a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h +++ b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h @@ -52,8 +52,8 @@ // We mean it. // -#include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -63,7 +63,7 @@ class QAndroidCameraControl; class QAndroidCameraSession; class QAndroidCameraImageCaptureControl; -class QAndroidCaptureService : public QMediaPlatformCaptureInterface +class QAndroidCaptureService : public QPlatformMediaCapture { Q_OBJECT diff --git a/src/multimedia/platform/android/qandroiddevicemanager.cpp b/src/multimedia/platform/android/qandroiddevicemanager.cpp index 7e313c152..9c40be93f 100644 --- a/src/multimedia/platform/android/qandroiddevicemanager.cpp +++ b/src/multimedia/platform/android/qandroiddevicemanager.cpp @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE QAndroidDeviceManager::QAndroidDeviceManager() - : QMediaPlatformDeviceManager() + : QPlatformMediaDeviceManager() { } diff --git a/src/multimedia/platform/android/qandroiddevicemanager_p.h b/src/multimedia/platform/android/qandroiddevicemanager_p.h index 3c82286da..76499994e 100644 --- a/src/multimedia/platform/android/qandroiddevicemanager_p.h +++ b/src/multimedia/platform/android/qandroiddevicemanager_p.h @@ -51,12 +51,12 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE -class QAndroidDeviceManager : public QMediaPlatformDeviceManager +class QAndroidDeviceManager : public QPlatformMediaDeviceManager { public: QAndroidDeviceManager(); diff --git a/src/multimedia/platform/android/qandroidformatsinfo_p.h b/src/multimedia/platform/android/qandroidformatsinfo_p.h index 461400ed2..8810bb863 100644 --- a/src/multimedia/platform/android/qandroidformatsinfo_p.h +++ b/src/multimedia/platform/android/qandroidformatsinfo_p.h @@ -51,11 +51,11 @@ // We mean it. // -#include +#include QT_BEGIN_NAMESPACE -class QAndroidFormatInfo : public QMediaPlatformFormatInfo +class QAndroidFormatInfo : public QPlatformMediaFormatInfo { public: QAndroidFormatInfo(); diff --git a/src/multimedia/platform/android/qandroidintegration.cpp b/src/multimedia/platform/android/qandroidintegration.cpp index c173bf94e..d744ff952 100644 --- a/src/multimedia/platform/android/qandroidintegration.cpp +++ b/src/multimedia/platform/android/qandroidintegration.cpp @@ -65,14 +65,14 @@ QAndroidIntegration::~QAndroidIntegration() delete m_formatInfo; } -QMediaPlatformDeviceManager *QAndroidIntegration::deviceManager() +QPlatformMediaDeviceManager *QAndroidIntegration::deviceManager() { if (!m_manager) m_manager = new QAndroidDeviceManager(); return m_manager; } -QMediaPlatformFormatInfo *QAndroidIntegration::formatInfo() +QPlatformMediaFormatInfo *QAndroidIntegration::formatInfo() { if (!m_formatInfo) m_formatInfo = new QAndroidFormatInfo(); @@ -80,7 +80,7 @@ QMediaPlatformFormatInfo *QAndroidIntegration::formatInfo() } -QMediaPlatformCaptureInterface *QAndroidIntegration::createCaptureInterface(QMediaRecorder::CaptureMode mode) +QPlatformMediaCaptureInterface *QAndroidIntegration::createCaptureInterface(QMediaRecorder::CaptureMode mode) { return new QAndroidCaptureService(mode); } diff --git a/src/multimedia/platform/android/qandroidintegration_p.h b/src/multimedia/platform/android/qandroidintegration_p.h index f123992b4..b9407f962 100644 --- a/src/multimedia/platform/android/qandroidintegration_p.h +++ b/src/multimedia/platform/android/qandroidintegration_p.h @@ -51,26 +51,26 @@ // We mean it. // -#include +#include QT_BEGIN_NAMESPACE class QAndroidDeviceManager; -class QAndroidIntegration : public QMediaPlatformIntegration +class QAndroidIntegration : public QPlatformMediaIntegration { public: QAndroidIntegration(); ~QAndroidIntegration(); - QMediaPlatformDeviceManager *deviceManager() override; - QMediaPlatformFormatInfo *formatInfo() override; + QPlatformMediaDeviceManager *deviceManager() override; + QPlatformMediaFormatInfo *formatInfo() override; - QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode mode) override; + QPlatformMediaCapture *createCaptureInterface(QMediaRecorder::CaptureMode mode) override; QPlatformMediaPlayer *createPlayer() override; QAndroidDeviceManager *m_manager = nullptr; - QMediaPlatformFormatInfo *m_formatInfo = nullptr; + QPlatformMediaFormatInfo *m_formatInfo = nullptr; }; QT_END_NAMESPACE diff --git a/src/multimedia/platform/darwin/camera/avfcameraservice_p.h b/src/multimedia/platform/darwin/camera/avfcameraservice_p.h index 0cc31bc88..106319207 100644 --- a/src/multimedia/platform/darwin/camera/avfcameraservice_p.h +++ b/src/multimedia/platform/darwin/camera/avfcameraservice_p.h @@ -53,7 +53,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE @@ -67,7 +67,7 @@ class AVFCameraExposureControl; class AVFMediaRecorderControl; class AVFMediaRecorderControlIOS; -class AVFCameraService : public QMediaPlatformCaptureInterface +class AVFCameraService : public QPlatformMediaCapture { Q_OBJECT public: diff --git a/src/multimedia/platform/darwin/qdarwindevicemanager.mm b/src/multimedia/platform/darwin/qdarwindevicemanager.mm index 04802cb99..8aea9d360 100644 --- a/src/multimedia/platform/darwin/qdarwindevicemanager.mm +++ b/src/multimedia/platform/darwin/qdarwindevicemanager.mm @@ -153,7 +153,7 @@ audioDeviceChangeListener(AudioObjectID, UInt32, const AudioObjectPropertyAddres QDarwinDeviceManager::QDarwinDeviceManager() - : QMediaPlatformDeviceManager() + : QPlatformMediaDeviceManager() { NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; m_deviceConnectedObserver = [notificationCenter addObserverForName:AVCaptureDeviceWasConnectedNotification diff --git a/src/multimedia/platform/darwin/qdarwindevicemanager_p.h b/src/multimedia/platform/darwin/qdarwindevicemanager_p.h index d52b2e0c5..cbace9330 100644 --- a/src/multimedia/platform/darwin/qdarwindevicemanager_p.h +++ b/src/multimedia/platform/darwin/qdarwindevicemanager_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include @@ -63,7 +63,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(AVCaptureDeviceDiscoverySession); class QCameraInfo; -class QDarwinDeviceManager : public QMediaPlatformDeviceManager +class QDarwinDeviceManager : public QPlatformMediaDeviceManager { public: QDarwinDeviceManager(); diff --git a/src/multimedia/platform/darwin/qdarwinformatsinfo_p.h b/src/multimedia/platform/darwin/qdarwinformatsinfo_p.h index 44e03c5b2..ad8a706bd 100644 --- a/src/multimedia/platform/darwin/qdarwinformatsinfo_p.h +++ b/src/multimedia/platform/darwin/qdarwinformatsinfo_p.h @@ -51,14 +51,14 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE class QDarwinDeviceManager; -class QDarwinFormatInfo : public QMediaPlatformFormatInfo +class QDarwinFormatInfo : public QPlatformMediaFormatInfo { public: QDarwinFormatInfo(); diff --git a/src/multimedia/platform/darwin/qdarwinintegration.cpp b/src/multimedia/platform/darwin/qdarwinintegration.cpp index 7a93880ed..1d55fad1b 100644 --- a/src/multimedia/platform/darwin/qdarwinintegration.cpp +++ b/src/multimedia/platform/darwin/qdarwinintegration.cpp @@ -56,21 +56,21 @@ QDarwinIntegration::~QDarwinIntegration() delete m_formatInfo; } -QMediaPlatformDeviceManager *QDarwinIntegration::deviceManager() +QPlatformMediaDeviceManager *QDarwinIntegration::deviceManager() { if (!m_manager) m_manager = new QDarwinDeviceManager(); return m_manager; } -QMediaPlatformFormatInfo *QDarwinIntegration::formatInfo() +QPlatformMediaFormatInfo *QDarwinIntegration::formatInfo() { if (!m_formatInfo) m_formatInfo = new QDarwinFormatInfo(); return m_formatInfo; } -QMediaPlatformCaptureInterface *QDarwinIntegration::createCaptureInterface(QMediaRecorder::CaptureMode) +QPlatformMediaCaptureInterface *QDarwinIntegration::createCaptureInterface(QMediaRecorder::CaptureMode) { return new AVFCameraService; } diff --git a/src/multimedia/platform/darwin/qdarwinintegration_p.h b/src/multimedia/platform/darwin/qdarwinintegration_p.h index 8e0dbc7bd..d0dee6474 100644 --- a/src/multimedia/platform/darwin/qdarwinintegration_p.h +++ b/src/multimedia/platform/darwin/qdarwinintegration_p.h @@ -51,26 +51,26 @@ // We mean it. // -#include +#include QT_BEGIN_NAMESPACE class QDarwinDeviceManager; -class QDarwinIntegration : public QMediaPlatformIntegration +class QDarwinIntegration : public QPlatformMediaIntegration { public: QDarwinIntegration(); ~QDarwinIntegration(); - QMediaPlatformDeviceManager *deviceManager() override; - QMediaPlatformFormatInfo *formatInfo() override; + QPlatformMediaDeviceManager *deviceManager() override; + QPlatformMediaFormatInfo *formatInfo() override; - QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode /*mode*/) override; + QPlatformMediaCapture *createCaptureInterface(QMediaRecorder::CaptureMode /*mode*/) override; QPlatformMediaPlayer *createPlayer() override; QDarwinDeviceManager *m_manager = nullptr; - QMediaPlatformFormatInfo *m_formatInfo = nullptr; + QPlatformMediaFormatInfo *m_formatInfo = nullptr; }; QT_END_NAMESPACE diff --git a/src/multimedia/platform/gstreamer/audio/qaudiodeviceinfo_gstreamer.cpp b/src/multimedia/platform/gstreamer/audio/qaudiodeviceinfo_gstreamer.cpp index 68279a25a..e090e3b03 100644 --- a/src/multimedia/platform/gstreamer/audio/qaudiodeviceinfo_gstreamer.cpp +++ b/src/multimedia/platform/gstreamer/audio/qaudiodeviceinfo_gstreamer.cpp @@ -41,7 +41,7 @@ #include "qaudioengine_gstreamer_p.h" #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE QGStreamerAudioDeviceInfo::QGStreamerAudioDeviceInfo(const QByteArray &device, QAudio::Mode mode) : QAudioDeviceInfoPrivate(device, mode) { - auto *deviceManager = static_cast(QMediaPlatformIntegration::instance()->deviceManager()); + auto *deviceManager = static_cast(QPlatformMediaIntegration::instance()->deviceManager()); gstDevice = deviceManager->audioDevice(device, mode); if (gstDevice) { gst_object_ref(gstDevice); diff --git a/src/multimedia/platform/gstreamer/audio/qaudioengine_gstreamer.cpp b/src/multimedia/platform/gstreamer/audio/qaudioengine_gstreamer.cpp index 42bb49ba6..c7ccaeac1 100644 --- a/src/multimedia/platform/gstreamer/audio/qaudioengine_gstreamer.cpp +++ b/src/multimedia/platform/gstreamer/audio/qaudioengine_gstreamer.cpp @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include #include @@ -67,7 +67,7 @@ QGStreamerAudioEngine *QGStreamerAudioEngine::instance() QList QGStreamerAudioEngine::availableDevices(QAudio::Mode mode) const { - auto *m = QMediaPlatformIntegration::instance()->deviceManager(); + auto *m = QPlatformMediaIntegration::instance()->deviceManager(); const auto devices = (mode == QAudio::AudioOutput) ? m->audioOutputs() : m->audioInputs(); QList list; for (auto d : devices) @@ -77,7 +77,7 @@ QList QGStreamerAudioEngine::availableDevices(QAudio::Mode mode) con QByteArray QGStreamerAudioEngine::defaultDevice(QAudio::Mode mode) const { - auto *m = QMediaPlatformIntegration::instance()->deviceManager(); + auto *m = QPlatformMediaIntegration::instance()->deviceManager(); const auto devices = (mode == QAudio::AudioOutput) ? m->audioOutputs() : m->audioInputs(); return devices.value(0).id(); } diff --git a/src/multimedia/platform/gstreamer/camerabin/camerabinsession.cpp b/src/multimedia/platform/gstreamer/camerabin/camerabinsession.cpp index 1f1e85f70..d826fc101 100644 --- a/src/multimedia/platform/gstreamer/camerabin/camerabinsession.cpp +++ b/src/multimedia/platform/gstreamer/camerabin/camerabinsession.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #if QT_CONFIG(gstreamer_photography) @@ -480,7 +480,7 @@ GstElement *CameraBinSession::buildCameraSource() for (const QByteArray &source : sources) { QList keyValue = source.split('='); QByteArray name = keyValue.at(0); - auto deviceManager = static_cast(QMediaPlatformIntegration::instance()->deviceManager()); + auto deviceManager = static_cast(QPlatformMediaIntegration::instance()->deviceManager()); if (keyValue.count() > 1 && keyValue.at(0) == deviceManager->cameraDriver(m_inputDevice)) name = keyValue.at(1); diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h index 955fab52c..6f1cdff6b 100644 --- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h +++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice_p.h @@ -51,8 +51,8 @@ // We mean it. // -#include -#include +#include +#include #include @@ -66,7 +66,7 @@ class QGstreamerVideoRenderer; class QGstreamerVideoWindow; class QGstreamerVideoInput; -class QGstreamerCaptureService : public QMediaPlatformCaptureInterface +class QGstreamerCaptureService : public QPlatformMediaCapture { Q_OBJECT diff --git a/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp b/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp index 3706ed278..f424a9842 100644 --- a/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp +++ b/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp @@ -72,7 +72,7 @@ static gboolean deviceMonitor(GstBus *, GstMessage *message, gpointer m) } QGstreamerDeviceManager::QGstreamerDeviceManager() - : QMediaPlatformDeviceManager() + : QPlatformMediaDeviceManager() { QGstUtils::initializeGst(); diff --git a/src/multimedia/platform/gstreamer/qgstreamerdevicemanager_p.h b/src/multimedia/platform/gstreamer/qgstreamerdevicemanager_p.h index ab639c586..102d2cc8e 100644 --- a/src/multimedia/platform/gstreamer/qgstreamerdevicemanager_p.h +++ b/src/multimedia/platform/gstreamer/qgstreamerdevicemanager_p.h @@ -51,14 +51,14 @@ // We mean it. // -#include +#include #include #include #include QT_BEGIN_NAMESPACE -class QGstreamerDeviceManager : public QMediaPlatformDeviceManager +class QGstreamerDeviceManager : public QPlatformMediaDeviceManager { public: QGstreamerDeviceManager(); diff --git a/src/multimedia/platform/gstreamer/qgstreamerformatsinfo_p.h b/src/multimedia/platform/gstreamer/qgstreamerformatsinfo_p.h index cb9d4d880..881a4e86e 100644 --- a/src/multimedia/platform/gstreamer/qgstreamerformatsinfo_p.h +++ b/src/multimedia/platform/gstreamer/qgstreamerformatsinfo_p.h @@ -51,14 +51,14 @@ // We mean it. // -#include +#include #include #include #include QT_BEGIN_NAMESPACE -class QGstreamerFormatsInfo : public QMediaPlatformFormatInfo +class QGstreamerFormatsInfo : public QPlatformMediaFormatInfo { public: QGstreamerFormatsInfo(); diff --git a/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp b/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp index bd42d362d..69f77cef2 100644 --- a/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp +++ b/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp @@ -58,14 +58,14 @@ QGstreamerIntegration::~QGstreamerIntegration() delete m_formatsInfo; } -QMediaPlatformDeviceManager *QGstreamerIntegration::deviceManager() +QPlatformMediaDeviceManager *QGstreamerIntegration::deviceManager() { if (!m_manager) m_manager = new QGstreamerDeviceManager(); return m_manager; } -QMediaPlatformFormatInfo *QGstreamerIntegration::formatInfo() +QPlatformMediaFormatInfo *QGstreamerIntegration::formatInfo() { if (!m_formatsInfo) m_formatsInfo = new QGstreamerFormatsInfo(); @@ -77,7 +77,7 @@ QAudioDecoderControl *QGstreamerIntegration::createAudioDecoder() return new QGstreamerAudioDecoderControl(nullptr); } -QMediaPlatformCaptureInterface *QGstreamerIntegration::createCaptureInterface(QMediaRecorder::CaptureMode mode) +QPlatformMediaCapture *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 6eca24ebf..dd0401957 100644 --- a/src/multimedia/platform/gstreamer/qgstreamerintegration_p.h +++ b/src/multimedia/platform/gstreamer/qgstreamerintegration_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include QT_BEGIN_NAMESPACE @@ -59,18 +59,18 @@ class QGstreamerDeviceManager; class QGstreamerPlayerInterface; class QGstreamerFormatsInfo; -class QGstreamerIntegration : public QMediaPlatformIntegration +class QGstreamerIntegration : public QPlatformMediaIntegration { public: QGstreamerIntegration(); ~QGstreamerIntegration(); - static QGstreamerIntegration *instance() { return static_cast(QMediaPlatformIntegration::instance()); } - QMediaPlatformDeviceManager *deviceManager() override; - QMediaPlatformFormatInfo *formatInfo() override; + static QGstreamerIntegration *instance() { return static_cast(QPlatformMediaIntegration::instance()); } + QPlatformMediaDeviceManager *deviceManager() override; + QPlatformMediaFormatInfo *formatInfo() override; QAudioDecoderControl *createAudioDecoder() override; - QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode mode) override; + QPlatformMediaCapture *createCaptureInterface(QMediaRecorder::CaptureMode mode) override; QPlatformMediaPlayer *createPlayer() override; QGstreamerDeviceManager *m_manager = nullptr; diff --git a/src/multimedia/platform/platform.pri b/src/multimedia/platform/platform.pri index 6ac9c6a7f..afce76b54 100644 --- a/src/multimedia/platform/platform.pri +++ b/src/multimedia/platform/platform.pri @@ -1,14 +1,14 @@ HEADERS += \ - $$PWD/qmediaplatformcaptureinterface_p.h \ - $$PWD/qmediaplatformintegration_p.h \ - $$PWD/qmediaplatformdevicemanager_p.h \ - $$PWD/qmediaplatformformatinfo_p.h + $$PWD/qplatformmediacaptureinterface_p.h \ + $$PWD/qplatformmediaintegration_p.h \ + $$PWD/qplatformmediadevicemanager_p.h \ + $$PWD/qplatformmediaformatinfo_p.h SOURCES += \ - $$PWD/qmediaplatformcaptureinterface.cpp \ - $$PWD/qmediaplatformintegration.cpp \ - $$PWD/qmediaplatformdevicemanager.cpp \ - $$PWD/qmediaplatformformatinfo.cpp + $$PWD/qplatformmediacaptureinterface.cpp \ + $$PWD/qplatformmediaintegration.cpp \ + $$PWD/qplatformmediadevicemanager.cpp \ + $$PWD/qplatformmediaformatinfo.cpp qtConfig(gstreamer):include(gstreamer/gstreamer.pri) qtConfig(pulseaudio): include(pulseaudio/pulseaudio.pri) diff --git a/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager.cpp b/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager.cpp index 051b39adf..2562b2a53 100644 --- a/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager.cpp +++ b/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE QPulseAudioDeviceManager::QPulseAudioDeviceManager(QPulseAudioEngine *engine) - : QMediaPlatformDeviceManager(), + : QPlatformMediaDeviceManager(), pulseEngine(engine) { } diff --git a/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager_p.h b/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager_p.h index cb0d20032..8f5054bc7 100644 --- a/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager_p.h +++ b/src/multimedia/platform/pulseaudio/qpulseaudiodevicemanager_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE class QPulseAudioEngine; -class QPulseAudioDeviceManager : public QMediaPlatformDeviceManager +class QPulseAudioDeviceManager : public QPlatformMediaDeviceManager { public: QPulseAudioDeviceManager(QPulseAudioEngine *engine); diff --git a/src/multimedia/platform/pulseaudio/qpulseaudiointegration.cpp b/src/multimedia/platform/pulseaudio/qpulseaudiointegration.cpp index 6465ce446..59a1f991a 100644 --- a/src/multimedia/platform/pulseaudio/qpulseaudiointegration.cpp +++ b/src/multimedia/platform/pulseaudio/qpulseaudiointegration.cpp @@ -52,7 +52,7 @@ QPulseAudioIntegration::~QPulseAudioIntegration() delete m_manager; } -QMediaPlatformDeviceManager *QPulseAudioIntegration::deviceManager() +QPlatformMediaDeviceManager *QPulseAudioIntegration::deviceManager() { if (!m_manager) m_manager = new QPulseAudioDeviceManager(pulseEngine); diff --git a/src/multimedia/platform/pulseaudio/qpulseaudiointegration_p.h b/src/multimedia/platform/pulseaudio/qpulseaudiointegration_p.h index 688434ebf..9f7f8d50d 100644 --- a/src/multimedia/platform/pulseaudio/qpulseaudiointegration_p.h +++ b/src/multimedia/platform/pulseaudio/qpulseaudiointegration_p.h @@ -51,20 +51,20 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE class QPulseAudioDeviceManager; -class QPulseAudioIntegration : public QMediaPlatformIntegration +class QPulseAudioIntegration : public QPlatformMediaIntegration { public: QPulseAudioIntegration(); ~QPulseAudioIntegration(); - QMediaPlatformDeviceManager *deviceManager() override; + QPlatformMediaDeviceManager *deviceManager() override; QPulseAudioDeviceManager *m_manager = nullptr; QPulseAudioEngine *pulseEngine = nullptr; diff --git a/src/multimedia/platform/qmediaplatformcaptureinterface.cpp b/src/multimedia/platform/qmediaplatformcaptureinterface.cpp deleted file mode 100644 index 3feb8482e..000000000 --- a/src/multimedia/platform/qmediaplatformcaptureinterface.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 -#include "qmediaplatformcaptureinterface_p.h" - -QT_BEGIN_NAMESPACE - -QMediaPlatformCaptureInterface::~QMediaPlatformCaptureInterface() -{ - -} - -QT_END_NAMESPACE diff --git a/src/multimedia/platform/qmediaplatformcaptureinterface_p.h b/src/multimedia/platform/qmediaplatformcaptureinterface_p.h deleted file mode 100644 index a18619574..000000000 --- a/src/multimedia/platform/qmediaplatformcaptureinterface_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 QMEDIAPLATFORMCAPTUREINTERFACE_H -#define QMEDIAPLATFORMCAPTUREINTERFACE_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 -#include - -QT_BEGIN_NAMESPACE -class QCameraControl; -class QCameraImageCaptureControl; -class QMediaRecorderControl; - -class Q_MULTIMEDIA_EXPORT QMediaPlatformCaptureInterface : public QObject -{ -public: - QMediaPlatformCaptureInterface() = default; - virtual ~QMediaPlatformCaptureInterface(); - - virtual QCameraControl *cameraControl() = 0; - virtual QCameraImageCaptureControl *imageCaptureControl() = 0; - virtual QMediaRecorderControl *mediaRecorderControl() = 0; -}; - -QT_END_NAMESPACE - - -#endif // QMEDIAPLATFORMINTERFACE_H diff --git a/src/multimedia/platform/qmediaplatformdevicemanager.cpp b/src/multimedia/platform/qmediaplatformdevicemanager.cpp deleted file mode 100644 index 868e9c569..000000000 --- a/src/multimedia/platform/qmediaplatformdevicemanager.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 "qmediaplatformdevicemanager_p.h" -#include "qaudiodeviceinfo.h" -#include "qcamerainfo.h" -#include "qaudiosystem_p.h" - -QT_BEGIN_NAMESPACE - -QMediaPlatformDeviceManager::QMediaPlatformDeviceManager() -{ -} - -QMediaPlatformDeviceManager::~QMediaPlatformDeviceManager() -{ -} - -QAudioDeviceInfo QMediaPlatformDeviceManager::audioInput(const QByteArray &id) const -{ - const auto inputs = audioInputs(); - for (auto i : inputs) { - if (i.id() == id) - return i; - } - return {}; -} - -QAudioDeviceInfo QMediaPlatformDeviceManager::audioOutput(const QByteArray &id) const -{ - const auto outputs = audioOutputs(); - for (auto o : outputs) { - if (o.id() == id) - return o; - } - return {}; -} - -QCameraInfo QMediaPlatformDeviceManager::videoInput(const QByteArray &id) const -{ - const auto inputs = videoInputs(); - for (auto i : inputs) { - if (i.id() == id) - return i; - } - return QCameraInfo(); -} - -QAbstractAudioInput* QMediaPlatformDeviceManager::audioInputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo) -{ - QAudioDeviceInfo info = deviceInfo; - if (info.isNull()) - info = audioInputs().value(0); - - QAbstractAudioInput* p = createAudioInputDevice(info); - if (p) - p->setFormat(format); - return p; -} - -QAbstractAudioOutput* QMediaPlatformDeviceManager::audioOutputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo) -{ - QAudioDeviceInfo info = deviceInfo; - if (info.isNull()) - info = audioOutputs().value(0); - - QAbstractAudioOutput* p = createAudioOutputDevice(info); - if (p) - p->setFormat(format); - return p; -} - - -QT_END_NAMESPACE diff --git a/src/multimedia/platform/qmediaplatformdevicemanager_p.h b/src/multimedia/platform/qmediaplatformdevicemanager_p.h deleted file mode 100644 index f6d1dc9ed..000000000 --- a/src/multimedia/platform/qmediaplatformdevicemanager_p.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 QMEDIAPLATFORMDEVICEMANAGER_H -#define QMEDIAPLATFORMDEVICEMANAGER_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 - -QT_BEGIN_NAMESPACE - -class QMediaDeviceManager; -class QAudioDeviceInfo; -class QCameraInfo; -class QAbstractAudioInput; -class QAbstractAudioOutput; -class QAudioFormat; - -class Q_AUTOTEST_EXPORT QMediaPlatformDeviceManager -{ -public: - QMediaPlatformDeviceManager(); - virtual ~QMediaPlatformDeviceManager(); - - virtual QList audioInputs() const = 0; - virtual QList audioOutputs() const = 0; - virtual QList videoInputs() const = 0; - virtual QAbstractAudioInput *createAudioInputDevice(const QAudioDeviceInfo &deviceInfo) = 0; - virtual QAbstractAudioOutput *createAudioOutputDevice(const QAudioDeviceInfo &deviceInfo) = 0; - - QAudioDeviceInfo audioInput(const QByteArray &id) const; - QAudioDeviceInfo audioOutput(const QByteArray &id) const; - QCameraInfo videoInput(const QByteArray &id) const; - - QAbstractAudioInput *audioInputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo); - QAbstractAudioOutput *audioOutputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo); - - QMediaDeviceManager *deviceManager() const { return m_manager; } - void setDeviceManager(QMediaDeviceManager *m) - { - Q_ASSERT(!m_manager); - m_manager = m; - } - -private: - QMediaDeviceManager *m_manager = nullptr; -}; - -QT_END_NAMESPACE - - -#endif // QMEDIAPLATFORMDEVICEMANAGER_H diff --git a/src/multimedia/platform/qmediaplatformformatinfo.cpp b/src/multimedia/platform/qmediaplatformformatinfo.cpp deleted file mode 100644 index 20a5d580c..000000000 --- a/src/multimedia/platform/qmediaplatformformatinfo.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 "qmediaplatformformatinfo_p.h" -#include - -QT_BEGIN_NAMESPACE - -QMediaPlatformFormatInfo::QMediaPlatformFormatInfo() = default; - -QMediaPlatformFormatInfo::~QMediaPlatformFormatInfo() = default; - -QList QMediaPlatformFormatInfo::supportedFileFormats(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const -{ - QSet formats; - - const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; - for (const auto &m : codecMap) { - if (constraints.mode() == QMediaFormat::AudioAndVideo && m.video.isEmpty()) - continue; - if (constraints.audioCodec() != QMediaFormat::AudioCodec::Unspecified && !m.audio.contains(constraints.audioCodec())) - continue; - if (constraints.videoCodec() != QMediaFormat::VideoCodec::Unspecified && !m.video.contains(constraints.videoCodec())) - continue; - formats.insert(m.format); - } - return formats.values(); -} - -QList QMediaPlatformFormatInfo::supportedAudioCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const -{ - QSet codecs; - - const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; - for (const auto &m : codecMap) { - if (constraints.format() != QMediaFormat::UnspecifiedFormat && m.format != constraints.format()) - continue; - if (constraints.videoCodec() != QMediaFormat::VideoCodec::Unspecified && !m.video.contains(constraints.videoCodec())) - continue; - for (const auto &c : m.audio) - codecs.insert(c); - } - return codecs.values(); -} - -QList QMediaPlatformFormatInfo::supportedVideoCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const -{ - if (constraints.mode() == QMediaFormat::AudioOnly) - return {}; - - QSet codecs; - - const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; - for (const auto &m : codecMap) { - if (constraints.format() != QMediaFormat::UnspecifiedFormat && m.format != constraints.format()) - continue; - if (constraints.audioCodec() != QMediaFormat::AudioCodec::Unspecified && !m.audio.contains(constraints.audioCodec())) - continue; - for (const auto &c : m.video) - codecs.insert(c); - } - return codecs.values(); -} - -bool QMediaPlatformFormatInfo::isSupported(const QMediaFormat &format, QMediaFormat::ConversionMode m) const -{ - const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; - - for (const auto &m : codecMap) { - if (m.format != format.format()) - continue; - if (!m.audio.contains(format.audioCodec())) - continue; - if (format.mode() == QMediaFormat::AudioAndVideo && !m.video.contains(format.videoCodec())) - continue; - return true; - } - return false; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/platform/qmediaplatformformatinfo_p.h b/src/multimedia/platform/qmediaplatformformatinfo_p.h deleted file mode 100644 index 05ea7b495..000000000 --- a/src/multimedia/platform/qmediaplatformformatinfo_p.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 QMEDIAPLATFORMFORMATINFO_H -#define QMEDIAPLATFORMFORMATINFO_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 -#include - -QT_BEGIN_NAMESPACE - -class Q_AUTOTEST_EXPORT QMediaPlatformFormatInfo -{ -public: - QMediaPlatformFormatInfo(); - virtual ~QMediaPlatformFormatInfo(); - - QList supportedFileFormats(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const; - QList supportedAudioCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const; - QList supportedVideoCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const; - - bool isSupported(const QMediaFormat &format, QMediaFormat::ConversionMode m) const; - - struct CodecMap { - QMediaFormat::FileFormat format; - QList audio; - QList video; - }; - QList encoders; - QList decoders; - - QList imageFormats; -}; - -QT_END_NAMESPACE - - -#endif // QMEDIAPLATFORMDEVICEMANAGER_H diff --git a/src/multimedia/platform/qmediaplatformintegration.cpp b/src/multimedia/platform/qmediaplatformintegration.cpp deleted file mode 100644 index 50b12de3d..000000000 --- a/src/multimedia/platform/qmediaplatformintegration.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 -#include "qmediaplatformintegration_p.h" - -#if QT_CONFIG(gstreamer) -#include -using PlatformIntegration = QGstreamerIntegration; -#elif QT_CONFIG(pulseaudio) -#include -using PlatformIntegration = QPulseAudioIntegration; -#elif QT_CONFIG(alsa) -#include -using PlatformIntegration = QAlsaIntegration; -#elif QT_CONFIG(avfoundation) -#include -using PlatformIntegration = QDarwinIntegration; -#elif defined(Q_OS_WIN) -#include -using PlatformIntegration = QWindowsIntegration; -#elif defined(Q_OS_ANDROID) -#include -using PlatformIntegration = QAndroidIntegration; -#endif - -QT_BEGIN_NAMESPACE - -namespace { -struct Holder { - ~Holder() - { - delete instance; - instance = nullptr; - } - QMediaPlatformIntegration *instance = nullptr; -} holder; - -} - -QMediaPlatformIntegration *QMediaPlatformIntegration::instance() -{ - if (!holder.instance) { - holder.instance = new PlatformIntegration; - } - return holder.instance; -} - -/* - This API is there to be able to test with a mock backend. -*/ -void QMediaPlatformIntegration::setIntegration(QMediaPlatformIntegration *integration) -{ - holder.instance = integration; -} - -QMediaPlatformIntegration::~QMediaPlatformIntegration() -{ - -} - -QT_END_NAMESPACE diff --git a/src/multimedia/platform/qmediaplatformintegration_p.h b/src/multimedia/platform/qmediaplatformintegration_p.h deleted file mode 100644 index 5accc0423..000000000 --- a/src/multimedia/platform/qmediaplatformintegration_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 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 QMEDIAPLATFORMINTEGRATION_H -#define QMEDIAPLATFORMINTEGRATION_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 -#include - -QT_BEGIN_NAMESPACE - -class QMediaDeviceManager; -class QMediaPlatformDeviceManager; -class QMediaPlatformCaptureInterface; -class QPlatformMediaPlayer; -class QAudioDecoderControl; -class QMediaPlatformFormatInfo; -class QVideoRendererControl; - -class Q_MULTIMEDIA_EXPORT QMediaPlatformIntegration -{ -public: - static QMediaPlatformIntegration *instance(); - - // API to be able to test with a mock backend - static void setIntegration(QMediaPlatformIntegration *); - - virtual ~QMediaPlatformIntegration(); - virtual QMediaPlatformDeviceManager *deviceManager() = 0; - virtual QMediaPlatformFormatInfo *formatInfo() = 0; - - virtual QAudioDecoderControl *createAudioDecoder() { return nullptr; } - virtual QMediaPlatformCaptureInterface *createCaptureInterface(QMediaRecorder::CaptureMode /*mode*/) { return nullptr; } - virtual QPlatformMediaPlayer *createPlayer() { return nullptr; } -}; - -QT_END_NAMESPACE - - -#endif // QMEDIAPLATFORMINTERFACE_H diff --git a/src/multimedia/platform/qnx/camera/bbcameraservice_p.h b/src/multimedia/platform/qnx/camera/bbcameraservice_p.h index 5bfc92b6d..786f3d8f7 100644 --- a/src/multimedia/platform/qnx/camera/bbcameraservice_p.h +++ b/src/multimedia/platform/qnx/camera/bbcameraservice_p.h @@ -52,7 +52,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE @@ -67,7 +67,7 @@ class BbCameraSession; class BbCameraVideoEncoderSettingsControl; class BbVideoRendererControl; -class BbCameraService : public QMediaPlatformCaptureInterface +class BbCameraService : public QPlatformMediaCapture { Q_OBJECT diff --git a/src/multimedia/platform/qnx/mediaplayer/mmrenderermediaplayerservice_p.h b/src/multimedia/platform/qnx/mediaplayer/mmrenderermediaplayerservice_p.h index b028fa465..c53a2f4b7 100644 --- a/src/multimedia/platform/qnx/mediaplayer/mmrenderermediaplayerservice_p.h +++ b/src/multimedia/platform/qnx/mediaplayer/mmrenderermediaplayerservice_p.h @@ -50,7 +50,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE @@ -59,14 +59,14 @@ class MmRendererMediaPlayerControl; class MmRendererPlayerVideoRendererControl; class MmRendererVideoWindowControl; -class MmRendererMediaPlayerService : public QMediaPlatformPlayerInterface +class MmRendererMediaPlayerService : public QPlatformMediaPlayerInterface { Q_OBJECT public: explicit MmRendererMediaPlayerService(QObject *parent = 0); ~MmRendererMediaPlayerService(); - // QMediaPlatformPlayerInterface + // QPlatformMediaPlayerInterface QPlatformMediaPlayer *player() override; // QMediaStreamsControl *streams() override; diff --git a/src/multimedia/platform/qnx/qqnxdevicemanager_p.h b/src/multimedia/platform/qnx/qqnxdevicemanager_p.h index 3ef61c78a..803660384 100644 --- a/src/multimedia/platform/qnx/qqnxdevicemanager_p.h +++ b/src/multimedia/platform/qnx/qqnxdevicemanager_p.h @@ -51,12 +51,12 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE -class QQnxDeviceManager : public QMediaPlatformDeviceManager +class QQnxDeviceManager : public QPlatformMediaDeviceManager { public: QQnxDeviceManager(); diff --git a/src/multimedia/platform/qnx/qqnxintegration_p.h b/src/multimedia/platform/qnx/qqnxintegration_p.h index 67ffb2f9c..3770f5d03 100644 --- a/src/multimedia/platform/qnx/qqnxintegration_p.h +++ b/src/multimedia/platform/qnx/qqnxintegration_p.h @@ -51,22 +51,22 @@ // We mean it. // -#include +#include QT_BEGIN_NAMESPACE class QQnxDeviceManager; class QQnxPlayerInterface; -class QQnxIntegration : public QMediaPlatformIntegration +class QQnxIntegration : public QPlatformMediaIntegration { public: QQnxIntegration(); ~QQnxIntegration(); - QMediaPlatformDeviceManager *deviceManager() override; + QPlatformMediaDeviceManager *deviceManager() override; - QMediaPlatformPlayerInterface *createPlayerInterface() override; + QPlatformMediaPlayerInterface *createPlayerInterface() override; QQnxDeviceManager *m_manager = nullptr; }; diff --git a/src/multimedia/platform/qplatformmediacapture.cpp b/src/multimedia/platform/qplatformmediacapture.cpp new file mode 100644 index 000000000..5f84cbdaa --- /dev/null +++ b/src/multimedia/platform/qplatformmediacapture.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 +#include "qplatformmediacapture_p.h" + +QT_BEGIN_NAMESPACE + +QPlatformMediaCapture::~QPlatformMediaCapture() +{ + +} + +QT_END_NAMESPACE diff --git a/src/multimedia/platform/qplatformmediacapture_p.h b/src/multimedia/platform/qplatformmediacapture_p.h new file mode 100644 index 000000000..ed8ad999f --- /dev/null +++ b/src/multimedia/platform/qplatformmediacapture_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 QPLATFORMMEDIACAPTURE_H +#define QPLATFORMMEDIACAPTURE_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 +#include + +QT_BEGIN_NAMESPACE +class QCameraControl; +class QCameraImageCaptureControl; +class QMediaRecorderControl; + +class Q_MULTIMEDIA_EXPORT QPlatformMediaCapture : public QObject +{ +public: + QPlatformMediaCapture() = default; + virtual ~QPlatformMediaCapture(); + + virtual QCameraControl *cameraControl() = 0; + virtual QCameraImageCaptureControl *imageCaptureControl() = 0; + virtual QMediaRecorderControl *mediaRecorderControl() = 0; +}; + +QT_END_NAMESPACE + + +#endif // QPLATFORMMEDIAINTERFACE_H diff --git a/src/multimedia/platform/qplatformmediadevicemanager.cpp b/src/multimedia/platform/qplatformmediadevicemanager.cpp new file mode 100644 index 000000000..e5a61a7b8 --- /dev/null +++ b/src/multimedia/platform/qplatformmediadevicemanager.cpp @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 "qplatformmediadevicemanager_p.h" +#include "qaudiodeviceinfo.h" +#include "qcamerainfo.h" +#include "qaudiosystem_p.h" + +QT_BEGIN_NAMESPACE + +QPlatformMediaDeviceManager::QPlatformMediaDeviceManager() +{ +} + +QPlatformMediaDeviceManager::~QPlatformMediaDeviceManager() +{ +} + +QAudioDeviceInfo QPlatformMediaDeviceManager::audioInput(const QByteArray &id) const +{ + const auto inputs = audioInputs(); + for (auto i : inputs) { + if (i.id() == id) + return i; + } + return {}; +} + +QAudioDeviceInfo QPlatformMediaDeviceManager::audioOutput(const QByteArray &id) const +{ + const auto outputs = audioOutputs(); + for (auto o : outputs) { + if (o.id() == id) + return o; + } + return {}; +} + +QCameraInfo QPlatformMediaDeviceManager::videoInput(const QByteArray &id) const +{ + const auto inputs = videoInputs(); + for (auto i : inputs) { + if (i.id() == id) + return i; + } + return QCameraInfo(); +} + +QAbstractAudioInput* QPlatformMediaDeviceManager::audioInputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo) +{ + QAudioDeviceInfo info = deviceInfo; + if (info.isNull()) + info = audioInputs().value(0); + + QAbstractAudioInput* p = createAudioInputDevice(info); + if (p) + p->setFormat(format); + return p; +} + +QAbstractAudioOutput* QPlatformMediaDeviceManager::audioOutputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo) +{ + QAudioDeviceInfo info = deviceInfo; + if (info.isNull()) + info = audioOutputs().value(0); + + QAbstractAudioOutput* p = createAudioOutputDevice(info); + if (p) + p->setFormat(format); + return p; +} + + +QT_END_NAMESPACE diff --git a/src/multimedia/platform/qplatformmediadevicemanager_p.h b/src/multimedia/platform/qplatformmediadevicemanager_p.h new file mode 100644 index 000000000..9a8af446c --- /dev/null +++ b/src/multimedia/platform/qplatformmediadevicemanager_p.h @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 QPLATFORMMEDIADEVICEMANAGER_H +#define QPLATFORMMEDIADEVICEMANAGER_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 + +QT_BEGIN_NAMESPACE + +class QMediaDeviceManager; +class QAudioDeviceInfo; +class QCameraInfo; +class QAbstractAudioInput; +class QAbstractAudioOutput; +class QAudioFormat; + +class Q_AUTOTEST_EXPORT QPlatformMediaDeviceManager +{ +public: + QPlatformMediaDeviceManager(); + virtual ~QPlatformMediaDeviceManager(); + + virtual QList audioInputs() const = 0; + virtual QList audioOutputs() const = 0; + virtual QList videoInputs() const = 0; + virtual QAbstractAudioInput *createAudioInputDevice(const QAudioDeviceInfo &deviceInfo) = 0; + virtual QAbstractAudioOutput *createAudioOutputDevice(const QAudioDeviceInfo &deviceInfo) = 0; + + QAudioDeviceInfo audioInput(const QByteArray &id) const; + QAudioDeviceInfo audioOutput(const QByteArray &id) const; + QCameraInfo videoInput(const QByteArray &id) const; + + QAbstractAudioInput *audioInputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo); + QAbstractAudioOutput *audioOutputDevice(const QAudioFormat &format, const QAudioDeviceInfo &deviceInfo); + + QMediaDeviceManager *deviceManager() const { return m_manager; } + void setDeviceManager(QMediaDeviceManager *m) + { + Q_ASSERT(!m_manager); + m_manager = m; + } + +private: + QMediaDeviceManager *m_manager = nullptr; +}; + +QT_END_NAMESPACE + + +#endif // QPLATFORMMEDIADEVICEMANAGER_H diff --git a/src/multimedia/platform/qplatformmediaformatinfo.cpp b/src/multimedia/platform/qplatformmediaformatinfo.cpp new file mode 100644 index 000000000..2012cd8e4 --- /dev/null +++ b/src/multimedia/platform/qplatformmediaformatinfo.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 "qplatformmediaformatinfo_p.h" +#include + +QT_BEGIN_NAMESPACE + +QPlatformMediaFormatInfo::QPlatformMediaFormatInfo() = default; + +QPlatformMediaFormatInfo::~QPlatformMediaFormatInfo() = default; + +QList QPlatformMediaFormatInfo::supportedFileFormats(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const +{ + QSet formats; + + const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; + for (const auto &m : codecMap) { + if (constraints.mode() == QMediaFormat::AudioAndVideo && m.video.isEmpty()) + continue; + if (constraints.audioCodec() != QMediaFormat::AudioCodec::Unspecified && !m.audio.contains(constraints.audioCodec())) + continue; + if (constraints.videoCodec() != QMediaFormat::VideoCodec::Unspecified && !m.video.contains(constraints.videoCodec())) + continue; + formats.insert(m.format); + } + return formats.values(); +} + +QList QPlatformMediaFormatInfo::supportedAudioCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const +{ + QSet codecs; + + const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; + for (const auto &m : codecMap) { + if (constraints.format() != QMediaFormat::UnspecifiedFormat && m.format != constraints.format()) + continue; + if (constraints.videoCodec() != QMediaFormat::VideoCodec::Unspecified && !m.video.contains(constraints.videoCodec())) + continue; + for (const auto &c : m.audio) + codecs.insert(c); + } + return codecs.values(); +} + +QList QPlatformMediaFormatInfo::supportedVideoCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const +{ + if (constraints.mode() == QMediaFormat::AudioOnly) + return {}; + + QSet codecs; + + const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; + for (const auto &m : codecMap) { + if (constraints.format() != QMediaFormat::UnspecifiedFormat && m.format != constraints.format()) + continue; + if (constraints.audioCodec() != QMediaFormat::AudioCodec::Unspecified && !m.audio.contains(constraints.audioCodec())) + continue; + for (const auto &c : m.video) + codecs.insert(c); + } + return codecs.values(); +} + +bool QPlatformMediaFormatInfo::isSupported(const QMediaFormat &format, QMediaFormat::ConversionMode m) const +{ + const auto &codecMap = (m == QMediaFormat::Encode) ? encoders : decoders; + + for (const auto &m : codecMap) { + if (m.format != format.format()) + continue; + if (!m.audio.contains(format.audioCodec())) + continue; + if (format.mode() == QMediaFormat::AudioAndVideo && !m.video.contains(format.videoCodec())) + continue; + return true; + } + return false; +} + +QT_END_NAMESPACE diff --git a/src/multimedia/platform/qplatformmediaformatinfo_p.h b/src/multimedia/platform/qplatformmediaformatinfo_p.h new file mode 100644 index 000000000..af04e4492 --- /dev/null +++ b/src/multimedia/platform/qplatformmediaformatinfo_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 QPLATFORMMEDIAFORMATINFO_H +#define QPLATFORMMEDIAFORMATINFO_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 +#include + +QT_BEGIN_NAMESPACE + +class Q_AUTOTEST_EXPORT QPlatformMediaFormatInfo +{ +public: + QPlatformMediaFormatInfo(); + virtual ~QPlatformMediaFormatInfo(); + + QList supportedFileFormats(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const; + QList supportedAudioCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const; + QList supportedVideoCodecs(const QMediaFormat &constraints, QMediaFormat::ConversionMode m) const; + + bool isSupported(const QMediaFormat &format, QMediaFormat::ConversionMode m) const; + + struct CodecMap { + QMediaFormat::FileFormat format; + QList audio; + QList video; + }; + QList encoders; + QList decoders; + + QList imageFormats; +}; + +QT_END_NAMESPACE + + +#endif // QPLATFORMMEDIADEVICEMANAGER_H diff --git a/src/multimedia/platform/qplatformmediaintegration.cpp b/src/multimedia/platform/qplatformmediaintegration.cpp new file mode 100644 index 000000000..06a07ebba --- /dev/null +++ b/src/multimedia/platform/qplatformmediaintegration.cpp @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 +#include "qplatformmediaintegration_p.h" + +#if QT_CONFIG(gstreamer) +#include +using PlatformIntegration = QGstreamerIntegration; +#elif QT_CONFIG(pulseaudio) +#include +using PlatformIntegration = QPulseAudioIntegration; +#elif QT_CONFIG(alsa) +#include +using PlatformIntegration = QAlsaIntegration; +#elif QT_CONFIG(avfoundation) +#include +using PlatformIntegration = QDarwinIntegration; +#elif defined(Q_OS_WIN) +#include +using PlatformIntegration = QWindowsIntegration; +#elif defined(Q_OS_ANDROID) +#include +using PlatformIntegration = QAndroidIntegration; +#endif + +QT_BEGIN_NAMESPACE + +namespace { +struct Holder { + ~Holder() + { + delete instance; + instance = nullptr; + } + QPlatformMediaIntegration *instance = nullptr; +} holder; + +} + +QPlatformMediaIntegration *QPlatformMediaIntegration::instance() +{ + if (!holder.instance) { + holder.instance = new PlatformIntegration; + } + return holder.instance; +} + +/* + This API is there to be able to test with a mock backend. +*/ +void QPlatformMediaIntegration::setIntegration(QPlatformMediaIntegration *integration) +{ + holder.instance = integration; +} + +QPlatformMediaIntegration::~QPlatformMediaIntegration() +{ + +} + +QT_END_NAMESPACE diff --git a/src/multimedia/platform/qplatformmediaintegration_p.h b/src/multimedia/platform/qplatformmediaintegration_p.h new file mode 100644 index 000000000..cf21da5ae --- /dev/null +++ b/src/multimedia/platform/qplatformmediaintegration_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2021 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 QPLATFORMMEDIAINTEGRATION_H +#define QPLATFORMMEDIAINTEGRATION_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 +#include + +QT_BEGIN_NAMESPACE + +class QMediaDeviceManager; +class QPlatformMediaDeviceManager; +class QPlatformMediaCapture; +class QPlatformMediaPlayer; +class QAudioDecoderControl; +class QPlatformMediaFormatInfo; +class QVideoRendererControl; + +class Q_MULTIMEDIA_EXPORT QPlatformMediaIntegration +{ +public: + static QPlatformMediaIntegration *instance(); + + // API to be able to test with a mock backend + static void setIntegration(QPlatformMediaIntegration *); + + virtual ~QPlatformMediaIntegration(); + virtual QPlatformMediaDeviceManager *deviceManager() = 0; + virtual QPlatformMediaFormatInfo *formatInfo() = 0; + + virtual QAudioDecoderControl *createAudioDecoder() { return nullptr; } + virtual QPlatformMediaCapture *createCaptureInterface(QMediaRecorder::CaptureMode /*mode*/) { return nullptr; } + virtual QPlatformMediaPlayer *createPlayer() { return nullptr; } +}; + +QT_END_NAMESPACE + + +#endif // QPLATFORMMEDIAINTERFACE_H diff --git a/src/multimedia/platform/windows/qwindowsdevicemanager.cpp b/src/multimedia/platform/windows/qwindowsdevicemanager.cpp index b93484a59..04b3bb430 100644 --- a/src/multimedia/platform/windows/qwindowsdevicemanager.cpp +++ b/src/multimedia/platform/windows/qwindowsdevicemanager.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QWindowsDeviceManager::QWindowsDeviceManager() - : QMediaPlatformDeviceManager() + : QPlatformMediaDeviceManager() { } diff --git a/src/multimedia/platform/windows/qwindowsdevicemanager_p.h b/src/multimedia/platform/windows/qwindowsdevicemanager_p.h index a3cfb2666..b55ee6b6d 100644 --- a/src/multimedia/platform/windows/qwindowsdevicemanager_p.h +++ b/src/multimedia/platform/windows/qwindowsdevicemanager_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE class QWindowsEngine; -class QWindowsDeviceManager : public QMediaPlatformDeviceManager +class QWindowsDeviceManager : public QPlatformMediaDeviceManager { public: QWindowsDeviceManager(); diff --git a/src/multimedia/platform/windows/qwindowsformatinfo_p.h b/src/multimedia/platform/windows/qwindowsformatinfo_p.h index 5463136b1..355aea7d7 100644 --- a/src/multimedia/platform/windows/qwindowsformatinfo_p.h +++ b/src/multimedia/platform/windows/qwindowsformatinfo_p.h @@ -51,13 +51,13 @@ // We mean it. // -#include +#include #include #include QT_BEGIN_NAMESPACE -class QWindowsFormatInfo : public QMediaPlatformFormatInfo +class QWindowsFormatInfo : public QPlatformMediaFormatInfo { public: QWindowsFormatInfo(); diff --git a/src/multimedia/platform/windows/qwindowsintegration.cpp b/src/multimedia/platform/windows/qwindowsintegration.cpp index ff6f65644..4153c7fb5 100644 --- a/src/multimedia/platform/windows/qwindowsintegration.cpp +++ b/src/multimedia/platform/windows/qwindowsintegration.cpp @@ -69,14 +69,14 @@ QWindowsIntegration::~QWindowsIntegration() } } -QMediaPlatformDeviceManager *QWindowsIntegration::deviceManager() +QPlatformMediaDeviceManager *QWindowsIntegration::deviceManager() { if (!m_manager) m_manager = new QWindowsDeviceManager(); return m_manager; } -QMediaPlatformFormatInfo *QWindowsIntegration::formatInfo() +QPlatformMediaFormatInfo *QWindowsIntegration::formatInfo() { if (!m_formatInfo) m_formatInfo = new QWindowsFormatInfo(); diff --git a/src/multimedia/platform/windows/qwindowsintegration_p.h b/src/multimedia/platform/windows/qwindowsintegration_p.h index 23e7a941b..23dd00b80 100644 --- a/src/multimedia/platform/windows/qwindowsintegration_p.h +++ b/src/multimedia/platform/windows/qwindowsintegration_p.h @@ -51,14 +51,14 @@ // We mean it. // -#include +#include QT_BEGIN_NAMESPACE class QWindowsDeviceManager; class QWindowsFormatInfo; -class QWindowsIntegration : public QMediaPlatformIntegration +class QWindowsIntegration : public QPlatformMediaIntegration { public: QWindowsIntegration(); @@ -67,8 +67,8 @@ public: void addRefCount(); void releaseRefCount(); - QMediaPlatformDeviceManager *deviceManager() override; - QMediaPlatformFormatInfo *formatInfo() override; + QPlatformMediaDeviceManager *deviceManager() override; + QPlatformMediaFormatInfo *formatInfo() override; QAudioDecoderControl *createAudioDecoder() override; QPlatformMediaPlayer *createPlayer() override; diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index c31139f6b..1c32b3414 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -42,7 +42,7 @@ #include "private/qobject_p.h" #include -#include +#include #include #include @@ -276,7 +276,7 @@ QMediaPlayer::QMediaPlayer(QObject *parent): d->notifyTimer->setInterval(1000); connect(d->notifyTimer, SIGNAL(timeout()), SLOT(_q_notify())); - d->control = QMediaPlatformIntegration::instance()->createPlayer(); + d->control = QPlatformMediaIntegration::instance()->createPlayer(); Q_ASSERT(d->control); connect(d->control, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(_q_stateChanged(QMediaPlayer::State))); diff --git a/src/multimedia/qmediadevicemanager.cpp b/src/multimedia/qmediadevicemanager.cpp index 4873d1cd7..840860e5b 100644 --- a/src/multimedia/qmediadevicemanager.cpp +++ b/src/multimedia/qmediadevicemanager.cpp @@ -38,8 +38,8 @@ ****************************************************************************/ #include "qmediadevicemanager.h" -#include "private/qmediaplatformintegration_p.h" -#include "private/qmediaplatformdevicemanager_p.h" +#include "private/qplatformmediaintegration_p.h" +#include "private/qplatformmediadevicemanager_p.h" #include #include @@ -52,7 +52,7 @@ public: QMediaDeviceManagerPrivate() : manager(new QMediaDeviceManager) { - pmanager = QMediaPlatformIntegration::instance()->deviceManager(); + pmanager = QPlatformMediaIntegration::instance()->deviceManager(); pmanager->setDeviceManager(manager); } ~QMediaDeviceManagerPrivate() @@ -62,7 +62,7 @@ public: } QMediaDeviceManager *manager = nullptr; - QMediaPlatformDeviceManager *pmanager = nullptr; + QPlatformMediaDeviceManager *pmanager = nullptr; } priv; diff --git a/src/multimedia/qmediaformat.cpp b/src/multimedia/qmediaformat.cpp index 6ae2314be..3c2841bfa 100644 --- a/src/multimedia/qmediaformat.cpp +++ b/src/multimedia/qmediaformat.cpp @@ -38,8 +38,8 @@ ****************************************************************************/ #include "qmediaformat.h" -#include "private/qmediaplatformintegration_p.h" -#include "private/qmediaplatformformatinfo_p.h" +#include "private/qplatformmediaintegration_p.h" +#include "private/qplatformmediaformatinfo_p.h" #include QT_BEGIN_NAMESPACE @@ -157,7 +157,7 @@ QMediaFormat &QMediaFormat::operator=(const QMediaFormat &other) = default; */ bool QMediaFormat::canDecode() const { - return QMediaPlatformIntegration::instance()->formatInfo()->isSupported(*this, Decode); + return QPlatformMediaIntegration::instance()->formatInfo()->isSupported(*this, Decode); } /*! @@ -167,7 +167,7 @@ bool QMediaFormat::canDecode() const */ bool QMediaFormat::canEncode() const { - return QMediaPlatformIntegration::instance()->formatInfo()->isSupported(*this, Encode); + return QPlatformMediaIntegration::instance()->formatInfo()->isSupported(*this, Encode); } /*! @@ -190,7 +190,7 @@ QMimeType QMediaFormat::mimeType() const */ QList QMediaFormat::supportedFileFormats(QMediaFormat::ConversionMode m) { - return QMediaPlatformIntegration::instance()->formatInfo()->supportedFileFormats(*this, m); + return QPlatformMediaIntegration::instance()->formatInfo()->supportedFileFormats(*this, m); } /*! @@ -203,7 +203,7 @@ QList QMediaFormat::supportedFileFormats(QMediaFormat: */ QList QMediaFormat::supportedVideoCodecs(QMediaFormat::ConversionMode m) { - return QMediaPlatformIntegration::instance()->formatInfo()->supportedVideoCodecs(*this, m); + return QPlatformMediaIntegration::instance()->formatInfo()->supportedVideoCodecs(*this, m); } /*! @@ -216,7 +216,7 @@ QList QMediaFormat::supportedVideoCodecs(QMediaFormat: */ QList QMediaFormat::supportedAudioCodecs(QMediaFormat::ConversionMode m) { - return QMediaPlatformIntegration::instance()->formatInfo()->supportedAudioCodecs(*this, m); + return QPlatformMediaIntegration::instance()->formatInfo()->supportedAudioCodecs(*this, m); } QString QMediaFormat::fileFormatName(QMediaFormat::FileFormat c) diff --git a/src/multimedia/recording/qmediaencodersettings.cpp b/src/multimedia/recording/qmediaencodersettings.cpp index a1e3b1653..37d73d6a3 100644 --- a/src/multimedia/recording/qmediaencodersettings.cpp +++ b/src/multimedia/recording/qmediaencodersettings.cpp @@ -39,8 +39,8 @@ #include "qmediaencodersettings.h" #include "qmediaformat.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -563,7 +563,7 @@ void QImageEncoderSettings::setFormat(QImageEncoderSettings::FileFormat format) QList QImageEncoderSettings::supportedFormats() { - return QMediaPlatformIntegration::instance()->formatInfo()->imageFormats; + return QPlatformMediaIntegration::instance()->formatInfo()->imageFormats; } QString QImageEncoderSettings::fileFormatName(QImageEncoderSettings::FileFormat f) diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp index 4f4cf8051..eca237744 100644 --- a/src/multimedia/recording/qmediarecorder.cpp +++ b/src/multimedia/recording/qmediarecorder.cpp @@ -44,8 +44,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -165,7 +165,7 @@ QMediaRecorder::QMediaRecorder(QMediaRecorder::CaptureMode mode, QObject *parent if (mode != AudioOnly) { setCamera(new QCamera(this)); } else { - auto *captureIface = QMediaPlatformIntegration::instance()->createCaptureInterface(mode); + auto *captureIface = QPlatformMediaIntegration::instance()->createCaptureInterface(mode); d->control = captureIface->mediaRecorderControl(); } } -- cgit v1.2.3