feat(libwebrtc): implement I420BufferInterface::ChromaWidth and ChromaHeight #16893
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16893"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-07T20:52:39Z.
What
Two libwebrtc exports threw
..._nid_postfix not implemented:webrtc::I420BufferInterface::ChromaWidth() const(_ZNK6webrtc19I420BufferInterface11ChromaWidthEv, NIDmAGSZ23UvZA);ChromaHeight() const(_ZNK6webrtc19I420BufferInterface12ChromaHeightEv, NID2j1-2M0bVZU).This PR implements them from
video_frame_buffer.ccat M134 (8d78f5de), identical at M127 (e0b28a6a). They are(width() + 1) / 2and(height() + 1) / 2.width()andheight()are virtual calls on the guest buffer, at vtable slots 5 and 6 from the address point. The slots come from a GCC-fdump-lang-classof the M134 header, and are the slots my merged #15766 (VideoFramewidth/height) already calls. They are called through the guest's System V ABI (APS5_VABI).INT_MAXwould overflowdimension + 1, which is undefined behaviour upstream, so it throws. So does a null buffer, vtable or slot.I420BufferChroma.cppstarts withvideo_frame_buffer.cc's notice.The libwebrtc unknown-export count drops by 2 (260 to 258 on current
main, after the rebase onto6dc91ffb0c).Tested
guest_webrtc_i420_chroma_widthandguest_webrtc_i420_chroma_heightuse a synthetic guest vtable with different width and height callbacks. They cover:INT_MAXand null throws.main, both fail with..._nid_postfix not implemented;guest_webrtc_video_frame_dimensionsandpublic_headers.0ea12aed1d, includingguest_webrtc_trivial_returnsfrom #15609 and the merged SentPacket and EchoCanceller3Config tests.guest_webrtc_video_frame_dimensionsincluded, with no compiler warnings in the changed files.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py: no other PR implements these exports.GetI420stub right after them inExport.cppandApi.hpp, is now onmain; this PR is rebased onto it and keeps itsGetI420.I420Buffermutable data, which addssrc/I420Buffer.cpp) is now onmain; this PR is rebased onto it.main.main.main; none of the listed PRs changesChromaWidthorChromaHeight.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T22:13:34Z.
Review: COMMENTED
Read
5193e17be2againstmain.(width() + 1) / 2and(height() + 1) / 2matchvideo_frame_buffer.ccat both8d78f5deande0b28a6a. Slots 5 and 6 followRefCountInterface'sAddRef,Releaseand the two destructor entries, thentype,widthandheightinVideoFrameBufferat both revisions; with single inheritance the vptr stays at offset 0, the same dispatch asVideoFrameDimensions.cpp. The test's expected values for negative inputs,INT_MINandINT_MAX - 1follow C++ truncating division, and the tests can't build onmain, where the stubs take no arguments.Count line. The diff's 296 to 294 matches
main, but the PR body still says 300 to 298, and #16850 changes the same line to 294, so whichever merges second should say 292.Not run here; this is from reading the code.
AI-assisted: yes.