feat(video,platform): declare explicit capture pixel formats - #5568
Open
luanweslley77 wants to merge 3 commits into
Open
feat(video,platform): declare explicit capture pixel formats#5568luanweslley77 wants to merge 3 commits into
luanweslley77 wants to merge 3 commits into
Conversation
21 tasks
luanweslley77
force-pushed
the
feat/explicit-capture-pixel-format
branch
4 times, most recently
from
August 28, 2026 22:59
2d0b10c to
9e6fe0f
Compare
Add pix_fmt_e pixel_format to platf::img_t and make all capture backends declare the negotiated format. The software encoder now prefers the declared format and falls back to the pixel_pitch heuristic only for unknown. VAAPI/CUDA RAM paths fail loudly for formats they cannot represent. Includes the 2 zero-cost 10-bit identity mappings (abgr/argb2101010 -> X2BGR10LE/X2RGB10LE) and the 2 shift-formats (bgra/rgba1010102) mapped unconditionally via native libswscale support, which the bundled build-deps FFmpeg provides. Sync cuda.cu duplicate img_t and fix kmsgrab cursor to bgra, handle P010 plane and fail loudly for unsupported declared formats. Advertise NV12 on MemPtr for 8/8 capture.
Exercise declared BGR0/NV12/BGRA/xbgr2101010, the 2 identity 10-bit formats and the 2 shift-formats with padded strides, plus FromPixFmt and IsBgrCaptureFormat full matrices. A declared format with no capture mapping must fail loudly.
Bump third-party/build-deps a9a9277 -> aabd22d (fix/ffmpeg-patch-fallback rebased onto upstream/master 4d864e1). Includes in build-deps: - feat(ffmpeg): add BGRA1010102/RGBA1010102 pixel formats for 10-bit HDR PipeWire captures (SPA ARGB_210LE/ABGR_210LE) on MemPtr - build(ffmpeg): wire libavutil patches into the shared patch list (new BUILD_FFMPEG_LIBAVUTIL_PATCHES option)
luanweslley77
force-pushed
the
feat/explicit-capture-pixel-format
branch
from
August 29, 2026 03:36
9e6fe0f to
4f25ed1
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Capture backends now declare the negotiated pixel format on
platf::img_t(pix_fmt_e pixel_format), and the RAM-path consumers (software encoder via libswscale, VAAPI/CUDA RAM) respect it instead of guessing frompixel_pitch. This continues the direction of #5495, which made the pitch information explicit.With this, 10-bit HDR captures (PipeWire
ARGB_2101010/ABGR_2101010, KMSBGRA1010102/RGBA1010102) reach the software encoder and the VAAPI/CUDA RAM converters correctly instead of being misread as 8-bit BGR0 with wrong colors. It also unblocks software HEVC Main10, which the encoder already advertises (AV_PIX_FMT_YUV420P10) but could never receive. Declared formats that a converter cannot represent now fail loudly instead of producing corrupt frames. The 10-bit shift formats are mapped unconditionally and therefore require the FFmpeg patch from build-deps #762, which the last commit pins inthird-party/build-deps.The last commit bumps
third-party/build-depsto include the FFmpeg patch that registersBGRA1010102/RGBA1010102(LizardByte/build-deps PR: LizardByte/build-deps#762). Without it, the branch still works but falls back to the previous behavior for those two formats.Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.