mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 23:29:55 -06:00
try to unfuck it for Qt6
This commit is contained in:
@ -20,7 +20,12 @@
|
||||
#define CAMERAMANAGER_H
|
||||
|
||||
#include <QCamera>
|
||||
#include <QCameraInfo>
|
||||
#if QT_VERSION >= 0x060000
|
||||
#include <QMediaDevices>
|
||||
#include <QCameraDevice>
|
||||
#else
|
||||
#include <QCameraInfo>
|
||||
#endif
|
||||
#include <QAbstractVideoSurface>
|
||||
#include <QVideoSurfaceFormat>
|
||||
#include <QMutex>
|
||||
|
@ -78,6 +78,25 @@ CameraSettingsDialog::CameraSettingsDialog(QWidget* parent) : QDialog(parent), u
|
||||
ui->cbCameraSel->addItem("DSi outer camera");
|
||||
ui->cbCameraSel->addItem("DSi inner camera");
|
||||
|
||||
#if QT_VERSION >= 0x060000
|
||||
const QList<QCameraDevice> cameras = QMediaDevices::videoInputs();
|
||||
for (const QCameraDevice &cameraInfo : cameras)
|
||||
{
|
||||
QString name = cameraInfo.description();
|
||||
QCameraDevice::Position pos = cameraInfo.position();
|
||||
if (pos != QCameraDevice::UnspecifiedPosition)
|
||||
{
|
||||
name += " (";
|
||||
if (pos == QCameraDevice::FrontFace)
|
||||
name += "inner camera";
|
||||
else if (pos == QCameraDevice::BackFace)
|
||||
name += "outer camera";
|
||||
name += ")";
|
||||
}
|
||||
|
||||
ui->cbPhysicalCamera->addItem(name, QString(cameraInfo.id()));
|
||||
}
|
||||
#else
|
||||
const QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
|
||||
for (const QCameraInfo &cameraInfo : cameras)
|
||||
{
|
||||
@ -95,6 +114,7 @@ CameraSettingsDialog::CameraSettingsDialog(QWidget* parent) : QDialog(parent), u
|
||||
|
||||
ui->cbPhysicalCamera->addItem(name, cameraInfo.deviceName());
|
||||
}
|
||||
#endif
|
||||
ui->rbPictureCamera->setEnabled(ui->cbPhysicalCamera->count() > 0);
|
||||
|
||||
grpInputType = new QButtonGroup(this);
|
||||
|
Reference in New Issue
Block a user