Skip to content

feat(video): add NV2A presentation and live performance statistics - #340

Merged
ReenigneArcher merged 3 commits into
masterfrom
codex/feat-video-presentation-stats
Nov 14, 2026
Merged

ReenigneArcher merged 3 commits into
masterfrom
codex/feat-video-presentation-stats

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Description

Add GPU-assisted video presentation and a live performance panel across every presentation path. Video decoding runs on the CPU, using the existing H.264 stream support.

  • Enable NV2A PVIDEO color conversion/scaling by default, with bounded synchronization, stable DMA bounds, safe buffer retirement, and restoration of visible software output on teardown or failure.
  • Enable FFmpeg's Pentium III MMX/SSE NASM kernels and w32threads support through private nxdk adapters. Keep one decoder worker and provide aligned, padded media buffers and allocation adapters.
  • Show measured incoming/decoded/rendered FPS, payload bitrate, host processing time, RTT/variance, stage timings, frame drops, queues, and the active presentation path.
  • Cache/rasterize the panel once per second and composite it into GPU YUY2, direct software RGB, or SDL output. Use integer-based numeric formatting supported by nxdk's C runtime.
  • Always show GPU/software frame counts after a stream, with a prominent SOFTWARE FALLBACK USED message and reason when applicable.
  • Retain opt-in PVIDEO and MPEG-2 sampling experiment builds, native regression coverage, NASM build/CI dependencies, operating instructions, aligned Markdown tables, and contributor guidance. The sampling probe is standalone and does not require a negotiated MPEG-2 stream.
  • Include the telemetry atomic-ordering and explicit source-plane validation fixes from the Sonar follow-up.
  • Keep the NASM wrapper executable and pass its path directly to FFmpeg, so Linux/macOS select the COFF assembler wrapper instead of falling back to ELF/Mach-O output.
  • Calculate software-panel byte offsets in size_t; cover offset drawing, framebuffer padding, and all supported RGB formats.
  • Run every registered test through CTest, instrument the presenter target, and avoid uploading empty coverage from the uninstrumented Windows Clang build.

#339 has merged. This branch is rebased onto master at 3076e68 and can merge before #194. It retains master's upstream common-library pin and does not add legacy-codec negotiation or the pending upstream common-library patch. Generic active-decoder reporting lets #194 extend codec selection afterward.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

  • Windows MSYS2 MinGW64: full host/Xbox build and XBE/ISO packaging passed with H.264-only negotiation and master's upstream common-library revision 94c65fd.
  • Built both GPU-enabled and software-only presentation variants. Both PVIDEO and MPEG-2 sampling experiment ISOs were also built.
  • ctest --test-dir cmake-build-release --output-on-failure: 285/285 passed, including presenter lifecycle/MMIO, source-plane validation, aligned allocation, telemetry, and panel pixel-format coverage.
  • Strict Dockle/Doxygen api build passed (438 HTML pages).
  • Shared clang-format, explicit experiment formatting checks, and git diff --check passed.
  • All 17 tracked CMake files pass cmake-lint --line-width 120 --tab-size 4 with cmakelang 0.6.13, matching CI.
  • Rebuilt the Xbox client and both experiment ISOs after repairing the assembler selection. Probed ELF32, Mach-O32, and Win32 input defaults: the wrapper produced COFF-i386 objects in every case.
  • A separate GCC-instrumented host build passed all 285 tests and generated a nonempty gcovr report, including the NXDK presenter implementation. Windows Clang remains intentionally uninstrumented.
  • Workflow YAML passes the inherited yamllint configuration.
  • Verified that this branch changes no dependency pins and contains none of feat(video): add selectable video codecs #194's codec-selection or shared-negotiation changes.
  • During implementation, the user confirmed GPU streaming and the live panel in xemu. Live software-panel visibility and real Xbox hardware were not tested interactively during this separation.

Hosted checks passed for a99190f: Linux, macOS, and Windows builds/tests; Common Lint; CodeQL; SonarCloud; Read the Docs; and both Codecov gates. Codecov project coverage is 65.10% (master: 63.45%), with 81.57% patch coverage. The Linux report now contains 5,801 measured lines instead of the previous empty report.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

Comment thread src/streaming/video_overlay.cpp Fixed
@ReenigneArcher
ReenigneArcher force-pushed the codex/feat-video-presentation-stats branch from b436801 to 7848a25 Compare November 14, 2026 18:01
@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.57895% with 98 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.10%. Comparing base (3076e68) to head (a99190f).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/streaming/pvideo_presenter.cpp 71.42% 25 Missing and 21 partials ⚠️
src/streaming/video_overlay.cpp 80.48% 7 Missing and 9 partials ⚠️
src/streaming/stats_overlay.cpp 87.12% 2 Missing and 11 partials ⚠️
src/streaming/video_acceleration.cpp 79.06% 0 Missing and 9 partials ⚠️
src/_nxdk_compat/ffmpeg_memory.c 80.00% 2 Missing and 4 partials ⚠️
src/streaming/mpeg2_prediction.cpp 86.66% 1 Missing and 3 partials ⚠️
src/app/client_state.cpp 33.33% 0 Missing and 2 partials ⚠️
src/streaming/aligned_media_buffer.h 86.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #340      +/-   ##
==========================================
+ Coverage   63.45%   65.10%   +1.65%     
==========================================
  Files          39       49      +10     
  Lines        5347     5875     +528     
  Branches     2431     2621     +190     
==========================================
+ Hits         3393     3825     +432     
- Misses       1122     1160      +38     
- Partials      832      890      +58     
Flag Coverage Δ
Linux 64.42% <78.99%> (+1.31%) ⬆️
macOS 52.62% <74.66%> (+2.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/app/client_state.h 97.87% <100.00%> (ø)
src/app/settings_storage.h 100.00% <ø> (ø)
src/streaming/pvideo_presenter.h 100.00% <100.00%> (ø)
src/streaming/stats_overlay.h 100.00% <100.00%> (ø)
src/streaming/video_acceleration.h 100.00% <100.00%> (ø)
src/streaming/video_overlay.h 100.00% <100.00%> (ø)
src/app/client_state.cpp 67.12% <33.33%> (ø)
src/streaming/aligned_media_buffer.h 86.66% <86.66%> (ø)
src/streaming/mpeg2_prediction.cpp 86.66% <86.66%> (ø)
src/_nxdk_compat/ffmpeg_memory.c 80.00% <80.00%> (ø)
... and 4 more

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3076e68...a99190f. Read the comment docs.

@ReenigneArcher
ReenigneArcher force-pushed the codex/feat-video-presentation-stats branch from 7848a25 to a99190f Compare November 14, 2026 18:48
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher marked this pull request as ready for review November 14, 2026 20:06
@ReenigneArcher
ReenigneArcher merged commit ff81ce0 into master Nov 14, 2026
17 checks passed
@ReenigneArcher
ReenigneArcher deleted the codex/feat-video-presentation-stats branch November 14, 2026 20:06
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.

2 participants