Repository navigation
fix(decode): the software host opens the VT decoder only on a proven hardware session (#461) - #542
Merged
Conversation
…hardware session (#461) SoftwarePlaybackHost picked HardwareVideoDecoder whenever VTCapabilityProbe.canHardwareDecode answered true. That probe fails open for the routing gate on purpose (in-band parameter sets, Annex-B extradata, no extradata, format description failure keep the native path), but HardwareVideoDecoder builds from the hvcC alone and has no software fallback, so every one of those classes threw sessionCreationFailed(-4) after the teardown. A decode-path correction onto software on such a source ended the session. The probe now returns HardwareDecodeVerdict (supported / unsupported / unclassifiable(reason)). The routing gate keeps native unless the verdict is unsupported; the software host opens the hardware decoder only when it is supported. The unclassifiable returns now log their reason. Measured with aetherctl on the Dolby P8.1 UHD asset rewritten with in-band xPS and remuxed to MPEG-TS: play --sw and a native load corrected via --reload-applying decode-path=software both ended in "Decoder session failed (-4)" before, and play through on libavcodec after. An out-of-band hvc1 control still opens HardwareVideoDecoder. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_018837p54rigmt9MMyzSmYXY
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.
Refs #461 (cmcpherson274's DV P8.1 escape,
sessionCreationFailed(status: -4)).Defect
SoftwarePlaybackHostchoseHardwareVideoDecoderfor HEVC wheneverVTCapabilityProbe.canHardwareDecodereturned true. That probe fails open for the routing gate by design: no extradata, Annex-B extradata, in-band parameter sets and a format-description failure all answer "keep native".HardwareVideoDecoderbuilds its format description from the hvcC alone and requires hardware with no software fallback, so each of those classes is one it can never open. On apreferredDecodePath = .softwarecorrection the throw lands after the teardown and the session ends.Fix
VTCapabilityProbe.hardwareDecodeVerdict(codecpar:)returns.supported/.unsupported/.unclassifiable(reason:).canHardwareDecode, unchanged behaviour): keeps native unless.unsupported.HardwareVideoDecoderonly on.supported, libavcodec otherwise.[VTProbe]line).Measured (aetherctl, M1)
Fixtures from the Dolby P8.1 UHD asset: rewritten with
MP4Box :xps_inband(hvcC numOfArrays 0), and remuxed to MPEG-TS (Annex-B extradata). Control: x265hvc1with parameter-set arrays.play --swin-bandLOAD FAILED: sessionCreationFailed(status: -4)VERDICT: OKplay --swTSLOAD FAILED: sessionCreationFailed(status: -4)VERDICT: OK--reload-applying decode-path=softwareat 5 s, in-bandsession ended in error: Decoder session failed (-4)play --swcontrolHardwareVideoDecoderopenedswift test: XCTest 610 (1 skipped) and swift-testing 2990 green.🤖 Generated with Claude Code
https://claude.ai/code/session_018837p54rigmt9MMyzSmYXY