Skip to content

Expose interlace flags on FFmpeg video output buffers - #243

Merged
anilbeesetti merged 2 commits into
mainfrom
chore/issue-241
Nov 27, 2026
Merged

anilbeesetti merged 2 commits into
mainfrom
chore/issue-241

Conversation

@anilbeesetti

@anilbeesetti anilbeesetti commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Custom YUV renderers need per-frame field order to deinterlace FFmpeg output on the GPU. NextLib now carries the decoded frame’s interlace and top-field-first flags through JNI to FfmpegVideoDecoderOutputBuffer. The flags describe the frame before rotation.

FFmpeg AVFrame flags → FfmpegVideoDecoderOutputBuffer → Media3 YUV renderer

Closes #241.

Evidence

  • FFmpeg previously passed a plain Media3 output buffer with no interlace metadata. The new MPEG-2 regression test verifies top-field-first, bottom-field-first, and progressive flags on the same reused YUV buffer.

  • 22 unit tests and 39 Android instrumentation tests passed. Standalone video, AV1, TrueHD AddressSanitizer, and rotation checks passed.

  • An R8-minified consumer received all 160 expected YUV frames through ExoPlayer and verified each frame’s flags across synthetic 576-line MPEG-2 and 1080i H.264 streams.

  • Release AAR native packaging passed for all four ABIs.

  • After rebasing onto main, the release build, unit tests, native packaging, and the interlace and Dolby Vision emulator regressions passed.

Merge risk

Reversible. The change affects FFmpeg video output buffers and their JNI initialization. Playback verification used emulators and synthetic transport streams.

Reviewed with sol-loop in one round with GPT-6.2 Sol on medium. Verdict approved.

Created with GPT-6.2 Sol in Codex through T3 Code.

@anilbeesetti
anilbeesetti merged commit 0863f89 into main Nov 27, 2026
1 check passed
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.

Expose interlaced flag and field order of decoded video frames

1 participant