Skip to content

Commit f1e51b4

Browse files
committed
Fix upside-down camera image on macOS
CameraSurface flipped incoming frames (horizontal mirror + 180-degree rotation, which nets to a vertical flip) as a historical OpenGL orientation workaround. Qt 6 already delivers upright, top-left-origin frames — the same as the video-file path (VideoPlayerImpl), which uses them untransformed through the same GL upload — so the flip only made camera sources appear upside-down. Use the frame as-is on macOS (and Windows, which was already untransformed); Linux keeps its existing branch.
1 parent cef7b3e commit f1e51b4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/core/CameraSurface.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ void CameraSurface::onVideoFrameChanged(const QVideoFrame& frame)
3737
if (img.isNull())
3838
return;
3939

40-
#ifdef Q_OS_WIN
40+
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
41+
// Qt 6 delivers upright, top-left-origin frames here — the same as the
42+
// video-file path (VideoPlayerImpl), which shares the OpenGL upload — so no
43+
// flip is needed. The old flip made macOS camera sources appear upside-down.
4144
_temporaryImage = img;
4245
#else
43-
// Straighten the image for OpenGL (bottom-left origin convention).
46+
// Linux: historical orientation fix (kept; adjust if cameras look flipped).
4447
QT_WARNING_PUSH
4548
QT_WARNING_DISABLE_DEPRECATED
4649
_temporaryImage = img.mirrored(true, false).transformed(QTransform().rotate(180));

0 commit comments

Comments
 (0)