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

QMediaDevices::videoInputs returns empty list when used alone

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.5.0
    • Multimedia
    • None
    • Windows 11 - MSVC2019
    • Windows
    • 1689940a0 (dev), e95692cbf (6.5)

    Description

      As reported on SO, I'm getting an empty QList when using QMediaDevices::videoInputs().

      However I've noticed that if I make a call to QMediaDevices::audioInputs() (useless for me) before videoInputs(), this latter works fine.

       

      #include <QCoreApplication>
      #include <QtCore>
      #include <QCameraDevice>
      #include <QMediaDevices>
      #include <QAudioDevice>
      
      int main(int argc, char *argv[])
      {
          init_messages_name();    QCoreApplication app(argc, argv);
          // If this is left out, videoInputDevices.count() is zero, otherwise 1 and returns the correct webcam.
          const auto audioInputs = QMediaDevices::audioInputs();
          const auto videoInputDevices = QMediaDevices::videoInputs();
          qDebug() << videoInputDevices.count();    
          return app.exec();
      }

      Attachments

        For Gerrit Dashboard: QTBUG-112702
        # Subject Branch Project Status CR V

        Activity

          People

            padubsky Pavel Dubsky
            buzzita buzzita
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes