Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
None
-
6.8.0, 6.8.3, 6.9.0
-
None
-
IDE: Visual Studio
OS: Windows 11 Pro
Project Type: Qt Widgets
Compiler/Build Type: MSVC 2022 x64
Description
Attempting to call QMediaDevices::videoInputs to get the currently connected video inputs returns an empty list of QCameraDevices, even when video inputs are connected and registered as "Camera" devices.
I have a project that I started building in Qt 6.8.0. Everything was working fine in that version, but after updating to Qt 6.8.3, I noticed that QMediaDevices::videoInputs suffered the bug described above. I attempted to go further and upgraded to Qt 6.9.0, but was met with the same issue.
The code that I first noticed failing (just populating a QListWidget with video device names):
void AddCameraDialog::populateDropdown()
{
for (QCameraDevice device : QMediaDevices::videoInputs()) {
ui.dropdownDevices->addItem(device.description(), device.id());
}
}
STEPS TO RECREATE
- Set your IDE to target Qt 6.8.3 or higher (e.g. 6.9.0)
- Build project that utilizes QMediaDevices::videoInputs
- Run project and observe the output of QMediaDevices::videoInputs
ATTEMPTS AT FIXES/WORKAROUNDS
- Building on a separate device (using Qt 6.8.0, Qt 6.8.3, and Qt 6.9.0)
- Updating all available updates using the Qt Maintenance Tool
- Reinstalling Qt versions
- Updating IDE (Visual Studio)
OTHER OBSERVATIONS
- QMediaDevices::audioInputs and QMediaDevices::audioOutputs appear to work and correctly return populated lists
- QMediaDevices::defaultVideoInput also returns as null