Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
feat(player): add shared 90-degree picture rotation with responsive view
Veyra Goal Agentcfe57ffd4088
diff --git a/AGENTS.md b/AGENTS.mdindex a91b2e30..c836ca97 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,5 +1,7 @@# Veyra 项目 Agent 执行规则+> **2026-10-23 画面旋转(Codex)**:用户要求极简/专业小按钮每次顺时针90°并适配UI。4eee190干净源码切codex/picture-rotation-20261023,起点标签checkpoint/pre-picture-rotation-20261023。按docs/PICTURE_ROTATION_PLAN_2026-10-23.md复用已有元数据呈现/坐标映射,允许必要PreviewView/EngineController/bridge/QML/翻译/定向测试接点,覆盖这些范围旧UI冻结;不继续Lecram或修改其它工作树。不改专有运行库/模型/驱动或真实配置,全E盘,复用同源构建限-j2≤900秒/单测试≤300秒,单Agent,无main合并/push/发布。+> **2026-10-21 Claude 中断任务接手(Codex)**:用户要求“把后续工作接上,然后完成他”,后明确“Lecram,先放着,不弄了”。仅在 E盘既有 screen-recording-fix-20261022 工作树、codex/claude-handoff-20261022 完成 AMD 超分关闭和带声音的处理后实时录制修复、相关构建/回归/本地测试包;这些必要接点覆盖旧 UI 冻结。20个未提交源码先保存 ZIP/patch/SHA 与检查点5614e8d,AMD修复移入88dbc26,计划docs/CLAUDE_HANDOFF_PLAN_2026-10-22.md。Lecram 保留不继续。单 Agent、-j2构建≤900秒/单测试≤300秒、全E盘私有配置、不触碰真实配对主机/他人进程/运行库/模型/驱动;旧桌面与其他任务保留。不合 main/push/发布。> **2026-10-19 2.1.0 正式发布(Codex)**:用户已实测并批准 `test-packages/bilibili-2.1.0-20261019` 两包原样发布,禁止重新构建/打包。按 docs/RELEASE_2.1.0_PLAN_2026-10-19.md 整理2.0.9以来全部合入内容、替换用户新6群二维码、更新README/Release,主Release只放两个GPU包,源码另页;允许main普通快进/push/新标签及发布。Lecram两个实验分支暂停保留,不入本版。公告只拟稿,不代发、不关机、不派Agent、不改运行文件/驱动/真实配置;产物全E盘。diff --git a/docs/PICTURE_ROTATION_PLAN_2026-10-23.md b/docs/PICTURE_ROTATION_PLAN_2026-10-23.mdnew file mode 100644index 00000000..18d6b98b--- /dev/null+++ b/docs/PICTURE_ROTATION_PLAN_2026-10-23.md@@ -0,0 +1,9 @@+# 画面手动旋转++用户要求极简/专业模式小按钮,每次顺时针90°,画面旋转后界面适配。继承上一轮 AMD关闭/录制已验源码4eee190,在同一干净E盘工作树切codex/picture-rotation-20261023;起点标签checkpoint/pre-picture-rotation-20261023。其它工作树和待提交全屏修复保持,不合main/push/发布。++复用PreviewView、PresentBlit、XeSS既有元数据旋转和输入映射,只增加独立会话级手动偏移,不改处理/解码/增强纹理坐标。现有旋转接口的必要engine/header/bridge/QML接点由本次用户功能请求覆盖旧UI冻结;本轮不是旧无人值守UI迁移,固定旧桌面/旧分支的migration-scope-guard不适用,不修改guard或其基线来制造通过。专有运行库/模型/驱动及真实配置保持。++两模式及全屏共用RotateButton;4次恢复、关闭后新源清零,模式/全屏/暂停/seek不清零;旋转时重置缩放和平移并取消未完成选区。DAR仅叠加手动旋转,不重复应用元数据;固定比例也随手动旋转转为纵向。极简窗口按旋转后比例适配,控件保持正向;专业模式保持布局并适配预览。游戏模式旋转时沿用已有非1:1预览的键盘/手柄策略,拦截错位鼠标穿透。++验收:所有元数据方向×4次手动旋转×7显示模式的比例/坐标与滚轮锚定契约;实际D3D12着色器色块像素;真实播放器桥接/两按钮/窗口比例/全屏/暂停/切源/录制回归;四语言、QtQuick和既有UI/修复契约。只声称通过的具体场景,不承诺绝无bug。全E盘codex-picture-rotation-20261023目录;复用build/claude-screen-recording-20261022(同源路径),-j2≤900秒,单测试≤300秒,单Agent。日志和未验项追加WORKLOG与报告。diff --git a/docs/PICTURE_ROTATION_REPORT_2026-10-23.md b/docs/PICTURE_ROTATION_REPORT_2026-10-23.mdnew file mode 100644index 00000000..041c8464--- /dev/null+++ b/docs/PICTURE_ROTATION_REPORT_2026-10-23.md@@ -0,0 +1,37 @@+# 画面旋转实现与本地验收++## 行为和实现++基于本对话上一轮 AMD 超分关闭/录制修复源码4eee190,分支codex/picture-rotation-20261023。起点存档checkpoint/pre-picture-rotation-20261023,旧分支、其它工作树、main和公开版本保持。++极简/专业播放条增加28px顺时针图标按钮,全屏复用极简播放条,每次90°,四次恢复;未开片源禁用。共享RotateButton及同一个桥接动作。手动方向是会话级状态,和容器方向叠加;不修改原文件,不保存到预设。切换模式、全屏、暂停、seek保留方向,新开片源清零。操作在引擎锁内检查会话ID,旧源的延迟点击不能旋转新源。++PreviewView已有的GPU呈现/坐标映射支持旋转,增加独立userQuarterTurns,供呈现/鼠标源坐标/字幕边界共用。源DAR只包含容器方向,手动偏移单独倒置;native及固定比例均适配。旋转时回到居中100%并取消未完成的保护选区。原始处理纹理/估计运动/增强历史不旋转,XeSS沿用已有方向变更重置和运动映射。++极简窗口高度/宽度按旋转后的比例适配并限制屏幕边界。修复MinimalPage原先在高度变化时套回源比例的反馈,避免旋转后反复跳回横屏。播放条左区允许缩小以容纳新按钮;专业模式预览区正确容纳画面,控件与菜单保持正向。游戏模式手动角度非零时沿用已有Scaled输入策略:键盘/手柄留给源窗口,阻止错误鼠标穿透。++**作用范围是播放视图。** 图片截图、视频录制与离线导出继续使用原方向的处理纹理;用户本次没有要求旋转输出文件。本地包说明明确此项,不把视图方向冒充导出能力。++## 构建和验证++所有产物在E:/项目/Veyra/{logs,tests,tmp,reports,test-packages,archives}/codex-picture-rotation-20261023。复用同源路径构建build/claude-screen-recording-20261022,没有修改其它源树、运行组件、模型、驱动或真实用户配置,无子Agent。构建命令:++ python -X utf8 -B -I scripts/acceptance/build-recording-handoff.py --task codex-picture-rotation-20261023 --root E:/项目/Veyra/worktrees/screen-recording-fix-20261022 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --label 2.1.0-rec veyra_qml_ui veyra_preview_geometry_tests veyra_qml_quick_tests veyra_ui_contract_tests veyra_ui_i18n_tests veyra_repair_contract_tests++- -j2,45.4秒通过,日志logs/.../build-20261023-064045;EXE SHA256 92d0df8e36075581d630b36946dc8bf8312770a6129915e43372313f3a80785b。内部版本沿用2.1.0-rec,本地包外部标识rot1。+- UI contract通过:既有384布局组合,新加4种容器角度×7显示模式×4次手动旋转,共112组比例/坐标/滚轮锚定状态,四次恢复及重置缩放检查。+- repair 272检查0失败;UI i18n 0失败;catalog2660条,三种译文零缺译/占位符问题。+- QtQuick109通过0失败(contracts-064254):新增共享按钮的真实Qt鼠标事件,12次交替点击与状态同步、无片源禁用。真实播放器夹具调用按钮生产clicked信号,不冒充物理鼠标验收。+- 实际D3D12呈现像素23例通过(gpu-contracts-064445):包括manual90/180/270/360、容器90+手动90、原图对照、缩放、原像素、固定比例、窗口尺寸保留。像素PNG在同目录pixels,manual90.png已人工查看。+- 真实播放器回归:wide-zh-CN-064450、metadata-zh-CN-064617(ffprobe核验显示矩阵,程序顺时针270°)、portrait-zh-TW-064718、wide-software-en-064852均通过。覆盖两按钮及全屏复用、暂停/seek、模式往返、横竖窗口适配、全部显示比例、重新打开清零;软件界面由--obs-game-capture及software UI日志确认。+- 日文record-ja-065008:旋转和布局通过,实际NVENC H.264录制49.5秒、1380帧、零丢帧、正常收尾。原统计读取fragmented MP4中缺失的nb_frames误报0,失败report.json保留;改用ffprobe -count_frames解码计数,独立reports/.../recording-recheck.json通过。文件640×360,录制方向未随预览改变。++## 失败记录和边界++首个旋转元数据夹具用FFmpeg8的metadata rotate未写出display matrix,探测阶段失败,未计入通过;改用其本机帮助确认的-display_rotation输入选项重新生成并ffprobe核验。旧无矩阵文件保留。++AMD核显真实D3D12 +150% DPI:wide-amd-zh-CN-065142的旋转/布局断言通过,但seek/重新打开有decoder send_packet -22并回退软件,整体严格门槛判失败。未改动的rec2原EXE、原QML、相同片源与AMD/150%配置,在baseline-amd-065446复现两次同错误;其录制EXE身份由原包清单记录。不能将此称为本轮旋转新引入,也不能称为已修复。单列为已有AMD硬解seek问题,不在本轮改解码器。++进一步用同一AMD核显、150% DPI及明确软件解码隔离验证旋转,wide-amd-swdecode-zh-CN-065527全部通过,零错误;日志明确device context initialized adapter=AMD Radeon(TM) Graphics。没有验证AMD独显/RX9000、其它NVIDIA型号、Intel、真实采集卡/主机串流、HDR、跨屏DPI切换、真实游戏鼠标策略、光学显示延迟或长时间稳定性。既有DLSS SR首次新缓存JIT问题沿用上一轮报告,不作新通过声明。++本轮不合main、不push、不发布;本地包保留可用目录和ZIP,并按逐文件清单核验运行库/模型/着色器与rec2供体原样一致。命令scripts/acceptance/package-picture-rotation.py,准确源码提交、ZIP大小/SHA、文件计数以reports/.../packages.json为准,后续只追加文档回执不改变包内源码身份。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 79b21b38..bcb66f05 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -9881,3 +9881,18 @@ Branch claude/aa-53-20261017 from main 26c0d61. Archive E:/项目/Veyra/archives收尾:产品源码26c7212。NVIDIA/AMD两ZIP698122675/501825845bytes、CRC/1736与2289文件SHA/177与246原样运行组件检查通过;GPU及--obs-game-capture明确软件UI的四次冷启动通过。final.json、packages.json、cold-start.json、source.json及DELIVERY.md保存准确路径/SHA/边界。verify-recording-handoff.py加入仓库供复现;源码26c7212.zip核验通过。封包Path.with_suffix导致名称截断已修正后重新封包,失败原件保留。自动审批拒绝清理任务自建解压副本和中间包(blocked by policy),未绕过,cleanup.json记录保留目录;原供体/源码/其他树不受影响。无main合并、push、发布。+++## 2026-10-23 画面手动旋转(Codex)++用户要求极简/专业模式加90°小按钮并适配UI。从上一轮4eee190干净E盘工作树切codex/picture-rotation-20261023,起点标签checkpoint/pre-picture-rotation-20261023;其它树和旧桌面不改,无Agent/main合并/push/发布。范围见docs/PICTURE_ROTATION_PLAN_2026-10-23.md,结果见docs/PICTURE_ROTATION_REPORT_2026-10-23.md。++PreviewView会话级userQuarterTurns叠加容器角度,复用呈现/鼠标/字幕/XeSS旋转;新增共享RotateButton(极简/专业/全屏)、桥接动作和四语言。极简高度反馈改用旋转后比例,播放条左区可缩小;旋转重置缩放/平移和未完成选区,切源清零、模式/暂停/seek/全屏保留。旋转非原位的游戏预览沿用已有Scaled策略避免错位鼠标穿透。截图/录制/导出保持原方向,未改处理纹理。++命令:build-recording-handoff.py --task codex-picture-rotation-20261023 --root E:/项目/Veyra/worktrees/screen-recording-fix-20261022 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --label 2.1.0-rec(6目标,-j2,45.4s通过);scripts/i18n/extract.py --check(2660,零缺译);picture-rotation.py --prepare --contracts / --case wide / metadata / portrait --language zh-TW / wide --software --language en / record --language ja / wide --amd --scale 1.5 / wide --amd --software-decode --scale 1.5。输出全E:/项目/Veyra/{logs,tests,tmp,reports,test-packages,archives}/codex-picture-rotation-20261023,构建沿用同源build/claude-screen-recording-20261022,私有profile,不动真实配置/运行组件/模型/驱动。++UI契约384既有布局+112新增方向/模式状态;repair272 checks0fail,i18n0fail,QtQuick109pass0fail;D3D12像素23例通过。真实横竖/元数据/软件界面/四语言、两按钮、暂停/seek/全屏往返/切源通过;日文旋转录制NVENC H264 1380帧正常收尾。原录制统计误读缺失nb_frames判失败,保留原report后以ffprobe -count_frames独立复核通过(recording-recheck.json);首个FFmpeg rotate夹具未写矩阵也保留,修正为本机帮助的-display_rotation后通过。++AMD150%硬解seek出现send_packet -22而自动回退软解,严格门槛判失败;未改动rec2原EXE/原QML同配置15秒对照复现(baseline-amd-065446),不归因旋转也不声称已修。明确软解的同卡150%旋转全回归通过(wide-amd-swdecode-zh-CN-065527)。其它GPU/真实采集/主机串流/HDR/跨屏/长期/游戏鼠标/光学延迟未验。无SDK/二进制新增Git。++本地封包命令scripts/acceptance/package-picture-rotation.py;两GPU完整目录及ZIP、精确源码/SHA/清单以reports/.../packages.json为准。内部版本沿用2.1.0-rec,外部rot1,不覆盖原rec2供体。收尾逐文件核验和冷启动结果另追加回执。diff --git a/i18n/catalog.json b/i18n/catalog.jsonindex 7a85d2e4..14117402 100644--- a/i18n/catalog.json+++ b/i18n/catalog.json@@ -17481,6 +17481,13 @@"en": "Page switcher","ja": "ページ切り替えバー"},+ {+ "zh": "顺时针旋转 90°(已旋转 %1°)",+ "src": "qml/RotateButton.qml",+ "zh-TW": "順時針旋轉 90°(已旋轉 %1°)",+ "en": "Rotate 90° clockwise (rotated %1°)",+ "ja": "時計回りに90°回転(%1°回転済み)"+ },{"zh": "须低于上限","src": "qml/BeautyEditor.qml",diff --git a/include/veyra/engine/EngineController.h b/include/veyra/engine/EngineController.hindex 8b53dff6..152277ad 100644--- a/include/veyra/engine/EngineController.h+++ b/include/veyra/engine/EngineController.h@@ -242,7 +242,8 @@ public:bool setPlaybackRate(double rate);void setFullscreenMemoryProtection(bool enabled);void observeHdrCoverage(bool on){hdrCoverageObserved_=on;}- void previewView(PreviewView view){if(!std::isfinite(view.zoom)||!std::isfinite(view.centerX)||!std::isfinite(view.centerY)||!std::isfinite(view.displayAspect)||view.displayAspect<0||view.mode<0||view.mode>6)return;std::lock_guard lock(mutex_);view.zoom=std::clamp(view.zoom,.05f,64.0f);if(view.displayAspect==0)view.displayAspect=previewView_.displayAspect;view.rotationDegrees=previewView_.rotationDegrees;previewView_=view;}+ void previewView(PreviewView view){if(!std::isfinite(view.zoom)||!std::isfinite(view.centerX)||!std::isfinite(view.centerY)||!std::isfinite(view.displayAspect)||view.displayAspect<0||view.mode<0||view.mode>6)return;std::lock_guard lock(mutex_);view.zoom=std::clamp(view.zoom,.05f,64.0f);if(view.displayAspect==0)view.displayAspect=previewView_.displayAspect;view.rotationDegrees=previewView_.rotationDegrees;view.userQuarterTurns=previewView_.userQuarterTurns;previewView_=view;}+ bool rotatePreviewClockwise(uint64_t session){std::lock_guard lock(mutex_);if(session!=snapshot_.sessionId||(!snapshot_.running&&!snapshot_.image))return false;previewView_.rotateClockwise();return true;}PreviewView previewView()const{std::lock_guard lock(mutex_);return previewView_;}void setVolume(float gain,bool mute);bool selectAudioTrack(uint64_t sessionId,int streamIndex);diff --git a/include/veyra/engine/PreviewView.h b/include/veyra/engine/PreviewView.hindex 9427e207..8fb48888 100644--- a/include/veyra/engine/PreviewView.h+++ b/include/veyra/engine/PreviewView.h@@ -11,10 +11,13 @@ struct PreviewView {// Container display rotation, clockwise. View centers live in the oriented// picture; processing/protection and estimated motion keep coded coordinates.int rotationDegrees=0;+ // Session-local user offset; source DAR already includes container rotation.+ unsigned userQuarterTurns=0;unsigned quarterTurns()const {const int angle=((rotationDegrees%360)+360)%360;- return angle%90==0?unsigned(angle/90):0;+ return ((angle%90==0?unsigned(angle/90):0)+userQuarterTurns)%4;}+ void rotateClockwise(){userQuarterTurns=(userQuarterTurns+1)%4;zoom=1;centerX=centerY=.5f;}std::pair<float,float> sourceUv(float u,float v)const {switch(quarterTurns()){case 1:return {v,1-u};case 2:return {1-u,1-v};case 3:return {1-v,u};default:return {u,v};@@ -27,9 +30,10 @@ struct PreviewView {}bool operator==(const PreviewView&)const=default;double aspect(float iw,float ih)const{- if(mode==4)return 16.0/9;if(mode==5)return 4.0/3;if(mode==6)return 21.0/9;+ const auto oriented=[this](double a){return userQuarterTurns&1?1/a:a;};+ if(mode==4)return oriented(16.0/9);if(mode==5)return oriented(4.0/3);if(mode==6)return oriented(21.0/9);if(quarterTurns()&1)std::swap(iw,ih);- return mode!=1&&std::isfinite(displayAspect)&&displayAspect>0?displayAspect:ih>0?double(iw)/ih:0;+ return mode!=1&&std::isfinite(displayAspect)&&displayAspect>0?oriented(displayAspect):ih>0?double(iw)/ih:0;}std::pair<float,float> renderedSize(float cw,float ch,float iw,float ih)const{if(cw<=0||ch<=0||iw<=0||ih<=0)return {0,0};diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.hindex ed677573..d8d54c0e 100644--- a/include/veyra/ui/QmlPlayerBridge.h+++ b/include/veyra/ui/QmlPlayerBridge.h@@ -279,6 +279,7 @@ class QmlPlayerBridge : public QObject {Q_PROPERTY(int sourceHeight READ sourceHeight NOTIFY snapshotChanged)Q_PROPERTY(double sourceFps READ sourceFps NOTIFY snapshotChanged)Q_PROPERTY(int sourceRotation READ sourceRotation NOTIFY snapshotChanged)+ Q_PROPERTY(int previewRotation READ previewRotation NOTIFY compareChanged)// The film's display aspect, so the window can snap to it in cinema mode// exactly as the prototype's fitAspect() does. 0 when nothing is open.Q_PROPERTY(double sourceAspect READ sourceAspect NOTIFY snapshotChanged)@@ -860,6 +861,8 @@ public:int sourceHeight() const;double sourceFps() const;int sourceRotation() const;+ int previewRotation() const;+ Q_INVOKABLE void rotatePictureClockwise();double sourceAspect() const;double previewAspect() const;diff --git a/qml/Veyra/CineBar.qml b/qml/Veyra/CineBar.qmlindex 08c871cc..870bfab0 100644--- a/qml/Veyra/CineBar.qml+++ b/qml/Veyra/CineBar.qml@@ -57,7 +57,7 @@ Rectangle {// --- left: artwork + title (230px) ---------------------------RowLayout {- Layout.preferredWidth: 230; Layout.minimumWidth: 230; Layout.maximumWidth: 230+ Layout.preferredWidth: 230; Layout.minimumWidth: 140; Layout.maximumWidth: 230Layout.fillHeight: truespacing: 10// The file's own cover art when it carries one (MP4 covr, MKV image@@ -367,7 +367,7 @@ Rectangle {// --- right: preset, volume, fullscreen (230px) ---------------RowLayout {- Layout.preferredWidth: 250; Layout.minimumWidth: 250; Layout.maximumWidth: 250+ Layout.preferredWidth: 284; Layout.minimumWidth: 284; Layout.maximumWidth: 284Layout.alignment: Qt.AlignVCenter | Qt.AlignRightspacing: 6@@ -398,6 +398,8 @@ Rectangle {}}+ RotateButton { objectName: "cine-rotate" }+Item {implicitWidth: 32; implicitHeight: 32VIcon {diff --git a/qml/Veyra/IconData.js b/qml/Veyra/IconData.jsindex 3e12cbd6..27832184 100644--- a/qml/Veyra/IconData.js+++ b/qml/Veyra/IconData.js@@ -71,6 +71,7 @@ var paths = {"bell": "M10.268 21a2 2 0 0 0 3.464 0M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326","coffee": "M10 2v2M14 2v2M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1M6 2v2","external": "M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",+ "rotatecw": "M20 7v5h-5M20 12a8 8 0 1 0-2.34 5.66","back10": "M11 17l-5-5 5-5M18 17l-5-5 5-5","fwd10": "M13 17l5-5-5-5M6 17l5-5-5-5","playfill": "M7 4L20 12L7 20z",diff --git a/qml/Veyra/MinimalPage.qml b/qml/Veyra/MinimalPage.qmlindex 8f08f903..d19b42c3 100644--- a/qml/Veyra/MinimalPage.qml+++ b/qml/Veyra/MinimalPage.qml@@ -174,7 +174,7 @@ VPage {function openSourceMenuForTest() { menuAnchor.x = width / 2; menuAnchor.y = pictureHeight / 2; sourceMenu.openAt(menuAnchor, "at") }// Report the film aspect upward so the window can snap to it.- onPictureHeightChanged: if (veyra.sourceAspect > 0.2) root.requestAspect(veyra.sourceAspect)+ onPictureHeightChanged: if (veyra.previewAspect > 0.2) root.requestAspect(veyra.previewAspect)signal requestAspect(real aspect)signal requestFullscreen()}diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qmlindex 9511f400..7de758ef 100644--- a/qml/Veyra/ProPage.qml+++ b/qml/Veyra/ProPage.qml@@ -919,6 +919,7 @@ VPage {height: 34spacing: 10PlaybackRateButton { objectName: "pro-playback-rate" }+ RotateButton { objectName: "pro-rotate" }VTag {objectName: "pro-fg-tag"visible: veyra.hasSourcediff --git a/qml/Veyra/RotateButton.qml b/qml/Veyra/RotateButton.qmlnew file mode 100644index 00000000..2f015005--- /dev/null+++ b/qml/Veyra/RotateButton.qml@@ -0,0 +1,14 @@+import QtQuick++VButton {+ icon: true+ ghost: true+ iconName: "rotatecw"+ implicitWidth: 28+ implicitHeight: 28+ enabled: veyra.hasSource+ Accessible.role: Accessible.Button+ Accessible.name: tip+ tip: qsTr("顺时针旋转 90°(已旋转 %1°)").arg(veyra.previewRotation)+ onClicked: veyra.rotatePictureClockwise()+}diff --git a/qml/Veyra/qmldir b/qml/Veyra/qmldirindex 90780570..b35ea6d7 100644--- a/qml/Veyra/qmldir+++ b/qml/Veyra/qmldir@@ -46,3 +46,4 @@ VSpinner 1.0 VSpinner.qmlVEqBars 1.0 VEqBars.qmlVTelemetryValue 1.0 VTelemetryValue.qmlSponsorPanel 1.0 SponsorPanel.qml+RotateButton 1.0 RotateButton.qmldiff --git a/scripts/acceptance/package-picture-rotation.py b/scripts/acceptance/package-picture-rotation.pynew file mode 100644index 00000000..8b0178be--- /dev/null+++ b/scripts/acceptance/package-picture-rotation.py@@ -0,0 +1,69 @@+"""Local rotation packages. Never overwrites an existing package or donor link.++usage: python -X utf8 -B -I scripts/acceptance/package-picture-rotation.py+"""+from pathlib import Path+import hashlib,json,os,subprocess,zipfile++B=Path('E:/项目/Veyra'); T='codex-picture-rotation-20261023'+ROOT=Path(__file__).resolve().parents[2];BUILD=B/'build/claude-screen-recording-20261022'+OUT=B/'test-packages'/T;REPORT=B/'reports'/T+for p in [OUT,REPORT]:p.mkdir(parents=True,exist_ok=True)+head=subprocess.check_output(['git','-C',str(ROOT),'rev-parse','HEAD'],text=True).strip()+assert not subprocess.check_output(['git','-C',str(ROOT),'status','--porcelain'],text=True).strip(),'commit source before sealing'++def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()++def replace(p,data):+ p.parent.mkdir(parents=True,exist_ok=True)+ if p.exists():p.unlink()+ p.write_bytes(data)++note='''# Veyra 2.1.0 画面旋转本地测试版(rot1)++完整解压,运行 veyra_qml_ui.exe。构建沿用内部 2.1.0-rec 标识,功能以本文件和清单 rot1 为准。++- 极简播放条、专业播放条和全屏播放条均有顺时针旋转小按钮,每次90°,四次恢复。+- 极简窗口按横竖比例调整,专业/全屏画面适配预览区,控件保持正向。+- 已有视频方向信息与手动旋转叠加。旋转时重置缩放/平移,取消未完成的保护选区。+- 切换模式、暂停、seek、进出全屏保留角度;新开片源清零。+- 本功能改变播放视图;截图、录制与导出仍使用处理纹理的原方向,不改写媒体。+- 游戏模式旋转时沿用非原位预览策略:保留键盘/手柄,拦截错位鼠标穿透。+- 包含上一轮 AMD 超分关闭与录制修复,专有运行库/模型/已编译着色器保持原样。++本地验证范围和未验项见 docs/PICTURE_ROTATION_REPORT_2026-10-23.md。不宣称绝无bug。+尚未合入main或公开发布,Lecram按用户要求暂停。+'''+results=[]+for vendor in ['NVIDIA','AMD']:+ donor=B/'test-packages/codex-claude-handoff-20261022'/f'Veyra-2.1.0-rec2-{vendor}-win64-portable'+ pkg=OUT/f'Veyra-2.1.0-rot1-{vendor}-win64-portable'+ assert donor.is_dir() and not pkg.exists(),pkg+ for src in donor.rglob('*'):+ dst=pkg/src.relative_to(donor)+ if src.is_dir():dst.mkdir(parents=True,exist_ok=True)+ else:os.link(src,dst)+ replace(pkg/'veyra_qml_ui.exe',(BUILD/'veyra_qml_ui.exe').read_bytes())+ for folder in ['qml','i18n']:+ for src in (ROOT/folder).rglob('*'):+ if src.is_file():replace(pkg/folder/src.relative_to(ROOT/folder),src.read_bytes())+ for name in ['PICTURE_ROTATION_PLAN_2026-10-23.md','PICTURE_ROTATION_REPORT_2026-10-23.md']:+ replace(pkg/'docs'/name,(ROOT/'docs'/name).read_bytes())+ replace(pkg/'README-TEST.zh-CN.md',note.encode('utf8'))+ old=json.loads((donor/'package-manifest.json').read_text('utf8'));unchanged=[]+ for e in old['files']:+ if e['path'].lower().endswith(('.dll','.onnx','.tflite','.dxil','.hsaco')):+ assert sha(pkg/e['path'])==e['sha256'].lower()==sha(donor/e['path']),e['path']+ unchanged.append(e['path'])+ files=[dict(path=p.relative_to(pkg).as_posix(),size=p.stat().st_size,sha256=sha(p)) for p in sorted(pkg.rglob('*')) if p.is_file() and p.name!='package-manifest.json']+ manifest=dict(old);manifest.update(candidate='2.1.0-rot1-local',sourceArchiveCommit=head,productSourceCommit=head,sourceParent='4eee190617615bbd55fea2fc84d171ec14639df1',validationRecord='docs/PICTURE_ROTATION_REPORT_2026-10-23.md',exeSha256=sha(pkg/'veyra_qml_ui.exe'),files=files,localOnly=True,releaseReady=False)+ replace(pkg/'package-manifest.json',json.dumps(manifest,ensure_ascii=False,indent=2).encode('utf8'))+ archive=Path(str(pkg)+'.zip');assert not archive.exists(),archive+ with zipfile.ZipFile(archive,'w',zipfile.ZIP_DEFLATED,compresslevel=1) as z:+ for p in pkg.rglob('*'):+ if p.is_file():z.write(p,pkg.name+'/'+p.relative_to(pkg).as_posix())+ with zipfile.ZipFile(archive) as z:assert z.testzip() is None+ result=dict(vendor=vendor,package=str(pkg),zip=str(archive),source=head,exeSha256=manifest['exeSha256'],zipSha256=sha(archive),zipBytes=archive.stat().st_size,manifestFiles=len(files),unchangedRuntimeModelShaderFiles=len(unchanged))+ results.append(result);print(json.dumps(result,ensure_ascii=False),flush=True)+(REPORT/'packages.json').write_text(json.dumps(results,ensure_ascii=False,indent=1),'utf8')diff --git a/scripts/acceptance/picture-rotation.py b/scripts/acceptance/picture-rotation.pynew file mode 100644index 00000000..65c4c793--- /dev/null+++ b/scripts/acceptance/picture-rotation.py@@ -0,0 +1,108 @@+"""Rotation tests in a private native player, with unchanged released runtimes.++Run --prepare once, --contracts for GPU pixel checks, or --case wide|metadata|portrait.+All subprocesses use private profiles on E:, and each run is bounded to 240 s.+"""+from pathlib import Path+import argparse, hashlib, json, os, shutil, subprocess, time++B=Path('E:/项目/Veyra'); T='codex-picture-rotation-20261023'+ROOT=Path(__file__).resolve().parents[2]; BUILD=B/'build/claude-screen-recording-20261022'+DONOR=B/'test-packages/codex-claude-handoff-20261022/Veyra-2.1.0-rec2-NVIDIA-win64-portable'+APP=B/'tests'/T/'app'; MEDIA=B/'tests'/T/'media'+FF=next((Path(os.environ['LOCALAPPDATA'])/'Microsoft/WinGet/Packages/Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe').glob('*/bin'))++def replace(dst,src):+ if dst.exists(): dst.unlink()+ dst.parent.mkdir(parents=True,exist_ok=True)+ shutil.copyfile(src,dst)++def prepare():+ if not APP.exists():+ for src in DONOR.rglob('*'):+ dst=APP/src.relative_to(DONOR)+ if src.is_dir(): dst.mkdir(parents=True,exist_ok=True)+ else: os.link(src,dst)+ for name in ['veyra_qml_ui','veyra_preview_geometry_tests']:+ replace(APP/(name+'.exe'),BUILD/(name+'.exe'))+ for src in (ROOT/'qml').rglob('*'):+ if src.is_file(): replace(APP/'qml'/src.relative_to(ROOT/'qml'),src)++def env_for(profile,tmp,log):+ for d in [profile,tmp,log]:d.mkdir(parents=True,exist_ok=True)+ env={k:v for k,v in os.environ.items() if not k.upper().startswith(('VEYRA_','QT_','QSG_','QML_'))}+ env.update(TEMP=str(tmp),TMP=str(tmp),APPDATA=str(profile/'AppData'),LOCALAPPDATA=str(profile/'LocalAppData'),+ CUDA_CACHE_PATH=str(tmp/'cuda'),QML_DISABLE_DISK_CACHE='1',QT_FORCE_STDERR_LOGGING='1',VEYRA_LOG_FILE=str(log/'engine.log'))+ return env++def media(case):+ MEDIA.mkdir(parents=True,exist_ok=True)+ wide=MEDIA/'wide.mp4'; portrait=MEDIA/'portrait.mp4'; rotated=MEDIA/'metadata90-matrix.mp4'+ base=portrait if case=='portrait' else wide+ if not base.exists():+ size='360x640' if case=='portrait' else '640x360'+ subprocess.run([str(FF/'ffmpeg.exe'),'-v','error','-f','lavfi','-i','testsrc2=size='+size+':rate=30','-t','100','-c:v','libx264','-preset','ultrafast','-pix_fmt','yuv420p','-y',str(base)],check=True,timeout=120)+ if case=='metadata':+ if not rotated.exists():subprocess.run([str(FF/'ffmpeg.exe'),'-v','error','-display_rotation:v','90','-i',str(wide),'-c','copy','-y',str(rotated)],check=True,timeout=60)+ # FFmpeg's display matrix sign and the app's clockwise convention are+ # different. Derive the fixture metadata from the actual probe result.+ probe=json.loads(subprocess.check_output([str(FF/'ffprobe.exe'),'-v','error','-show_streams','-of','json',str(rotated)]))+ angle=next(s['rotation'] for s in probe['streams'][0]['side_data_list'] if 'rotation' in s)+ return rotated,9/16,(-int(angle))%360+ return base,(9/16 if case=='portrait' else 16/9),0++def main():+ p=argparse.ArgumentParser();p.add_argument('--prepare',action='store_true');p.add_argument('--contracts',action='store_true');p.add_argument('--case',choices=['wide','metadata','portrait','record']);p.add_argument('--software',action='store_true');p.add_argument('--software-decode',action='store_true');p.add_argument('--amd',action='store_true');p.add_argument('--scale',type=float,default=1);p.add_argument('--language',default='zh-CN');a=p.parse_args()+ if a.prepare:prepare()+ if not a.contracts and not a.case:return+ case='gpu-contracts' if a.contracts else a.case+('-software' if a.software else '')+('-amd' if a.amd else '')+('-swdecode' if a.software_decode else '')+'-'+a.language+ stamp=time.strftime('%H%M%S');log=B/'logs'/T/(case+'-'+stamp)+ profile=B/'tests'/T/'profiles'/(case+'-'+stamp);tmp=B/'tmp'/T/(case+'-'+stamp)+ env=env_for(profile,tmp,log)+ env['QT_SCALE_FACTOR']=str(a.scale)+ if a.contracts:cmd=[str(APP/'veyra_preview_geometry_tests.exe'),str(log/'pixels')]+ else:+ m,aspect,metadata=media(a.case)+ prefs=dict(language=a.language,autoResume=False,prewarmEnhancement=False)+ if a.amd:prefs.update(monitorGpu='1002:13c0:88771043',computeOnMonitorGpu=True)+ if a.software_decode:prefs['decode']='software'+ (profile/'qml-preferences.v1.json').write_text(json.dumps(prefs),'utf8')+ qml=(ROOT/'qml/Veyra/Main.qml').read_text('utf8');pos=qml.rfind('}')+ cfg=dict(media=str(m),aspect=aspect,metadata=metadata)+ if a.case=='record':+ rec=B/'tests'/T/'recordings'/stamp;rec.mkdir(parents=True);cfg['recordDir']=str(rec)+ cfg=json.dumps(cfg)+ loader='\nLoader { source: '+json.dumps((Path(__file__).with_suffix('.qml')).as_uri())+'; onLoaded: item.config = '+json.dumps(cfg)+' }\n'+ dst=APP/'qml/Veyra/Main.qml'+ if dst.exists():dst.unlink()+ dst.write_text(qml[:pos]+loader+qml[pos:],'utf8')+ cmd=[str(APP/'veyra_qml_ui.exe'),'--page','pro','--size','1280x800','--data-dir',str(profile),'--exit-after','200000']+ if a.software:cmd.append('--obs-game-capture')+ cmd.append(str(m))+ # Never run concurrent GPU apps or stop processes belonging to other tasks.+ tasks=subprocess.check_output(['tasklist','/fo','csv','/nh'],text=True,errors='replace')+ assert not any(line.lower().startswith('"veyra') for line in tasks.splitlines()),'another Veyra process is running'+ with (log/'console.log').open('wb') as f:+ result=subprocess.run(cmd,cwd=APP,env=env,stdout=f,stderr=subprocess.STDOUT,timeout=240)+ console=(log/'console.log').read_text('utf8',errors='replace')+ engine=(log/'engine.log').read_text('utf8',errors='replace') if (log/'engine.log').exists() else ''+ errors=[l for l in engine.splitlines() if '[ERROR]' in l and 'Retrying to obtain clipboard' not in l]+ errors += [l for l in console.splitlines() if any(s in l for s in ['ReferenceError:', 'TypeError:', 'Binding loop detected', 'Unable to assign'])]+ with (APP/'veyra_qml_ui.exe').open('rb') as binary: exe_sha=hashlib.file_digest(binary,'sha256').hexdigest()+ report=dict(case=case,exit=result.returncode,exe_sha256=exe_sha,+ lines=[l for l in console.splitlines() if 'ROTATION' in l or 'PREVIEW_GEOMETRY' in l],errors=errors)+ report['passed']=result.returncode==0 and not errors and ('ROTATION PASS' in console if a.case else 'pass=0' not in console)+ if a.software:report['passed']=report['passed'] and 'software UI:' in engine+ if a.amd:report['passed']=report['passed'] and 'AMD Radeon(TM) Graphics' in engine+ if a.case=='record':+ files=[]+ for path in rec.glob('*.mp4'):+ data=json.loads(subprocess.check_output([str(FF/'ffprobe.exe'),'-v','error','-count_frames','-show_streams','-of','json',str(path)],timeout=300))+ video=next(s for s in data['streams'] if s['codec_type']=='video');files.append(dict(path=str(path),codec=video['codec_name'],width=video['width'],height=video['height'],frames=int(video.get('nb_read_frames',0))))+ report['files']=files+ report['passed']=report['passed'] and bool(files) and all(f['frames']>500 and f['width']==640 and f['height']==360 for f in files)+ (log/'report.json').write_text(json.dumps(report,ensure_ascii=False,indent=1),'utf8')+ print(json.dumps(report,ensure_ascii=False,indent=1)[-3500:]);print('LOG',log,flush=True)+ assert report['passed'],log++if __name__=='__main__':main()diff --git a/scripts/acceptance/picture-rotation.qml b/scripts/acceptance/picture-rotation.qmlnew file mode 100644index 00000000..cd5e231b--- /dev/null+++ b/scripts/acceptance/picture-rotation.qml@@ -0,0 +1,115 @@+// Private real-player fixture, loaded only by picture-rotation.py.+import QtQuick+import QtQuick.Window++Item {+ id: probe+ property string config: "{}"+ readonly property var cfg: JSON.parse(config)+ property var actions: []+ property int at: -1+ property int ticks: 0+ property int expected: 0+ property int expectedMetadata: 0+ function out(label, data) { console.log("ROTATION", label, JSON.stringify(data)) }+ function check(ok, why) { if (!ok) { out("FAIL", why); Qt.quit(); throw new Error(why) } }+ function find(item, name) {+ if (!item) return null+ if (item.objectName === name) return item+ for (const child of item.children || []) { const f = find(child, name); if (f) return f }+ return null+ }+ function button(cine) { return find(cine ? fullBar.contentItem : root.contentItem, cine ? "cine-rotate" : "pro-rotate") }+ function state() {+ const r = root.videoRect()+ return { page: root.page, fullscreen: root.fullscreen, rotation: veyra.previewRotation,+ metadata: veyra.sourceRotation, aspect: veyra.previewAspect, film: root.filmAspect,+ width: root.width, height: root.height, rect: r, paused: veyra.paused }+ }+ function verify() {+ check(veyra.previewRotation === expected, "rotation state " + JSON.stringify(state()))+ check(veyra.sourceRotation === expectedMetadata, "metadata was overwritten")+ check(Math.abs(veyra.previewAspect - (expected % 180 ? 1 / cfg.aspect : cfg.aspect)) < .001, "rotated aspect")+ if (root.page === "min" && !root.screenSized) {+ check(Math.abs(root.filmAspect - veyra.previewAspect) < .001, "cinema stale aspect")+ check(Math.abs(root.videoRect().height - root.height) <= 2, "cinema native viewport stale")+ check(root.height <= root.maxPictureHeight + 2, "portrait window runs off screen")+ }+ const r = root.videoRect()+ check(r.width > 0 && r.height > 0 && r.x >= -1 && r.y >= -1 && r.x + r.width <= root.width + 2 && r.y + r.height <= root.height + 2, "video overlaps controls")+ out("STATE", state())+ }+ function turn(cine) {+ const b = button(cine)+ check(b && b.enabled && b.visible, "rotation button unavailable")+ const owner = cine ? fullBar.contentItem : root.contentItem+ const p = b.mapToItem(owner, 0, 0)+ check(p.x >= 0 && p.x + b.width <= owner.width && p.y >= 0 && p.y + b.height <= owner.height, "rotation button clipped")+ // This fixture drives the production signal; QtQuick tests inject real+ // mouse events into the shared button separately.+ b.clicked()+ expected = (expected + 90) % 360+ }+ function add(fn) { actions.push(fn) }+ function setup() {+ expectedMetadata = cfg.metadata || 0+ if (cfg.recordDir) add(() => {+ check(veyra.setPreference("recordDir", cfg.recordDir), "record directory rejected")+ veyra.startRecording()+ })+ add(() => { verify(); turn(false) })+ add(() => { verify(); veyra.togglePlayPause() })+ add(() => { check(veyra.paused, "pause failed"); turn(false) })+ add(() => { verify(); veyra.seekTo(2) })+ add(() => { verify(); check(veyra.paused, "seek unpaused"); veyra.togglePlayPause() })+ add(() => { verify(); turn(false) })+ add(() => { verify(); turn(false) })+ add(() => { verify(); root.goPage("min") })+ for (let n = 0; n < 4; ++n) add(() => { verify(); turn(true) })+ add(() => { verify(); root.toggleFullscreen() })+ for (let n = 0; n < 4; ++n) add(() => { verify(); root.pointerActivity(); turn(true) })+ add(() => { verify(); root.toggleFullscreen() })+ add(() => { verify(); root.goPage("pro") })+ add(() => { verify(); root.toggleFullscreen() })+ add(() => { verify(); root.pointerActivity(); turn(true) })+ add(() => { verify(); root.toggleFullscreen() })+ add(() => { verify(); turn(false) })+ add(() => { verify(); turn(false) })+ add(() => { verify(); turn(false) })+ // All aspect choices must survive turns without the polling pass+ // resetting the user's offset or inverting metadata a second time.+ for (let mode = 0; mode < 7; ++mode) {+ add(() => {+ veyra.aspectMode = mode+ const base = veyra.previewAspect+ turn(false)+ check(Math.abs(veyra.previewAspect * base - 1) < .001, "aspect mode " + mode)+ })+ add(() => {+ check(veyra.previewRotation === 90, "aspect polling reset rotation")+ for (let n = 0; n < 3; ++n) turn(false)+ })+ }+ if (cfg.recordDir) {+ add(() => { check(veyra.recordingState.frames > 0 && !veyra.recordingState.failed, "recording failed during rotation"); veyra.stopRecording() })+ add(() => { check(!veyra.recordingState.finishing, "recording did not finish"); out("RECORDING", veyra.recordingState) })+ }+ add(() => { veyra.aspectMode = 0; verify(); turn(false); veyra.openPath(cfg.media) })+ add(() => { expected = 0; verify(); check(veyra.hasSource, "reopen failed"); out("PASS", state()); Qt.quit() })+ }+ Timer {+ interval: 100; repeat: true; running: true+ onTriggered: {+ ++probe.ticks+ if (probe.ticks > 1800) { probe.check(false, "fixture timeout"); return }+ if (probe.at < 0) {+ if (!veyra.hasSource || !veyra.sourceWidth || probe.ticks < 20) return+ veyra.nrEnabled = false; veyra.srEnabled = false; veyra.fgEnabled = false+ veyra.aspectMode = 0+ probe.setup(); probe.at = 0; probe.ticks = 0+ }+ if (probe.ticks % 12 !== 0) return+ if (probe.at < probe.actions.length) probe.actions[probe.at++]()+ }+ }+}diff --git a/scripts/acceptance/rotation-amd-baseline.qml b/scripts/acceptance/rotation-amd-baseline.qmlnew file mode 100644index 00000000..e85f465e--- /dev/null+++ b/scripts/acceptance/rotation-amd-baseline.qml@@ -0,0 +1,17 @@+import QtQuick+Item {+ id: test+ property string media: ""+ property int ticks: 0+ Timer {+ interval: 100; repeat: true; running: true+ onTriggered: {+ ++test.ticks+ if (test.ticks===40) veyra.togglePlayPause()+ if (test.ticks===60) veyra.seekTo(2)+ if (test.ticks===80) veyra.togglePlayPause()+ if (test.ticks===110) veyra.openPath(test.media)+ if (test.ticks===150) { console.log("ROTATION_BASELINE_DONE"); Qt.quit() }+ }+ }+}diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cppindex a7a46ea1..d7bdaa54 100644--- a/src/ui/QmlPlayerBridge.cpp+++ b/src/ui/QmlPlayerBridge.cpp@@ -1453,7 +1453,9 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesystconst bool wasFullscreenUnsafe = impl_->snapshot.vramFullscreenUnsafe;const auto wasTransport = impl_->snapshot.transport;const uint64_t wasSession = impl_->snapshot.sessionId;+ const auto oldSourceAspect=sourceAspect();if(impl_->poll()){emit settingsChanged();emitChainChanged();}+ if(wasSession!=impl_->snapshot.sessionId||oldSourceAspect!=sourceAspect())emit compareChanged();// Live recording state: the recorder owns the files, this side shows them.{const auto live=impl_->engine.recordingSnapshot();@@ -2947,7 +2949,7 @@ bool QmlPlayerBridge::gameMode() const { return impl_->gameModeSessionId != 0; }bool QmlPlayerBridge::passthroughActive() const { return impl_->passthroughShown; }bool QmlPlayerBridge::gameInputActive() const { return impl_->gameInputShown; }bool QmlPlayerBridge::gameScaledPreview() const {- return gameMode() && ui::gameViewportScaled(impl_->screenFillActive, impl_->aspectMode);+ return gameMode() && (ui::gameViewportScaled(impl_->screenFillActive, impl_->aspectMode) || previewRotation()!=0);}QRectF QmlPlayerBridge::gameVideoRect() const { return impl_->gameVideoRect; }void QmlPlayerBridge::attachMainWindow(qulonglong nativeHandle) {@@ -4759,6 +4761,16 @@ int QmlPlayerBridge::sourceWidth() const { return int(impl_->snapshot.sourceWidtint QmlPlayerBridge::sourceHeight() const { return int(impl_->snapshot.sourceHeight); }double QmlPlayerBridge::sourceFps() const { return impl_->snapshot.nominalSourceFps; }int QmlPlayerBridge::sourceRotation() const { return impl_->snapshot.sourceRotationDegrees; }+int QmlPlayerBridge::previewRotation() const { return int(impl_->engine.previewView().userQuarterTurns)*90; }+void QmlPlayerBridge::rotatePictureClockwise() {+ if(!hasSource()||!impl_->engine.rotatePreviewClockwise(impl_->snapshot.sessionId))return;+ // An in-progress protection selection uses the previous coordinate system.+ beginProtectionDraw(QString());+ tickSubtitles();+ if(gameMode()){updateGameGeometry();updateGameMode();emit gameModeChanged();}+ veyra::log::info("ui-rotation",std::format("session={} clockwise={}",impl_->snapshot.sessionId,previewRotation()));+ emit compareChanged();+}double QmlPlayerBridge::sourceAspect() const {const auto& s = impl_->snapshot;// A known DAR already includes SAR/rotation. With no DAR, rotate the coded@@ -8529,13 +8541,13 @@ void QmlPlayerBridge::setPresentationFullscreen(bool value) {}double QmlPlayerBridge::previewAspect() const {const int mode=impl_->screenFillActive?2:impl_->aspectMode;- if(mode==4)return 16.0/9;if(mode==5)return 4.0/3;if(mode==6)return 21.0/9;+ auto view=impl_->engine.previewView();+ view.mode=mode;+ view.rotationDegrees=impl_->snapshot.sourceRotationDegrees;+ view.displayAspect=impl_->snapshot.sourceDisplayAspect;const auto e=impl_->snapshot.metrics.resolution.output;- if(mode==1&&e.height){- engine::PreviewView view;view.mode=1;view.rotationDegrees=impl_->snapshot.sourceRotationDegrees;- return view.aspect(float(e.width),float(e.height));- }- return sourceAspect();+ if(mode==1&&e.height)return view.aspect(float(e.width),float(e.height));+ return view.aspect(float(impl_->snapshot.sourceWidth),float(impl_->snapshot.sourceHeight));}void QmlPlayerBridge::setDisplaySync(int value) {if (value < 0 || value > 2 || int(impl_->presentation.display) == value) return;diff --git a/tests/integration/PreviewGeometryTests.cpp b/tests/integration/PreviewGeometryTests.cppindex 1e83f0b1..f9f6ad79 100644--- a/tests/integration/PreviewGeometryTests.cpp+++ b/tests/integration/PreviewGeometryTests.cpp@@ -52,6 +52,19 @@ int wmain(int argc,wchar_t** argv){if(ok)ok=test("rotate90-native",rotated,0,{{152,104,255,0,255},{168,104,255,0,0},{152,136,255,255,255},{168,136,0,255,0}});}if(ok)ok=test("dar-4-3",{1,.5f,.5f,0,4.0/3},0,{{40,10,255,0,0},{280,10,0,255,0},{40,230,255,0,255}});+ if(ok){+ engine::PreviewView manual;+ manual.rotateClockwise();+ ok=test("manual90",manual,0,{{40,120,0,0,0},{130,60,255,0,255},{190,60,255,0,0},{130,180,255,255,255},{190,180,0,255,0}});+ manual.rotateClockwise();+ if(ok)ok=test("manual180",manual,0,{{40,80,255,255,255},{280,80,255,0,255},{40,160,0,255,0},{280,160,255,0,0}});+ manual.rotateClockwise();+ if(ok)ok=test("manual270",manual,0,{{130,60,0,255,0},{190,60,255,255,255},{130,180,255,0,0},{190,180,255,0,255}});+ manual.rotateClockwise();+ if(ok)ok=test("manual360",manual,0,{{160,10,0,0,0},{40,80,255,0,0},{280,80,0,255,0},{40,160,255,0,255}});+ manual.rotationDegrees=90;manual.displayAspect=.5;manual.rotateClockwise();+ if(ok)ok=test("manual90-plus-metadata90",manual,0,{{40,80,255,255,255},{280,80,255,0,255},{40,160,0,255,0},{280,160,255,0,0}});+ }if(ok)ok=test("stretch",{1,.5f,.5f,3},0,{{40,10,255,0,0},{280,10,0,255,0},{280,230,255,255,255}});if(ok)ok=test("forced-16-9",{1,.5f,.5f,4},0,{{160,10,0,0,0},{40,40,255,0,0},{280,200,255,255,255}});if(ok)ok=test("native",{1,.5f,.5f,1},0,{{40,80,0,0,0},{145,111,255,0,0},{175,129,255,255,255}});diff --git a/tests/qml/quick/tst_rotate_button.qml b/tests/qml/quick/tst_rotate_button.qmlnew file mode 100644index 00000000..df72bff6--- /dev/null+++ b/tests/qml/quick/tst_rotate_button.qml@@ -0,0 +1,36 @@+import QtQuick+import QtTest+import Veyra++Item {+ width: 400; height: 200+ QtObject {+ id: veyra+ property bool hasSource: true+ property int previewRotation: 0+ function rotatePictureClockwise() { previewRotation = (previewRotation + 90) % 360 }+ }+ RotateButton { id: pro; x: 50; y: 60 }+ RotateButton { id: cine; x: 150; y: 60 }+ TestCase {+ name: "PictureRotation"+ when: windowShown+ function init() { veyra.hasSource = true; veyra.previewRotation = 0 }+ function test_sharedAndWrap() {+ for (let n = 1; n <= 12; ++n) {+ const button = n % 2 ? pro : cine+ mouseClick(button, button.width / 2, button.height / 2)+ compare(veyra.previewRotation, (n % 4) * 90)+ verify(pro.tip.indexOf(String(veyra.previewRotation) + "°") >= 0)+ compare(pro.tip, cine.tip)+ }+ }+ function test_noSource() {+ veyra.hasSource = false+ mouseClick(pro, 14, 14)+ mouseClick(cine, 14, 14)+ compare(veyra.previewRotation, 0)+ compare(pro.enabled, false)+ }+ }+}diff --git a/tests/unit/UiContractTests.cpp b/tests/unit/UiContractTests.cppindex 940156f4..8e4280d1 100644--- a/tests/unit/UiContractTests.cpp+++ b/tests/unit/UiContractTests.cpp@@ -102,6 +102,28 @@ void outputRateContracts(){int wmain(int argc,wchar_t** argv){try{using namespace veyra;outputRateContracts();+ // Manual turns compose with metadata, including an already-oriented DAR.+ for(int metadata:{0,90,180,270})for(int mode=0;mode<=6;++mode){+ engine::PreviewView v;v.rotationDegrees=metadata;v.mode=mode;+ v.displayAspect=metadata%180?3.0/4:4.0/3;+ const auto base=v;const auto aspect=v.aspect(1920,1080);+ for(int n=1;n<=4;++n){+ v.rotateClockwise();+ require(v.quarterTurns()==unsigned((metadata/90+n)%4),"manual turn composes with metadata");+ require(std::abs(v.aspect(1920,1080)-(n%2?1/aspect:aspect))<.00001,"all display ratios follow manual rotation");+ const auto source=v.sourceUv(.23f,.71f);const auto display=v.displayUv(source.first,source.second);+ require(std::abs(display.first-.23f)<.00001&&std::abs(display.second-.71f)<.00001,"manual rotation inverse preserves pointer coordinates");+ const auto anchor=v.sourcePoint(133,91,320,240,1920,1080);+ v.wheel(2,133,91,320,240,1920,1080);+ const auto after=v.sourcePoint(133,91,320,240,1920,1080);+ require(std::abs(anchor.first-after.first)<.00001&&std::abs(anchor.second-after.second)<.00001,"zoom remains anchored after rotation");+ v.wheel(-2,133,91,320,240,1920,1080);+ }+ v.zoom=base.zoom;v.centerX=base.centerX;v.centerY=base.centerY;+ require(v==base,"four manual turns restore original metadata and display transform");+ v.zoom=3;v.centerX=.2f;v.rotateClockwise();+ require(v.zoom==1&&v.centerX==.5f&&v.centerY==.5f,"rotation recentres a zoomed picture");+ }{source::CaptureAudioClock c;require(c.observe({},100,10,false)==100,"untimed audio anchors to arrival");require(c.observe({},170,10,false)==110,"driver arrival jitter cannot stretch untimed PCM");require(c.observe(120,180,10,false)==120,"valid driver timestamp takes precedence");require(c.observe({},190,10,false)==130,"missing timestamps continue from valid samples");require(c.observe({},500,10,true)==500,"discontinuity reanchors untimed audio");require(c.observe(0,510,10,true)==0,"timestamp zero remains valid");}{ui::live_status::DashboardHistory history;engine::PlayerSnapshot s;diff --git a/tools/qt_probe/make-icons.py b/tools/qt_probe/make-icons.pyindex 62a7895f..aeb4628c 100644--- a/tools/qt_probe/make-icons.py+++ b/tools/qt_probe/make-icons.py@@ -63,6 +63,7 @@ for name, svg in re.findall(r"^\s*(\w+):\s*'([^']*)'", body, re.M):# Inline SVGs the prototype writes into pages-a.js instead of icons.js: the 10-second# skip buttons and the filled play/pause glyphs of the .play button (drawn with fill).EXTRA = {+ "rotatecw": '<path d="M20 7v5h-5M20 12a8 8 0 1 0-2.34 5.66"/>',"back10": '<path d="M11 17l-5-5 5-5"/><path d="M18 17l-5-5 5-5"/>',"fwd10": '<path d="M13 17l5-5-5-5"/><path d="M6 17l5-5-5-5"/>',"playfill": '<polygon points="7 4 20 12 7 20"/>',