Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-136932

QMediaDevices::videoInputs returns empty in Qt >6.8.3 even with video inputs connected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 6.8.0, 6.8.3, 6.9.0
    • Multimedia
    • None
    • IDE: Visual Studio
      OS: Windows 11 Pro
      Project Type: Qt Widgets
      Compiler/Build Type: MSVC 2022 x64
    • Windows

    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

      1. Set your IDE to target Qt 6.8.3 or higher (e.g. 6.9.0)
      2. Build project that utilizes QMediaDevices::videoInputs
      3. 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtmultimediateam Qt Multimedia Team
            m.riley04 Riley Meyerkorth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes