Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.5.0
-
None
-
Windows 11 - MSVC2019
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(); }