Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.7.1, 5.10
-
None
-
OS: Gentoo
Two UVC cameras
Description
First of all I have a patch for this (attached)
What's wrong?
Suppose I have a QML Camera object and two web cams connected to the PC. First I initialise the camera object with default one:
Camera { id : myCamera deviceId : QtMultimedia.defaultCamera.deviceId cameraState : Camera.LoadedState }
Then I unplug the default camera and reassign myCamera to the default device (which is the other camera now).
function enumerateCallbackOrWhatever() { myCamera.deviceId = QtMultimedia.defaultCamera.deviceId }
Then I see the error
CameraBin error: "Cannot identify device '/dev/video0'."
and myCamera.cameraStatus never gets out from Camera.LoadingStatus.
Steps to reproduce:
I've written a little reproducer project following the design of QDeclarativeCamera class from ./imports/multimedia/qdeclarativecamera.cpp which you can use to make this bug emerge.
- Connect two cameras to the PC. Figure out which one will be considered by QtMultimedia as the default (I guess it should likely be /dev/video0)
- Run the reproducer. You should see messages like "status: 2" and "status: 4". This is the values of QCamera::status() of the default Camera.
- When you see "Please unplug the DEFAULT camera within 10 seconds" message please do that and wait a little bit
- The program will unload the camera, change it to the default device and will try to load it. As the result you should see the status changing from 3 to 1, then to 2 and finally you should see the error message I was talking about earlier and then nothing
If you don't see the error and the camera has again gone to status 4 then, most likely, you unplugged the wrong camera. Try the other one.