feat(libwebrtc): implement rtcp::RtcpPacket::Build() #18507
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18507"
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:15:51Z.
What
Implements
webrtc::rtcp::RtcpPacket::Build() const, which threw throughNotImplemented_nid_no_patch.As in rtcp_packet.cc, it makes an
rtc::BufferofBlockLength()bytes and asks the packet toCreateitself at index 0 with that capacity and a nullPacketReadyCallback. Both are virtual, so they are called through the packet's vtable, inRtcpPacketorder (D1, D0,BlockLength,Create). The buffer follows buffer.h: size and capacity equal to the block length, and data from the guestnew[], or null for an empty block. It is returned through the caller's return slot, becausertc::Bufferis not trivially copyable. In a release build upstream ignoresCreate's result and the written length (RTC_DCHECKonly), and so does this. IfCreatethrows, the buffer is freed before the exception continues.Stacked on #17703, whose
WebRtcBufferalready modelsrtc::Buffer; only the last commits belong to this pull request.rtcp_packet.ccandbuffer.hare the same at M127 (e0b28a6a81a9) and M134 (8d78f5de6c27) apart from an out-of-classconstexprdefinition. The newsrc/RtcpPacket.cppstarts with itsDerived fromline and the WebRTC notice and licence.Tested
Linux (WSL2, Ubuntu): full build and suite on
0704998db4(stacked on #17703's head), 4678/4678 tests pass; check_conventions passes. The new guest_webrtc_rtcp_packet builds a fake packet through its vtable: a 12-byte block gives a buffer of size and capacity 12 that Create filled, with Create called at index 0, maximum 12 and a null callback; an empty block gives size 0, capacity 0 and null data; an exception from Create propagates.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)Pull request closed