Fix camera plugin selection.

When requesting a camera plugin for a given device id, it should fall
back to any available plugin if that device id is not found.

Change-Id: I685294c7fdcaa72bce70178b0aae2ec92e79e107
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
Yoann Lopes
2015-08-12 14:13:43 +02:00
parent dc1712d4b2
commit 8ba1e65291

View File

@@ -359,19 +359,14 @@ public:
}
break;
case QMediaServiceProviderHint::Device: {
plugin = plugins[0];
foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) {
QMediaServiceSupportedDevicesInterface *iface =
qobject_cast<QMediaServiceSupportedDevicesInterface*>(currentPlugin);
if (!iface) {
// the plugin may support the device,
// but this choice still can be overridden
if (iface && iface->devices(type).contains(hint.device())) {
plugin = currentPlugin;
} else {
if (iface->devices(type).contains(hint.device())) {
plugin = currentPlugin;
break;
}
break;
}
}
}