summaryrefslogtreecommitdiffstats
path: root/src/multimedia/platform
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-02-13 17:29:26 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-02-15 08:26:40 +0100
commit75bc388bb936890e182e3bf13dd23d557467780f (patch)
tree473cdbf849f8d400c6bc3329b308b9a93e1501bc /src/multimedia/platform
parentdd7de35b421f1dc6d27abdb0d3f2f5e74b0ae457 (diff)
Disambiguate static constants, variables and functions
They cause clashes in CMake Unity (Jumbo) builds. Task-number: QTBUG-109394 Pick-to: 6.5 Change-Id: I856ed6b5f511299845a49f989ccd74a3e5480e44 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/multimedia/platform')
-rw-r--r--src/multimedia/platform/qplatformmediadevices.cpp34
-rw-r--r--src/multimedia/platform/qplatformmediaintegration.cpp26
2 files changed, 30 insertions, 30 deletions
diff --git a/src/multimedia/platform/qplatformmediadevices.cpp b/src/multimedia/platform/qplatformmediadevices.cpp
index 6944e8ca1..03f1af75e 100644
--- a/src/multimedia/platform/qplatformmediadevices.cpp
+++ b/src/multimedia/platform/qplatformmediadevices.cpp
@@ -31,8 +31,8 @@
QT_BEGIN_NAMESPACE
namespace {
-struct Holder {
- ~Holder()
+struct DevicesHolder {
+ ~DevicesHolder()
{
QMutexLocker locker(&mutex);
delete nativeInstance;
@@ -42,36 +42,36 @@ struct Holder {
QBasicMutex mutex;
QPlatformMediaDevices *instance = nullptr;
QPlatformMediaDevices *nativeInstance = nullptr;
-} holder;
+} devicesHolder;
}
QPlatformMediaDevices *QPlatformMediaDevices::instance()
{
- QMutexLocker locker(&holder.mutex);
- if (holder.instance)
- return holder.instance;
+ QMutexLocker locker(&devicesHolder.mutex);
+ if (devicesHolder.instance)
+ return devicesHolder.instance;
#ifdef Q_OS_DARWIN
- holder.nativeInstance = new QDarwinMediaDevices;
+ devicesHolder.nativeInstance = new QDarwinMediaDevices;
#elif defined(Q_OS_WINDOWS)
- holder.nativeInstance = new QWindowsMediaDevices;
+ devicesHolder.nativeInstance = new QWindowsMediaDevices;
#elif defined(Q_OS_ANDROID)
- holder.nativeInstance = new QAndroidMediaDevices;
+ devicesHolder.nativeInstance = new QAndroidMediaDevices;
#elif QT_CONFIG(alsa)
- holder.nativeInstance = new QAlsaMediaDevices;
+ devicesHolder.nativeInstance = new QAlsaMediaDevices;
#elif QT_CONFIG(pulseaudio)
- holder.nativeInstance = new QPulseAudioMediaDevices;
+ devicesHolder.nativeInstance = new QPulseAudioMediaDevices;
#elif defined(Q_OS_QNX)
- holder.nativeInstance = new QQnxMediaDevices;
+ devicesHolder.nativeInstance = new QQnxMediaDevices;
#elif defined(Q_OS_WASM)
- holder.nativeInstance = new QWasmMediaDevices;
+ devicesHolder.nativeInstance = new QWasmMediaDevices;
#else
- holder.nativeInstance = new QPlatformMediaDevices;
+ devicesHolder.nativeInstance = new QPlatformMediaDevices;
#endif
- holder.instance = holder.nativeInstance;
- return holder.instance;
+ devicesHolder.instance = devicesHolder.nativeInstance;
+ return devicesHolder.instance;
}
@@ -80,7 +80,7 @@ QPlatformMediaDevices::QPlatformMediaDevices()
void QPlatformMediaDevices::setDevices(QPlatformMediaDevices *devices)
{
- holder.instance = devices;
+ devicesHolder.instance = devices;
}
QPlatformMediaDevices::~QPlatformMediaDevices() = default;
diff --git a/src/multimedia/platform/qplatformmediaintegration.cpp b/src/multimedia/platform/qplatformmediaintegration.cpp
index b85a74345..75eee37d4 100644
--- a/src/multimedia/platform/qplatformmediaintegration.cpp
+++ b/src/multimedia/platform/qplatformmediaintegration.cpp
@@ -64,8 +64,8 @@ static QString defaultBackend(const QStringList &backends)
QT_BEGIN_NAMESPACE
namespace {
-struct Holder {
- ~Holder()
+struct InstanceHolder {
+ ~InstanceHolder()
{
QMutexLocker locker(&mutex);
instance = nullptr;
@@ -73,15 +73,15 @@ struct Holder {
QBasicMutex mutex;
QPlatformMediaIntegration *instance = nullptr;
QPlatformMediaIntegration *nativeInstance = nullptr;
-} holder;
+} instanceHolder;
}
QPlatformMediaIntegration *QPlatformMediaIntegration::instance()
{
- QMutexLocker locker(&holder.mutex);
- if (holder.instance)
- return holder.instance;
+ QMutexLocker locker(&instanceHolder.mutex);
+ if (instanceHolder.instance)
+ return instanceHolder.instance;
const auto backends = availableBackends();
QString backend = QString::fromUtf8(qgetenv("QT_MEDIA_BACKEND"));
@@ -89,16 +89,16 @@ QPlatformMediaIntegration *QPlatformMediaIntegration::instance()
backend = defaultBackend(backends);
qCDebug(qLcMediaPlugin) << "loading backend" << backend;
- holder.nativeInstance =
+ instanceHolder.nativeInstance =
qLoadPlugin<QPlatformMediaIntegration, QPlatformMediaPlugin>(loader(), backend);
- if (!holder.nativeInstance) {
+ if (!instanceHolder.nativeInstance) {
qWarning() << "could not load multimedia backend" << backend;
- holder.nativeInstance = new QDummyIntegration;
+ instanceHolder.nativeInstance = new QDummyIntegration;
}
- holder.instance = holder.nativeInstance;
- return holder.instance;
+ instanceHolder.instance = instanceHolder.nativeInstance;
+ return instanceHolder.instance;
}
/*
@@ -107,9 +107,9 @@ QPlatformMediaIntegration *QPlatformMediaIntegration::instance()
void QPlatformMediaIntegration::setIntegration(QPlatformMediaIntegration *integration)
{
if (integration)
- holder.instance = integration;
+ instanceHolder.instance = integration;
else
- holder.instance = holder.nativeInstance;
+ instanceHolder.instance = instanceHolder.nativeInstance;
}
QList<QCameraDevice> QPlatformMediaIntegration::videoInputs()