Repository navigation
feat(android): decoded frames take the stream's color space where the config has none - #12
Merged
Merged
Conversation
andreialecu
changed the base branch from
chore/drop-upstream-patches
to
main
November 26, 2026 09:23
… config has none A VideoDecoder configured without a colorSpace (used without Mediabunny) gave its frames BT.709 limited range, whatever the stream said. The Android decoder now reads the color aspects of its output format (the stream's VUI) and sends them with each frame; the config's members win over them, as in WebCodecs, and BT.709 fills what neither says. iOS still takes the config's. The new e2e test decodes a BT.601 full-range H.264 clip without a colorSpace, then with only a matrix in the config.
andreialecu
force-pushed
the
feat/android-stream-color-space
branch
from
November 26, 2026 09:24
b6de3b2 to
68f8e5b
Compare
|
🎉 This PR is included in version 0.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Stacked on #11 (it needs react-native-webgpu 0.26.0 to build and test). Retarget to
mainonce #11 is merged.What
A
VideoDecoderconfigured without acolorSpace(used without Mediabunny, which passes the track's) gave its frames BT.709 limited range, whatever the stream said.frame.nativeBufferColorSpacethen passed that to WebGPU, so a BT.601 or full-range stream was read with the wrong matrix or range on Android.color-standard,color-transfer,color-range: the stream's VUI) when the format changes, and sends them with each frame (NativeDecodedFrame.colorSpace, new and optional in the Nitro spec).colorSpaceis the config's members, and for those the config leaves out, the stream's, as WebCodecs has it. BT.709 still fills what neither says. A config with a fullcolorSpace(Mediabunny's case) behaves as before.colorSpace: nilfrom the decoder).Tests
Written test first: the new e2e test, "gives decoded frames the stream's color space when the config has none (Android)", decodes a BT.601 (smpte170m), full-range H.264 clip.
colorSpacein the config, it expectssmpte170m/ full range.matrix: "bt709"in the config, it expects the config's matrix and the stream's other members.The test failed before the change (every member came out BT.709, limited range) and passes after.
tsc, lint and unit tests (70/70) are clean.