Vollbildmodus für HDMI

This commit is contained in:
2026-09-15 20:21:22 +02:00
parent 934f32a3bd
commit 4a44d04c75
10 changed files with 576 additions and 411 deletions

View File

@@ -12,6 +12,33 @@
#include "v4l2worker.h"
// A borderless top-level window that mirrors the live video frame at full
// screen size. Opened from VideoWidget's "⛶" button; closes itself on
// Escape or a double-click anywhere on it.
class FullscreenVideoView : public QWidget
{
Q_OBJECT
public:
explicit FullscreenVideoView(QWidget *parent = nullptr);
void setFrame(const QImage &frame);
signals:
// Emitted from closeEvent() so VideoWidget can drop its pointer before
// the WA_DeleteOnClose deletion actually happens.
void closed();
protected:
void paintEvent(QPaintEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
void closeEvent(QCloseEvent *event) override;
private:
QImage m_frame;
};
// VideoWidget shows the live V4L2 preview and can additionally record it
// to an MP4 file. Recording works by piping raw BGRA frames into an
// external `ffmpeg` process (via QProcess/stdin), which encodes them to
@@ -54,6 +81,7 @@ private slots:
void onFreeze(bool frozen);
void onScreenshot();
void onRecordToggled(bool checked);
void onFullscreenToggle();
void refreshDeviceList();
protected:
@@ -83,8 +111,14 @@ private:
QPushButton *m_freezeBtn = nullptr;
QPushButton *m_screenshotBtn = nullptr;
QPushButton *m_recordBtn = nullptr;
QPushButton *m_fullscreenBtn = nullptr;
QLabel *m_infoLabel = nullptr;
// Fullscreen overlay window (nullptr when not open). Owns itself via
// Qt::WA_DeleteOnClose; VideoWidget just tracks whether one currently
// exists and forwards frames to it while it's open.
FullscreenVideoView *m_fullscreenView = nullptr;
// Recording state. m_recordProcess is the running ffmpeg instance (or
// nullptr when not recording); m_recordSize is the frame size the
// recording was started with, so a mid-stream resolution change (which