mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-08-01 18:49:11 -06:00
adjust camera shito for Qt6
This commit is contained in:
@ -23,17 +23,38 @@
|
||||
#if QT_VERSION >= 0x060000
|
||||
#include <QMediaDevices>
|
||||
#include <QCameraDevice>
|
||||
#include <QMediaCaptureSession>
|
||||
#include <QVideoSink>
|
||||
#else
|
||||
#include <QCameraInfo>
|
||||
#include <QAbstractVideoSurface>
|
||||
#include <QVideoSurfaceFormat>
|
||||
#endif
|
||||
#include <QAbstractVideoSurface>
|
||||
#include <QVideoSurfaceFormat>
|
||||
#include <QMutex>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CameraManager;
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x060000
|
||||
|
||||
class CameraFrameDumper : public QVideoSink
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CameraFrameDumper(QObject* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void present(const QVideoFrame& frame);
|
||||
|
||||
private:
|
||||
CameraManager* cam;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
class CameraFrameDumper : public QAbstractVideoSurface
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -48,6 +69,9 @@ private:
|
||||
CameraManager* cam;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class CameraManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -88,6 +112,9 @@ private:
|
||||
|
||||
QCamera* camDevice;
|
||||
CameraFrameDumper* camDumper;
|
||||
#if QT_VERSION >= 0x060000
|
||||
QMediaCaptureSession* camSession;
|
||||
#endif
|
||||
|
||||
int frameWidth, frameHeight;
|
||||
bool frameFormatYUV;
|
||||
|
Reference in New Issue
Block a user