Skip to content

feat(ffmpeg): add BGRA1010102/RGBA1010102 pixel format support - #762

Open
luanweslley77 wants to merge 2 commits into
LizardByte:masterfrom
luanweslley77:fix/ffmpeg-patch-fallback
Open

feat(ffmpeg): add BGRA1010102/RGBA1010102 pixel format support#762
luanweslley77 wants to merge 2 commits into
LizardByte:masterfrom
luanweslley77:fix/ffmpeg-patch-fallback

Conversation

@luanweslley77

@luanweslley77 luanweslley77 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds an FFmpeg patch that registers the BGRA1010102/RGBA1010102 pixel formats (DRM fourccs used by 10-bit HDR captures on Linux) in libavutil, libavcodec/pixdesc and libswscale. The patch lives in patches/FFmpeg/FFmpeg/libavutil/ and is applied through the shared FFMPEG_PATCH_FILES list, gated by a new BUILD_FFMPEG_LIBAVUTIL_PATCHES option (default ON).

This follows the existing convention of carrying FFmpeg patches in this repo (cbs/, vulkan/, x265_git/). The pixel format patch is needed by Sunshine PR #5568, which makes capture backends declare their pixel format explicitly instead of guessing from pixel_pitch.

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 to 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

See our AI usage policy.

  • 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

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I have a few requested changes below.

Comment thread cmake/apply_git_patch.cmake
Comment thread cmake/ffmpeg/ffmpeg.cmake Outdated
@luanweslley77
luanweslley77 marked this pull request as draft August 29, 2026 03:12
@luanweslley77
luanweslley77 force-pushed the fix/ffmpeg-patch-fallback branch from 763cbd0 to aabd22d Compare August 29, 2026 03:21
@luanweslley77
luanweslley77 marked this pull request as ready for review August 29, 2026 14:10
Register the DRM fourccs BGRA1010102/RGBA1010102 in libavutil,
libavcodec/pixdesc and libswscale. These are the 10-bit RGB formats
with alpha in the low bits used by 10-bit HDR captures on Linux
(e.g. KMS and PipeWire), which upstream FFmpeg does not provide.
Collect FFmpeg patch files in a single FFMPEG_PATCH_FILES list and
apply them in one loop. The new BUILD_FFMPEG_LIBAVUTIL_PATCHES option
(default ON) gates the patches/FFmpeg/FFmpeg/libavutil directory.
@luanweslley77
luanweslley77 force-pushed the fix/ffmpeg-patch-fallback branch from aabd22d to 2d41a16 Compare August 29, 2026 14:37
@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