feat(libwebrtc): implement rtcp::Pli::Pli() #18503
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18503"
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 alvaroelpob on 2026-11-11T19:06:43Z.
What
Implements
webrtc::rtcp::Pli::Pli(), which threw throughNotImplemented_nid_no_patch.pli.cc defaults the constructor, so
sender_ssrc_(rtcp_packet.h) andmedia_ssrc_(psfb.h) start at 0 and the object getsPli's vtable.BlockLengthandCreateare not exported but a guest reaches them through that vtable (for example throughRtcpPacket::Build), so the object gets a local vtable inRtcpPacketorder: D1 (the existing export), D0,BlockLengthandCreate, asrtc::RateTrackerdoes.BlockLengthreturns 12: the 4-byte header plus the 8-byte common feedback.CreatefollowsPli::Create,RtcpPacket::OnBufferFull,RtcpPacket::CreateHeaderandPsfb::CreateCommonFeedback: while the packet does not fit it flushes through thePacketReadyCallbackor fails when nothing is buffered, then writes the header (version 2, format 1, type 206, length in words fromBlockLength) and both SSRCs big-endian.BlockLengthis called through the object's vtable as upstream does, so a derived class's override is used.rtc::FunctionViewcallback is passed as its two pointers (the callable andcall_), andcall_receives theArrayViewas data and size. A flush without a callback throws, where upstream onlyRTC_DCHECKs it.These files are the same at M127 (e0b28a6a81a9) and M134 (8d78f5de6c27) apart from out-of-class
constexprdefinitions and a comment infunction_view.h.src/RtcpPli.cppnow carries oneDerived fromline per source file and the 2014 notice ofrtcp_packet.ccnext to the 2015 one.Tested
Linux (WSL2, Ubuntu): full build and suite on
c027347e69, 4925/4925 tests pass; check_conventions passes. guest_webrtc_rtcp_pli now constructs a Pli over 0xA5 bytes and calls the vtable slots: BlockLength returns 12; Create writes 81 CE 00 02 and both SSRCs big-endian, fails without touching the index when nothing is buffered and 11 bytes are left, flushes 4 buffered bytes through the FunctionView callback before writing, and uses a fake subclass's BlockLength of 16 (length field 3); the deleting destructor frees a guest-allocated Pli.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T14:28:24Z.
Review: COMMENTED
Reviewed — no blocking findings
The diff implements
rtcp::Pli::Pli(),BlockLengthandCreatewith vtable slots that match the test, and I found no blocking defect in the code I read.What I ran
c027347e69571b40366c410d8978bc82b742413f(basemain). No merged-preview check.diff.patch, plus repository reads at head through the reader.PliC1Ev,_Znwm_nid_postfix,_ZdlPv_nid_postfix,ApplicationHeapInitialize_nid_no_patchandFilled;RtcpPli.cpplines 60–135;RtcpPli.hpplines 1–22; test file lines 1–12.Results
check_conventionsApi.hpp:274matchesRtcpPli.cpp:130Findings
Blocking
None.
Non-blocking
core/libs/prx/libwebrtc/src/RtcpPli.cpp:106—Createwrites 12 bytes (:106–:109) but only checks thatVirtualBlockLength(pli)fits. If a vtable'sBlockLengthreturns less than 12, for example 4, the writes can run up to 8 bytes pastmaxLength. A guard that throws or returnsfalsewhen the block length is under 12 would close this. No test covers aBlockLengthbelow 12. UpstreamPlinever returns less, so this needs a hostile override to trigger.Not verified
check_conventions: not run here; author-reported only.rtcp_packet.ccinRtcpPli.cpp:1–13: not compared with upstream.rtc::FunctionViewABI (two pointers,ArrayViewas data and size): not checked on a console or against the toolchain.Export.cpp,Api.hppanddocs/dev/debt/libwebrtc.mdthrough their hunks only.256→255indocs/dev/debt/libwebrtc.md:278: consistent with the removed stub, not checked against the export table.To get this to a good state
Createand a test withBlockLengthreturning 4.check_conventionson the new head if the code changes.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T08:45:53Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation and focused tests are consistent with the stated PLI constructor and packet creation behavior at head
792ef6f902e395625a73059dade03f67ed6c05b9; programmatic checks were not run in this review.What I ran
Read the prepared diff and targeted source context. No commands or tests were run. The description reports a full build and suite on a different revision (
c027347e69); that result was not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run on this head, and console behavior remains unverified as documented in the PR. Read the changed files
Export.cpp,Api.hpp,RtcpPli.hpp,src/RtcpPli.cpp,tests/RtcpPli.cpp, anddocs/dev/debt/libwebrtc.md; targeted portions ofExport.cppandApi.hppwere inspected. No files were excluded by the prepared manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:02:16Z.
Review: COMMENTED
Built the changed sources and ran
RtcpPlion Linux against the existing runtime. It passed the vtable, serialized packet, and short-buffer checks.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.