Skip to content

feat(video): Add selectable video decoder support#194

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

feat(video): Add selectable video decoder support#194
ReenigneArcher wants to merge 1 commit into
masterfrom
feat/decoder-choices

Conversation

@ReenigneArcher
Copy link
Copy Markdown
Member

@ReenigneArcher ReenigneArcher commented May 25, 2026

Description

Add user-selectable video decoder options and FFmpeg support for MPEG‑2 and H.263 family codecs.

  • UI & settings: introduce VideoDecoderSelection enum, expose a cycle action and compact labels in settings, persist video_decoder in TOML, and read/write parsing helpers with validation and warnings.
  • Session & negotiation: advertise supported video formats based on the selected decoder (auto / h264 / mpeg2 / h263 / h263p) when starting sessions and include decoder selection in stream logs and waiting screens.
  • FFmpeg backend: enable additional parsers/decoders in build config, select an appropriate FFmpeg codec at runtime based on the negotiated format, propagate human-readable decoder names, and update decoder logging/error messages.
  • Build: update CMake FFmpeg signature/profile and configure args to enable mpeg2 and h263 support.
  • Overlay & stats: show active decoder in overlay and include it in statistics snapshots.
  • Tests: update and add unit tests to cover default decoder, settings UI cycling, persistent loading, and overlay formatting.

These changes improve compatibility with hosts that stream non‑H.264 formats and let users force a specific software decoder when needed.

TODO:

Screenshot

Issues Fixed or Closed

Roadmap Issues

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
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 43.87755% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.70%. Comparing base (885d558) to head (6765ae5).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/app/settings_storage.cpp 45.83% 17 Missing and 9 partials ⚠️
src/ui/shell_view.cpp 0.00% 13 Missing and 3 partials ⚠️
src/app/client_state.cpp 58.06% 9 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
- Coverage   63.05%   62.70%   -0.35%     
==========================================
  Files          32       32              
  Lines        5235     5331      +96     
  Branches     2385     2418      +33     
==========================================
+ Hits         3301     3343      +42     
- Misses        931      970      +39     
- Partials     1003     1018      +15     
Flag Coverage Δ
Linux 63.02% <44.21%> (-0.36%) ⬇️
macOS 49.74% <36.58%> (-0.22%) ⬇️

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/streaming/stats_overlay.cpp 100.00% <100.00%> (ø)
src/app/client_state.cpp 66.80% <58.06%> (-0.19%) ⬇️
src/ui/shell_view.cpp 58.28% <0.00%> (-1.85%) ⬇️
src/app/settings_storage.cpp 70.43% <45.83%> (-4.77%) ⬇️

Continue to review full report in Codecov by Sentry.

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

Introduce a VideoDecoderSelection setting and UI to cycle/choose preferred decoder (Auto, H.264, MPEG-2, H.263+). Persist and parse the new streaming.video_decoder setting, include it in settings initialization/persistence, and expose the choice in the settings UI and status messages. Advertise supported Moonlight video formats based on the preference and pass that to the session startup; update the FFmpeg backend to select and log the appropriate decoder (mpeg2/h263/h264), improve error messages, and expose the active decoder name to stats/overlays. Enable required FFmpeg parsers/decoders and update the ffmpeg profile signature; add/update unit tests and bump the moonlight-common-c submodule.
@ReenigneArcher ReenigneArcher force-pushed the feat/decoder-choices branch from 6765ae5 to 0927719 Compare May 25, 2026 14:42
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