Skip to content

feat(video): add selectable video codecs - #194

Draft
ReenigneArcher wants to merge 1 commit into
masterfrom
feat/decoder-choices
Draft

ReenigneArcher wants to merge 1 commit into
masterfrom
feat/decoder-choices

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented May 25, 2026 •

Copy link
Copy Markdown
Member

Description

Add H.264, MPEG-2/H.262, and H.263+ video codec selection. Auto prefers H.264, then MPEG-2, then H.263+; an explicit selection requests only that codec and fails negotiation when the host cannot provide it.

  • Label the preference Video Codec, persist streaming.video_codec, and continue reading existing streaming.video_decoder preferences.
  • Enable the matching FFmpeg decoders and parsers, report the active codec in stream status and statistics, and document the settings.
  • Share client-independent Sunshine protocol negotiation with other clients. The common library prefers AV1, HEVC, and H.264 before legacy codecs, preserves baseline SDP negotiation for older hosts, and rejects unsupported explicit requests.
  • Add settings migration, strict request-mask, codec priority/profile, host-advertisement, and wire-identifier regression tests.

#339 and #340 are merged. This PR is rebased directly onto current master (ff81ce0) and contains only the codec-selection commit. It uses the controller handling, GPU/software presentation, and live statistics already on master.

The common-library pin remains ed6b2da, based on upstream 94c65fd. This PR still depends on moonlight-common-c #175, which is open. Related host support is tracked in Sunshine #5194.

TODO:

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

  • Rebuilt both host test executables with Windows MSYS2 MinGW64. ctest --test-dir cmake-build-release --output-on-failure: 294/294 passed, including settings migration, codec negotiation, wire-format, controller, and presenter tests.
  • git range-diff confirms the single codec-selection commit is unchanged by the rebase. git diff --exit-code 90041bb HEAD is empty: the complete resulting tree, including dependency pins, is identical to the previous PR head.
  • The identical tree previously passed the full host/Xbox build, XBE/ISO packaging, both experiment builds, strict Dockle/Doxygen api documentation build (441 HTML pages), formatting, and all 17 CMake lint checks.
  • All 14 head checks passed on 90041bb, including Linux/macOS/Windows CI, Common Lint, CodeQL, SonarCloud, and Codecov. Checks on the new head will rerun after the push.
  • The custom common-library pin remains ed6b2da; master's newer toml++ remains cfd7159.

Real Xbox hardware and interactive emulator validation were not repeated for this history-only rebase.

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

AI tools generated much of the feature and assisted with implementation review, the shared protocol changes, settings migration, rebasing, documentation, and tests.

This pull request was updated by Codex (GPT-6; thinking level not exposed by this session).

@codecov

codecov Bot commented May 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.08696% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.83%. Comparing base (d9c10ee) to head (dff1ed2).
⚠️ Report is 51 commits behind head on master.

Files with missing lines Patch % Lines
src/app/settings_storage.cpp 52.38% 12 Missing and 8 partials ⚠️
src/ui/shell_view.cpp 0.00% 11 Missing and 3 partials ⚠️
src/app/client_state.cpp 62.06% 7 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
- Coverage   63.16%   62.83%   -0.33%     
==========================================
  Files          35       33       -2     
  Lines        5261     5330      +69     
  Branches     2385     2417      +32     
==========================================
+ Hits         3323     3349      +26     
- Misses        935      964      +29     
- Partials     1003     1017      +14     
Flag Coverage Δ
Linux 63.14% <51.68%> (-0.22%) ⬇️
macOS 49.85% <43.03%> (-0.10%) ⬇️

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.91% <100.00%> (+0.04%) ⬆️
src/startup/video_mode.cpp 61.62% <100.00%> (+0.91%) ⬆️
src/streaming/stats_overlay.cpp 100.00% <100.00%> (ø)
src/app/client_state.cpp 66.89% <62.06%> (-0.10%) ⬇️
src/ui/shell_view.cpp 58.52% <0.00%> (-1.61%) ⬇️
src/app/settings_storage.cpp 71.86% <52.38%> (-3.33%) ⬇️

... and 6 files with indirect coverage changes


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 d9c10ee...dff1ed2. Read the comment docs.

@ReenigneArcher
ReenigneArcher force-pushed the feat/decoder-choices branch 2 times, most recently from 0927719 to 5320639 Compare May 25, 2026 16:12
@ReenigneArcher
ReenigneArcher force-pushed the feat/decoder-choices branch 2 times, most recently from c00fc4c to 5a2991d Compare June 4, 2026 23:43
@ReenigneArcher
ReenigneArcher force-pushed the feat/decoder-choices branch 4 times, most recently from e8326cd to dff1ed2 Compare June 24, 2026 02:52
@SunshineStream SunshineStream deleted a comment from sonarqubecloud Bot Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.65385% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.02%. Comparing base (ff81ce0) to head (934387a).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/app/settings_storage.cpp 60.86% 9 Missing and 9 partials ⚠️
src/ui/shell_view.cpp 0.00% 14 Missing ⚠️
src/app/client_state.cpp 62.06% 7 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
- Coverage   65.10%   65.02%   -0.09%     
==========================================
  Files          49       50       +1     
  Lines        5875     5975     +100     
  Branches     2621     2654      +33     
==========================================
+ Hits         3825     3885      +60     
- Misses        969     1188     +219     
+ Partials     1081      902     -179     
Flag Coverage Δ
Linux 64.35% <59.00%> (-0.07%) ⬇️
macOS 52.59% <49.43%> (-0.04%) ⬇️

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.91% <100.00%> (+0.04%) ⬆️
src/app/settings_storage.h 100.00% <ø> (ø)
src/startup/video_mode.cpp 61.62% <100.00%> (+0.91%) ⬆️
src/streaming/video_codec_selection.cpp 100.00% <100.00%> (ø)
src/app/client_state.cpp 67.02% <62.06%> (-0.10%) ⬇️
src/ui/shell_view.cpp 57.08% <0.00%> (-1.57%) ⬇️
src/app/settings_storage.cpp 73.94% <60.86%> (-1.64%) ⬇️

... and 11 files with indirect coverage changes


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 ff81ce0...934387a. Read the comment docs.

Comment thread src/streaming/video_overlay.cpp Fixed
@ReenigneArcher
ReenigneArcher force-pushed the feat/decoder-choices branch 2 times, most recently from d7636d9 to 90041bb Compare November 14, 2026 18:52
@sonarqubecloud

Copy link
Copy Markdown

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