Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.4.1, 6.5.0 Beta1, 6.6.0
-
None
-
Debian GNU/Linux bookworm/sid (testing)
-
-
a8553a1f7 (dev), a9471cbff (dev), 32aa80fdd (6.5), 2d7200410 (6.6), 186d9b5a8 (6.5), ec0f52e8a (6.6)
Description
I'm trying to have plug-and-play cameras. My DeviceManager class has a QMediaDevices object which is supposed to emit 'videoInputsChanged' whenever a camera is plugged/unplugged. My slot then calls 'QMediaDevices::videoInputs()' and parses the latest list. This worked as expected with Qt 6.3.0 and 6.3.1. It fails with 6.4.1 and is still broken in 6.5.0-beta1 and 6.6.0-preview.
Problem 1
If I create QMediaDevices and connect the 'videoInputs' but do not initially call 'QMediaDevices::videoInputs()' then 'videoInputsChanged' will never fire.
Problem 2
If 'QMediaDevices::videoInputs()' is called at start-up, then when called again in response to 'videoInputsChanged' (slot) the list contains duplicate entries for cameras. If cameras are then unplugged, the initial (duplicate) entry for each camera remains.
Thus, the only way to get expected plug-and-play behavior is by calling 'videoInputs' at start-up, which magically causes 'videoInputsChanged' to work, AND with no cameras initially plugged in so that no duplicates are created.
So something was broken between 6.3.1 and 6.4.1. 6.4.0 doesn't know QCameraInfo, so I'm unable to test it. I have only tested on Debian Linux, so I don't know whether this is a cross platform issue. Please use my attached sample to repro.