fix(webview): gate VideoView/QtMultimedia behind Qt6 so Qt5 boards build#2946
Merged
Merged
Conversation
PR #2905 added VideoView (QMediaPlayer + QGraphicsVideoItem) for in-process video playback on Qt6 boards, but the .pro included its source on every build. Pi 2 / Pi 3 cross-compile against Qt 5.15 and videoview.h includes `<QAudioDevice>` (Qt 6.2+ only), so the Qt5 toolchain fails at compile time — every Docker Image Build on master since the PR landed has died at "videoview.h:3:10: fatal error: QAudioDevice: No such file or directory". Wrap VideoView (.pro entry, .h/.cpp include, the playVideo/stopVideo slots on MainWindow + View, hideVideoSurface, the videoEnded relay signal, and the resize/loadPage/loadImage call-sites) in a QT_VERSION_CHECK(6, 0, 0) gate so Qt5 boards skip it cleanly. Safe at runtime: pi2/pi3 route video through VLCMediaPlayer painting straight to the framebuffer (see MediaPlayerProxy.get_instance in src/anthias_viewer/media_player.py) and never call the AnthiasViewer playVideo D-Bus slot. Verified pi3 (Qt5, linux/arm/v7) viewer image builds cleanly via `python -m tools.image_builder --service viewer --build-target pi3`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issues Fixed
Docker Image Build has been red on
mastersince #2905 — every push fails thepi2andpi3matrix legs at compile time:This blocks cutting a release.
Description
VideoViewis a Qt 6 component (QMediaPlayer+QGraphicsVideoItem,<QAudioDevice>is Qt 6.2+). Pi 2 / Pi 3 still cross-compile against the frozen Qt 5.15 toolchain pinned atWebView-v2026.04.1, so they can't see the file. PR #2905 addedvideoview.cpptoAnthiasViewer.pro'sSOURCESunconditionally and the Qt5 builds broke.This change wraps every reference to VideoView in a
QT_VERSION_CHECK(6, 0, 0)gate:AnthiasViewer.pro—QT += multimedia multimediawidgetsand thevideoview.cpp/hentries move insidegreaterThan(QT_MAJOR_VERSION, 5).mainwindow.{h,cpp}—playVideo/stopVideoslots and thevideoEndedsignal, plus the constructor'sview→MainWindowrelay, only declared/defined on Qt 6.view.{h,cpp}—#include "videoview.h", thevideoViewmember,playVideo/stopVideo/hideVideoSurface, and the resize /loadPage/loadImagecall-sites only built on Qt 6.Safe at runtime:
MediaPlayerProxy.get_instanceinsrc/anthias_viewer/media_player.pyroutes Pi 1/2/3 toVLCMediaPlayer, which paints straight to the framebuffer and never calls AnthiasViewer'splayVideoD-Bus slot. Qt6 boards (pi4-64, pi5, x86, arm64) keep the existingMPVMediaPlayer→ D-Bus → VideoView path unchanged.Checklist
Test plan
python -m tools.image_builder --service viewer --build-target pi3builds cleanly (Qt5 cross-compile, was the failing matrix leg).🤖 Generated with Claude Code