feat(libwebrtc): implement rtcp TransportFeedback parsing #18796
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18796"
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-12T09:56:12Z.
What
Three libwebrtc
rtcp::TransportFeedbackexports threwnot implemented:_ZN6webrtc4rtcp17TransportFeedbackC1Ev, NIDmAh1UCt6uy4);_ZN6webrtc4rtcp17TransportFeedbackD1Ev, NID8z0Q9vMEEMI);Parse(const CommonHeader&)(_ZN6webrtc4rtcp17TransportFeedback5ParseERKNS0_12CommonHeaderE, NIDvAdWUDi762c).This PR implements them from M134 (8d78f5de)
transport_feedback.cc,transport_feedback.handrtpfb.h. At M127 (e0b28a6a) both headers are identical, andParse,Clear, the lifecycle and chunk decoding are the same. The existingRtcpTransportFeedback.cppalready carries the WebRTC notice, andRtcpTransportFeedback.hppgains it because its layout now followstransport_feedback.h.Layout: compiling the real M134 headers with GCC's class-layout dump gives a 152-byte object:
Rtpfbsender and media SSRCs at 8 and 12;include_timestamps_at 16–25, as the mergedGetBaseSequence(#15192) already used;last_timestamp_(int64 microseconds) at 32;received_packets_,all_packets_andencoded_chunks_vectors (begin/end/capacity) at 40, 64 and 88, with 4-byteReceivedPacketentries (sequence number, delta ticks);LastChunkat 112 andsize_bytes_at 144.Vectors: their storage is allocated and freed through guest
operator new/operator delete(_Znwm_nid_postfix/_ZdlPv_nid_postfix), asCopyOnWriteBufferdoes, so a guest can take ownership.Vtable: the constructor installs a vtable with the destructor pair in slots 0 and 1.
BlockLengthandCreatethrownot implemented, and there's no RTTI.Parse: follows upstream's release behaviour:
LastChunk::Decodedoes, with the final chunk kept inlast_chunk_;delta * 250 µsto the timestamp, whichClearresets to the 2^24 × 64 ms wrap period plus the base time;include_timestamps_is cleared (and stays cleared, as upstream) and received packets get zero deltas;RTC_DCHECKs are not checks in release builds, so they don't throw. A null object, header or payload throws.Debt: the three stubs are removed, the libwebrtc unknown-export count drops from 249 to 246, and a debt entry records the layout and that the console's revision, layout and vtable are unverified.
Tested
guest_webrtc_rtcp_transport_feedback(core/libs/prx/libwebrtc/tests/RtcpTransportFeedback.cpp) keeps itsGetBaseSequenceassertions and adds:include_timestamps_;main, the test fails with_ZN6webrtc4rtcp17TransportFeedbackC1Ev_nid_postfix not implemented;patched_librariesandpublic_headers.guest_webrtc_rtcp_transport_feedbackandpatched_librariespass at 9f217dadfd, with no compiler warnings in the changed files and no loader errors for the guestnew/deleteimports. The branch was then rebased onto currentmainwithout conflicts, and both tests pass again on Linux.Parseassertion.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py: no open PR implements these exports. It couldn't compare 12 PRs automatically, so I compared them by hand:Pliconstructor) declares nearby RTCP exports inApi.hppandExport.cppbut changes noTransportFeedbacklines;VideoSinkWantsbranches will too. Whichever merges second recounts.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 PrivacyOnion on 2026-11-12T11:33:17Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
5d565aa0a7:tools/check_conventions.pypassed;git diff --checkclean.guest_webrtc_rtcp_transport_feedback_testsbuilt cleanly.guest_webrtc_rtcp_transport_feedback):core/libs/prx/libwebrtc/Export.cpp,core/libs/prx/libwebrtc/include/Api.hpp,core/libs/prx/libwebrtc/include/RtcpTransportFeedback.hpp,core/libs/prx/libwebrtc/src/RtcpTransportFeedback.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Generated withfooter from the description; the AI-assisted checkbox can stay.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T14:29:00Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed hunks show no concrete defect; the build and the tests were not run here, so the author's results stay unconfirmed.
What I ran
5d565aa0a7bae8f86c3f9631ea5afcae5827d8d5, basemain. No merged-preview check.Results
guest_webrtc_rtcp_transport_feedback)static_assertsParseFindings
Blocking
None.
Non-blocking
core/libs/prx/libwebrtc/src/RtcpTransportFeedback.cpp:128: the destructor freesreceivedPackets,allPacketsandencodedChunksbut leaves their pointers set. A second destructor call on the same object frees them again. Smallest fix: reset each vector after it is freed, for examplefeedback->receivedPackets = {};.core/libs/prx/libwebrtc/src/RtcpTransportFeedback.cpp:152:Parsebuilds a hoststd::vector<std::uint8_t>sized tostatusCounton every call, only to total the delta sizes. The guest vectors already hold this data, so the allocation could be dropped. This is a small cost per RTCP packet.Sources
Not verified
patched_libraries,public_headersandcheck_conventions: not run.Parserelease behaviour and the 250 µs delta scale: compared with the description only, not with upstream source.NotImplemented_nid_no_patchin the test build: the test catchesstd::exception, but I did not read the definition that the test links against.diff.patch, plus the reader searches above. The full text infiles/was not opened line by line outside those hunks, so nothing outside the hunks is covered by this review.To get this to a good state
guest_webrtc_rtcp_transport_feedback,patched_librariesandpublic_headerson the new head, and check the debt count (249 to 246) against the export table.deltaSizesvector.