Skip to content

Fixed upside-down camera image on Linux - #628

Open
sofian wants to merge 1 commit into
devfrom
bugfix-camera-upside-down
Open

Fixed upside-down camera image on Linux#628
sofian wants to merge 1 commit into
devfrom
bugfix-camera-upside-down

Conversation

@sofian

@sofian sofian commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

CameraSurface::onVideoFrameChanged() kept a Linux-only transform (horizontal mirror + 180° rotation, net a vertical flip) inherited from a pre-Qt6 OpenGL orientation workaround. The exact same transform was already identified and removed on macOS in f1e51b4 ("Fix upside-down camera image on macOS") — Qt 6's QVideoFrame/QVideoSink deliver upright, top-left-origin frames on every platform (same convention the video-file path already relies on unmodified), so the flip only made the image upside-down. That commit left Linux's branch untouched out of caution, with a comment inviting a follow-up ("adjust if cameras look flipped").

Removed the now-platform-wide special case; all platforms use the frame as-is.

Test plan

  • qmake6 mapmap.pro && make builds clean
  • tests/ suite builds and all tests pass
  • Isolated CameraSurface::onVideoFrameChanged() in a standalone harness and fed it a synthetic top-red/bottom-blue QVideoFrame directly via QVideoSink::setVideoFrame() (bypassing camera hardware/libcamera entirely, which doesn't enumerate the v4l2loopback device available in this environment). Before the fix: red/blue came out swapped (upside down). After the fix: correct orientation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant