Skip to content

fix(capability): accept decoder-padded coded size in H.264 profile probe - #3

Open
ZiadAbdelati wants to merge 15 commits into
AIOStreams:mainfrom
ZiadAbdelati:fix/h264-probe-padded-coded-size
Open

ZiadAbdelati wants to merge 15 commits into
AIOStreams:mainfrom
ZiadAbdelati:fix/h264-probe-padded-coded-size

Conversation

@ZiadAbdelati

Copy link
Copy Markdown

frameMatchesRequest in src/capability/H264ProfileCapabilities.ts checks frame.codedHeight === probeRequest.expectedCodedHeight and frame.codedWidth === probeRequest.expectedCodedWidth for exact equality.

On Linux Chrome 158.0.8127.88 (Wayland, NVIDIA RTX 5070), VideoDecoder decodes all four 64x64 H.264 profile probe keyframes without error (format: "I420", displayWidth: 64, displayHeight: 64, visibleRect: { x: 0, y: 0, width: 64, height: 64 }, timestamp: 0), while reporting codedWidth: 64 and codedHeight: 66 due to decoder buffer padding. Because of the exact equality check, every H.264 profile fails with output-mismatch, and SDR H.264 playback falls back to the next engine with codec-unsupported.

This change accepts codedWidth >= expectedCodedWidth and codedHeight >= expectedCodedHeight when displayWidth, displayHeight, timestamp, and visibleRect (if present, starting at 0, 0) match the expected dimensions, similar to nativeVideoFrameMatchesRequest in src/capability/CustomDecodeCapabilities.ts.

Verification

  • npx vitest run test/capability/H264ProfileCapabilities.test.ts (18/18 passed, including new tests for padded coded dimensions and mismatched visibleRect)
  • npx eslint src/capability/H264ProfileCapabilities.ts test/capability/H264ProfileCapabilities.test.ts (0 errors)
  • Tested the patched EmbeddedPlayer.js bundle in Chrome 158.0.8127.88 on Linux (RTX 5070, Wayland) against 1080p H.264 MKV fixtures with dual AAC/E-AC-3 and single AC-3 5.1 audio: open() returned eligible: true (native video-frame, audio decoded-pcm), audio track switching worked, and HEVC playback remained unchanged.

Viren070 and others added 15 commits November 9, 2026 23:01
- Build it with scripts/build-embed.mjs
- Add WebGPUPresenter.getLastPresentedMediaTime
…ing module

- Start a route once the last route's controller has closed
…ds it

WebGPUPresenter.setPresentedPictureObserver takes an observer that each
submission hands the picture it drew, right after the submit and its
validation scope: the canvas, and the region of its backing store the
picture covers, the plan's viewport. A WebGPU canvas has no picture to
read after the task that drew it, so a copy made in the call, as
drawImage makes, is the only one that reads it: in Chrome 156 a copy in
a later task, or in an earlier animation frame callback of the same
frame, reads black. One observer observes at a time, the setter returns
a function that stops it, and an observer's error is logged and never
fails presentation.

The plugin's picture-in-picture window copies custom playback's pictures
through it. The architecture chapter and the module map say so.
…cropped coded size

- Regenerate the Main and Main 10 access units from the file's recipe
- Let an external HDR frame report its display size as its coded size
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.

3 participants