Repository navigation
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The attachment-propagation regression needs correction, and the platform-dependent transfer path still warrants human validation on iOS/tvOS.
1 open issue
What changed in this PR
This PR protects VideoToolbox-owned reference buffers while preserving the engine’s color and pixel-aspect metadata normalization.
Changes:
- Forward callback modifiability flags and normalize metadata in place only when permitted.
- Copy immutable buffers through a format-keyed pool, preserving propagated attachments and retaining the original on copy failure.
- Add ownership and pixel-preservation regression tests and document the contract.
| File | Description |
|---|---|
| Tests/AetherEngineTests/Issue354HardwareDecoderPixelAspectTests.swift | Adds ownership, attachment, pixel-copy, and pool-reset tests. |
| Sources/AetherEngine/Decoder/VideoToolboxOutputMetadataNormalizer.swift | Implements metadata matching, owned copies, and transfer fallback. |
| Sources/AetherEngine/Decoder/HardwareVideoDecoder.swift | Passes modifiability flags and integrates normalizer lifecycle. |
| docs/architecture.md | Documents buffer ownership and normalization behavior. |
| CHANGELOG.md | Records the immutable-buffer fix. |
Review effort: Balanced
Comment on lines
+117
to
+119
| func attachment(_ key: CFString) -> CFTypeRef? { | ||
| CVBufferCopyAttachment(imageBuffer, key, nil) | ||
| } |
jonluca
force-pushed
the
fix/immutable-videotoolbox-output
branch
from
October 25, 2026 18:27
a069980 to
9f764cd
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.

Summary
Respect VideoToolbox's ownership of decoded image buffers. The output callback previously changed color and pixel-aspect attachments even when
imageBufferModifiablewas absent, although the decoder can still retain that buffer as a reference picture.What changed
Test plan
AetherEnginebuilds with-warnings-as-errors.python3 Scripts/check-doc-links.pyandgit diff --checkpass.Checklist
CHANGELOG.mdupdated