summaryrefslogtreecommitdiffstats
path: root/src/multimedia/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia/base')
-rw-r--r--src/multimedia/base/qmediaserviceprovider.cpp23
-rw-r--r--src/multimedia/base/qmediaserviceprovider.h4
2 files changed, 27 insertions, 0 deletions
diff --git a/src/multimedia/base/qmediaserviceprovider.cpp b/src/multimedia/base/qmediaserviceprovider.cpp
index f7c4e1f..3b8dd2c 100644
--- a/src/multimedia/base/qmediaserviceprovider.cpp
+++ b/src/multimedia/base/qmediaserviceprovider.cpp
@@ -563,12 +563,35 @@ QString QMediaServiceProvider::deviceDescription(const QByteArray &serviceType,
return QString();
}
+
+#ifdef QT_BUILD_INTERNAL
+
+static QMediaServiceProvider *qt_defaultMediaServiceProvider = 0;
+
+/*!
+ Sets a media service \a provider as the default.
+
+ \internal
+*/
+void QMediaServiceProvider::setDefaultServiceProvider(QMediaServiceProvider *provider)
+{
+ qt_defaultMediaServiceProvider = provider;
+}
+
+#endif
+
/*!
Returns a default provider of media services.
*/
QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider()
{
+#ifdef QT_BUILD_INTERNAL
+ return qt_defaultMediaServiceProvider != 0
+ ? qt_defaultMediaServiceProvider
+ : static_cast<QMediaServiceProvider *>(pluginProvider());
+#else
return pluginProvider();
+#endif
}
/*!
diff --git a/src/multimedia/base/qmediaserviceprovider.h b/src/multimedia/base/qmediaserviceprovider.h
index 46f63b5..f108d32 100644
--- a/src/multimedia/base/qmediaserviceprovider.h
+++ b/src/multimedia/base/qmediaserviceprovider.h
@@ -115,6 +115,10 @@ public:
virtual QString deviceDescription(const QByteArray &serviceType, const QByteArray &device);
static QMediaServiceProvider* defaultServiceProvider();
+
+#ifdef QT_BUILD_INTERNAL
+ static void setDefaultServiceProvider(QMediaServiceProvider *provider);
+#endif
};
/*!