Multimedia plugins now have a unique JSON metadata 'Keys' property.

They previously had the multimedia services they provided as keys. This
was a problem when several plugins were available on the same platform,
providing the same multimedia service, but with different features or
capabilities. Since they had the same key, only the first plugin in the
directory was loaded.

Nevertheless, it was actually working until commit 732dcfe7 in qtbase,
as all plugins were loaded even when sharing the same key.

The services a multimedia plugin provides are now declared in the
'Services' property. To preserve compatibility with third-party plugins,
if that new property doesn't exist it falls back to the 'Keys' property.

Task-number: QTBUG-31868
Task-number: QTBUG-31476
Change-Id: Ic3ba32eeef21b69b922bd3d4feb111101559d132
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Yoann Lopes
2013-06-20 17:40:11 +02:00
committed by The Qt Project
parent 16a775d47a
commit e25db62a59
21 changed files with 46 additions and 21 deletions

View File

@@ -127,7 +127,12 @@ void QMediaPluginLoader::loadMetadata()
qDebug() << "QMediaPluginLoader: Inserted index " << i << " into metadata: " << jsonobj; qDebug() << "QMediaPluginLoader: Inserted index " << i << " into metadata: " << jsonobj;
#endif #endif
QJsonArray arr = jsonobj.value(QStringLiteral("Keys")).toArray(); QJsonArray arr = jsonobj.value(QStringLiteral("Services")).toArray();
// Preserve compatibility with older plugins (made before 5.1) in which
// services were declared in the 'Keys' property
if (arr.isEmpty())
arr = jsonobj.value(QStringLiteral("Keys")).toArray();
foreach (QJsonValue value, arr) { foreach (QJsonValue value, arr) {
QString key = value.toString(); QString key = value.toString();

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer"] "Keys": ["androidmultimedia"],
"Services": ["org.qt-project.qt.mediaplayer"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.audiosource"] "Keys": ["audiocapture"],
"Services": ["org.qt-project.qt.audiosource"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.camera"] "Keys": ["avfoundationcamera"],
"Services": ["org.qt-project.qt.camera"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer"] "Keys": ["avfoundationmediaplayer"],
"Services": ["org.qt-project.qt.mediaplayer"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"] "Keys": ["blackberrymultimedia"],
"Services": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"] "Keys": ["directshow"],
"Services": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.camera"] "Keys": ["directshow"],
"Services": ["org.qt-project.qt.camera"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.audiodecode"] "Keys": ["gstreameraudiodecode"],
"Services": ["org.qt-project.qt.audiodecode"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.camera"] "Keys": ["gstreamercamerabin"],
"Services": ["org.qt-project.qt.camera"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiosource", "org.qt-project.qt.camera", "org.qt-project.qt.audiodecode"] "Keys": ["gstreamer"],
"Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiosource", "org.qt-project.qt.camera", "org.qt-project.qt.audiodecode"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.audiosource"] "Keys": ["gstreamermediacapture"],
"Services": ["org.qt-project.qt.audiosource"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.audiosource", "org.qt-project.qt.camera"] "Keys": ["gstreamermediacapture"]
"Services": ["org.qt-project.qt.audiosource", "org.qt-project.qt.camera"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer"] "Keys": ["gstreamermediaplayer"],
"Services": ["org.qt-project.qt.mediaplayer"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer"] "Keys": ["qt7"],
"Services": ["org.qt-project.qt.mediaplayer"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.radio"] "Keys": ["v4l"],
"Services": ["org.qt-project.qt.radio"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiodecode"] "Keys": ["windowsmediafoundation"],
"Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiodecode"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer"] "Keys": ["mockserviceplugin1"],
"Services": ["org.qt-project.qt.mediaplayer"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.radio"] "Keys": ["mockserviceplugin2"],
"Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.radio"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiosource"] "Keys": ["mockserviceplugin3"],
"Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiosource"]
} }

View File

@@ -1,3 +1,4 @@
{ {
"Keys": ["org.qt-project.qt.mediaplayer"] "Keys": ["mockserviceplugin4"],
"Services": ["org.qt-project.qt.mediaplayer"]
} }