try to unfuck it for Qt6

This commit is contained in:
Arisotura 2022-09-26 22:42:15 +02:00
parent 432d73a86a
commit eca086ef95
3 changed files with 28 additions and 3 deletions

View File

@ -31,7 +31,7 @@ jobs:
- name: Configure
working-directory: ${{runner.workspace}}/build/arm64
run: arch -arm64 ${{env.homebrew_prefix}}/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="${{env.homebrew_prefix}}/opt/qt@6;${{env.homebrew_prefix}}/opt/qtmultimedia@6;${{env.homebrew_prefix}}/opt/libarchive" -DPKG_CONFIG_EXECUTABLE=${{env.homebrew_prefix}}/bin/pkg-config -DMACOS_BUNDLE_LIBS=ON -DUSE_QT6=ON
run: arch -arm64 ${{env.homebrew_prefix}}/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="${{env.homebrew_prefix}}/opt/qt@6;${{env.homebrew_prefix}}/opt/libarchive" -DPKG_CONFIG_EXECUTABLE=${{env.homebrew_prefix}}/bin/pkg-config -DMACOS_BUNDLE_LIBS=ON -DUSE_QT6=ON
- name: Make
working-directory: ${{runner.workspace}}/build/arm64
@ -49,7 +49,7 @@ jobs:
- name: Configure
working-directory: ${{runner.workspace}}/build/x86_64
run: arch -x86_64 ${{env.homebrew_prefix}}/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="${{env.homebrew_prefix}}/opt/qt@6;${{env.homebrew_prefix}}/opt/qtmultimedia@6;${{env.homebrew_prefix}}/opt/libarchive" -DPKG_CONFIG_EXECUTABLE=${{env.homebrew_prefix}}/bin/pkg-config -DMACOS_BUNDLE_LIBS=ON -DUSE_QT6=ON
run: arch -x86_64 ${{env.homebrew_prefix}}/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="${{env.homebrew_prefix}}/opt/qt@6;${{env.homebrew_prefix}}/opt/libarchive" -DPKG_CONFIG_EXECUTABLE=${{env.homebrew_prefix}}/bin/pkg-config -DMACOS_BUNDLE_LIBS=ON -DUSE_QT6=ON
- name: Make
working-directory: ${{runner.workspace}}/build/x86_64

View File

@ -20,7 +20,12 @@
#define CAMERAMANAGER_H
#include <QCamera>
#if QT_VERSION >= 0x060000
#include <QMediaDevices>
#include <QCameraDevice>
#else
#include <QCameraInfo>
#endif
#include <QAbstractVideoSurface>
#include <QVideoSurfaceFormat>
#include <QMutex>

View File

@ -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);