Skip to content

Do not limit to two cameras only, but access/use any of the available ones

Created by: zubozrout

This MR is an attempt to allow qtubuntu-camera access to all camera devices QtMultimedia.availableCameras lists.

In the end this turned out to be a very basic change, removing the original toggling in between the first two devices (if available) and respecting m_deviceSelectControl->selectedDevice() instead.

There is space for improvement, like the check for m_deviceSelectControl->deviceCount() == 1 no longer has to be in place since both if else branches ultimately do the same, we can remove the commented out toggling code etc.

What I think we need to address before merging is the fact I get more available cameras than there actually are, as noted here: https://github.com/ubports/qtubuntu-camera/issues/20

  1. It is not nice co have some dummy devices in place. But I am not sure what's causing it :(
  2. Selecting a non-existent device makes any app lose its connection to this stack. It does require closing the app and reopening it, fortunately no system restart, but still not good.

If you want to test this, feel free to try this basic camera devises switching app: https://iubuntu.cz/ut/lenses_0.1_all.click or even the tweaked Ubports camera app - as outlined in the issue linked above.

Any thoughts are highly appreciated. Thank you :)

This addresses #20.

Edited by Guido Berhörster

Merge request reports