From dae56f4861064df75d8d836ab0c54a039bcf7c52 Mon Sep 17 00:00:00 2001 From: Sofian Audry Date: Tue, 28 Jul 2026 15:37:57 -0400 Subject: [PATCH] Fixed upside-down camera image on Linux --- src/core/CameraSurface.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/core/CameraSurface.cpp b/src/core/CameraSurface.cpp index 19682640..42e01dd7 100644 --- a/src/core/CameraSurface.cpp +++ b/src/core/CameraSurface.cpp @@ -37,18 +37,15 @@ void CameraSurface::onVideoFrameChanged(const QVideoFrame& frame) if (img.isNull()) return; -#if defined(Q_OS_WIN) || defined(Q_OS_MAC) - // Qt 6 delivers upright, top-left-origin frames here — the same as the - // video-file path (VideoPlayerImpl), which shares the OpenGL upload — so no - // flip is needed. The old flip made macOS camera sources appear upside-down. + // Qt 6 delivers upright, top-left-origin frames here on every platform — + // the same as the video-file path (VideoPlayerImpl), which shares the + // OpenGL upload — so no flip is needed. The old flip (a historical OpenGL + // orientation workaround, mirror + 180-degree rotation, net a vertical + // flip) made camera sources appear upside-down; already removed on + // macOS/Windows in f1e51b4, confirmed to be the same bug on Linux by + // injecting a synthetic top-red/bottom-blue QVideoFrame directly into this + // class and observing the flip. _temporaryImage = img; -#else - // Linux: historical orientation fix (kept; adjust if cameras look flipped). - QT_WARNING_PUSH - QT_WARNING_DISABLE_DEPRECATED - _temporaryImage = img.mirrored(true, false).transformed(QTransform().rotate(180)); - QT_WARNING_POP -#endif } }