summaryrefslogtreecommitdiffstats
path: root/src/multimedia/base/qmediaserviceprovider.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-03-04 18:22:02 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-03-04 18:22:02 (GMT)
commit2542f8b565e90378145c048b3a6982f4749c6392 (patch)
treed48a2a8988a778e16cf73aac4d0b5709b82f0082 /src/multimedia/base/qmediaserviceprovider.cpp
parent4f2203e481cc1663776e7b87b082cf0dd42849fd (diff)
parent364ba2bfeeab574d2ae940e4387d3c90b2a46dcd (diff)
downloadQt-2542f8b565e90378145c048b3a6982f4749c6392.zip
Qt-2542f8b565e90378145c048b3a6982f4749c6392.tar.gz
Qt-2542f8b565e90378145c048b3a6982f4749c6392.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/multimedia/base/qmediaserviceprovider.cpp')
-rw-r--r--src/multimedia/base/qmediaserviceprovider.cpp57
1 files changed, 43 insertions, 14 deletions
diff --git a/src/multimedia/base/qmediaserviceprovider.cpp b/src/multimedia/base/qmediaserviceprovider.cpp
index eb6505c..6e11079 100644
--- a/src/multimedia/base/qmediaserviceprovider.cpp
+++ b/src/multimedia/base/qmediaserviceprovider.cpp
@@ -102,6 +102,9 @@ public:
\value RecordingSupport
The service provides audio or video recording functions.
+
+ \value StreamPlayback
+ The service is capable of playing QIODevice based streams.
*/
/*!
@@ -268,7 +271,7 @@ class QPluginServiceProvider : public QMediaServiceProvider
public:
QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint)
{
- QString key(type);
+ QString key(QString::fromLatin1(type.constData(),type.length()));
QList<QMediaServiceProviderPlugin *>plugins;
foreach (QObject *obj, loader()->instances(key)) {
@@ -383,7 +386,8 @@ public:
const QStringList& codecs,
int flags) const
{
- QList<QObject*> instances = loader()->instances(serviceType);
+ QList<QObject*> instances = loader()->instances(
+ QString::fromLatin1(serviceType.constData(),serviceType.length()));
if (instances.isEmpty())
return QtMultimedia::NotSupported;
@@ -395,14 +399,25 @@ public:
QMediaServiceSupportedFormatsInterface *iface =
qobject_cast<QMediaServiceSupportedFormatsInterface*>(obj);
- //if low latency playback was asked, skip services known
- //not to provide low latency playback
- if (flags & QMediaPlayer::LowLatency) {
+
+ if (flags) {
QMediaServiceFeaturesInterface *iface =
qobject_cast<QMediaServiceFeaturesInterface*>(obj);
- if (iface && !(iface->supportedFeatures(serviceType) & QMediaServiceProviderHint::LowLatencyPlayback))
- continue;
+ if (iface) {
+ QMediaServiceProviderHint::Features features = iface->supportedFeatures(serviceType);
+
+ //if low latency playback was asked, skip services known
+ //not to provide low latency playback
+ if ((flags & QMediaPlayer::LowLatency) &&
+ !(features & QMediaServiceProviderHint::LowLatencyPlayback))
+ continue;
+
+ //the same for QIODevice based streams support
+ if ((flags & QMediaPlayer::StreamPlayback) &&
+ !(features & QMediaServiceProviderHint::StreamPlayback))
+ continue;
+ }
}
if (iface)
@@ -424,7 +439,8 @@ public:
QStringList supportedMimeTypes(const QByteArray &serviceType, int flags) const
{
- QList<QObject*> instances = loader()->instances(serviceType);
+ QList<QObject*> instances = loader()->instances(
+ QString::fromLatin1(serviceType.constData(),serviceType.length()));
QStringList supportedTypes;
@@ -432,14 +448,25 @@ public:
QMediaServiceSupportedFormatsInterface *iface =
qobject_cast<QMediaServiceSupportedFormatsInterface*>(obj);
- // If low latency playback was asked for, skip MIME types from services known
- // not to provide low latency playback
+
if (flags & QMediaPlayer::LowLatency) {
QMediaServiceFeaturesInterface *iface =
qobject_cast<QMediaServiceFeaturesInterface*>(obj);
- if (iface && !(iface->supportedFeatures(serviceType) & QMediaServiceProviderHint::LowLatencyPlayback))
- continue;
+ if (iface) {
+ QMediaServiceProviderHint::Features features = iface->supportedFeatures(serviceType);
+
+ // If low latency playback was asked for, skip MIME types from services known
+ // not to provide low latency playback
+ if ((flags & QMediaPlayer::LowLatency) &&
+ !(features & QMediaServiceProviderHint::LowLatencyPlayback))
+ continue;
+
+ //the same for QIODevice based streams support
+ if ((flags & QMediaPlayer::StreamPlayback) &&
+ !(features & QMediaServiceProviderHint::StreamPlayback))
+ continue;
+ }
}
if (iface) {
@@ -457,7 +484,8 @@ public:
{
QList<QByteArray> res;
- foreach(QObject *obj, loader()->instances(serviceType)) {
+ foreach(QObject *obj, loader()->instances(
+ QString::fromLatin1(serviceType.constData(),serviceType.length()))) {
QMediaServiceSupportedDevicesInterface *iface =
qobject_cast<QMediaServiceSupportedDevicesInterface*>(obj);
@@ -471,7 +499,8 @@ public:
QString deviceDescription(const QByteArray &serviceType, const QByteArray &device)
{
- foreach(QObject *obj, loader()->instances(serviceType)) {
+ foreach(QObject *obj, loader()->instances(
+ QString::fromLatin1(serviceType.constData(),serviceType.length()))) {
QMediaServiceSupportedDevicesInterface *iface =
qobject_cast<QMediaServiceSupportedDevicesInterface*>(obj);