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:
@@ -359,22 +359,17 @@ public:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QMediaServiceProviderHint::Device: {
|
case QMediaServiceProviderHint::Device: {
|
||||||
|
plugin = plugins[0];
|
||||||
foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) {
|
foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) {
|
||||||
QMediaServiceSupportedDevicesInterface *iface =
|
QMediaServiceSupportedDevicesInterface *iface =
|
||||||
qobject_cast<QMediaServiceSupportedDevicesInterface*>(currentPlugin);
|
qobject_cast<QMediaServiceSupportedDevicesInterface*>(currentPlugin);
|
||||||
|
|
||||||
if (!iface) {
|
if (iface && iface->devices(type).contains(hint.device())) {
|
||||||
// the plugin may support the device,
|
|
||||||
// but this choice still can be overridden
|
|
||||||
plugin = currentPlugin;
|
|
||||||
} else {
|
|
||||||
if (iface->devices(type).contains(hint.device())) {
|
|
||||||
plugin = currentPlugin;
|
plugin = currentPlugin;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case QMediaServiceProviderHint::CameraPosition: {
|
case QMediaServiceProviderHint::CameraPosition: {
|
||||||
plugin = plugins[0];
|
plugin = plugins[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user