summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2022-04-07 15:15:58 +0200
committerLars Knoll <lars.knoll@qt.io>2022-04-29 07:16:05 +0200
commit75658f288f80513e8b81fab077eed082667f6216 (patch)
tree897a1c924336118946d7f5052a521499a5e97a64 /tests
parentf0282b86889faa3ac4c2531e2c09abd10d4c87a2 (diff)
Move the low level audio integration back into Qt Multimedia
Those integrations are selected at compile time and not dependent on native vs ffmpeg backend. Because of that we can move them back into Qt Multimedia directly. This will simplify and improve a couple of things: * We don't need to build the audio code twice (once per plugins) * Low level audio is always available even if you choose not to ship a large backend for audio/video decoding and recording * We can use Qt Multimedia as a backend for other modules requiring audio only without bloating things there (e.g. for Qt Speech) * We can directly integrate support for 3D audio and headphone spatialization into Qt Multimedia without requiring an additional module for that. To do so, we need to remove the camera handling from QPlatformMediaDevices. This is only partially done in this commit (by adding a QPlatformVideoDevices class), and will be further cleaned up in followup commits. Change-Id: Ib4a33d7255faaf26dd825527786eae10ed283490 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/unit/mockbackend/qmockintegration.cpp9
-rw-r--r--tests/auto/unit/mockbackend/qmockintegration_p.h3
-rw-r--r--tests/auto/unit/mockbackend/qmockmediadevices.cpp6
-rw-r--r--tests/auto/unit/mockbackend/qmockmediadevices_p.h2
4 files changed, 5 insertions, 15 deletions
diff --git a/tests/auto/unit/mockbackend/qmockintegration.cpp b/tests/auto/unit/mockbackend/qmockintegration.cpp
index 5acd662a9..da4ac787f 100644
--- a/tests/auto/unit/mockbackend/qmockintegration.cpp
+++ b/tests/auto/unit/mockbackend/qmockintegration.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "qmockintegration_p.h"
-#include "qmockmediadevices_p.h"
#include "qmockmediaplayer.h"
#include "qmockaudiodecoder.h"
#include "qmockcamera.h"
@@ -57,14 +56,6 @@ QMockIntegration::QMockIntegration()
QMockIntegration::~QMockIntegration()
{
setIntegration(nullptr);
- delete m_devices;
-}
-
-QPlatformMediaDevices *QMockIntegration::devices()
-{
- if (!m_devices)
- m_devices = new QMockMediaDevices(this);
- return m_devices;
}
QPlatformAudioDecoder *QMockIntegration::createAudioDecoder(QAudioDecoder *decoder)
diff --git a/tests/auto/unit/mockbackend/qmockintegration_p.h b/tests/auto/unit/mockbackend/qmockintegration_p.h
index a95fd362e..f5a6d167e 100644
--- a/tests/auto/unit/mockbackend/qmockintegration_p.h
+++ b/tests/auto/unit/mockbackend/qmockintegration_p.h
@@ -55,7 +55,6 @@
QT_BEGIN_NAMESPACE
-class QMockMediaDevices;
class QMockMediaPlayer;
class QMockAudioDecoder;
class QMockCamera;
@@ -68,7 +67,6 @@ public:
QMockIntegration();
~QMockIntegration();
- QPlatformMediaDevices *devices() override;
QPlatformMediaFormatInfo *formatInfo() override { return nullptr; }
QPlatformAudioDecoder *createAudioDecoder(QAudioDecoder *decoder) override;
@@ -100,7 +98,6 @@ public:
private:
Flags m_flags = {};
- QMockMediaDevices *m_devices = nullptr;
QMockMediaPlayer *m_lastPlayer = nullptr;
QMockAudioDecoder *m_lastAudioDecoderControl = nullptr;
QMockCamera *m_lastCamera = nullptr;
diff --git a/tests/auto/unit/mockbackend/qmockmediadevices.cpp b/tests/auto/unit/mockbackend/qmockmediadevices.cpp
index 0114c1aca..216991925 100644
--- a/tests/auto/unit/mockbackend/qmockmediadevices.cpp
+++ b/tests/auto/unit/mockbackend/qmockmediadevices.cpp
@@ -42,9 +42,11 @@
QT_BEGIN_NAMESPACE
-QMockMediaDevices::QMockMediaDevices(QPlatformMediaIntegration *integration)
- : QPlatformMediaDevices(integration)
+QMockMediaDevices::QMockMediaDevices()
+ : QPlatformMediaDevices()
{
+ setDevices(this);
+
QCameraDevicePrivate *info = new QCameraDevicePrivate;
info->description = QString::fromUtf8("defaultCamera");
info->id = "default";
diff --git a/tests/auto/unit/mockbackend/qmockmediadevices_p.h b/tests/auto/unit/mockbackend/qmockmediadevices_p.h
index 8dac25bf3..cfa0398f3 100644
--- a/tests/auto/unit/mockbackend/qmockmediadevices_p.h
+++ b/tests/auto/unit/mockbackend/qmockmediadevices_p.h
@@ -63,7 +63,7 @@ class QCameraDevice;
class QMockMediaDevices : public QPlatformMediaDevices
{
public:
- QMockMediaDevices(QPlatformMediaIntegration *integration);
+ QMockMediaDevices();
~QMockMediaDevices();
QList<QAudioDevice> audioInputs() const override;