summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2010-02-05 01:22:59 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2010-02-05 01:22:59 (GMT)
commitf4646f4810983536cbf0084cd1e5c6dc9a5b2a5d (patch)
tree5b0c84211248207f3d6206a95ea88909ff5bd764 /src/multimedia
parent49797723461c812ebe2f53da0583323d0314d02a (diff)
downloadQt-f4646f4810983536cbf0084cd1e5c6dc9a5b2a5d.zip
Qt-f4646f4810983536cbf0084cd1e5c6dc9a5b2a5d.tar.gz
Qt-f4646f4810983536cbf0084cd1e5c6dc9a5b2a5d.tar.bz2
Add an internal function for setting the default media servie provider.
This allows auto tests to override the default service provider.
Diffstat (limited to 'src/multimedia')
-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
};
/*!