feat(libwebrtc): return from five calls as firmware 13.42 does #15609
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15609"
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 BunnyFl on 2026-11-03T21:41:15Z.
What
Five libwebrtc exports threw. In firmware 13.42 each one returns at once, and this change does the same:
webrtc::PacketOptions::~PacketOptions()(D1)3yjhuJS+93svoid (void* self)webrtc::rtcp::Pli::~Pli()(D1)OWYOJU0yBRYvoid (void* self)webrtc::AudioEncoder::OnReceivedUplinkRecoverablePacketLossFraction(float)JBEfUOB-Xa8void (void* self, float)webrtc::VideoFrameBuffer::GetI420() constILLU2NiyjU8const void* (const void* self)nullptrlibwebrtcUnknown37Vf6lJz4-bEUint (void), unverifiedThe parameters come from the mangled names. The return types come from WebRTC
8d78f5de6c, the revisiondocs/dev/debt/libwebrtc.mdalready cites:api/video/video_frame_buffer.h:91declaresvirtual const I420BufferInterface* GetI420() const, andvideo_frame_buffer.cc:39returnsnullptr.api/audio_codecs/audio_encoder.cc:94isvoid AudioEncoder::OnReceivedUplinkRecoverablePacketLossFraction(float). Its body is onlyRTC_DCHECK_NOTREACHED(), which a release build leaves out; the firmware body at0x3da0e0(below) is a loneret.The declarations in
core/libs/prx/libwebrtc/include/Api.hppchange with them.In
docs/dev/debt/libwebrtc.md, the inventory entry goes from the 268 throwing exports (60 without a name) ofmain07ae6afceeto 263 (59 without a name), counted from the mergedExport.cpp. A new entry says thatVf6lJz4-bEUhas no known name or signature, and that the values are read from disassembly, not measured on a console.Nine more libwebrtc exports with the same kind of body are left out of this PR. Open PRs already implement them: #14224 (
RmsLevel), #15193 (AudioNetworkAdaptorImpl::Config), and #15265 to #15269 and #15272 (GetMdnsResponder,SetFecControllerOverride, and thePacketInfo,RateControlParameters,AudioEncoderRuntimeConfigandSmoothingFilterImpldestructors).Source
Firmware 13.42
system/common/lib/libwebrtc.sprx(sha256d59d0caf6967329b39201a2a0bd6df7b994516f21701b9801908db6735ae5314), read from disassembly, not run on a console. Export addresses come from the module's dynamic symbol table. Each body, to its return:None of the five bodies above reads an argument or stores anything. A null or invalid
thisis never dereferenced, here or in firmware.Tested
main8f7c957ed0as the single commita330a6b727. The merge bullets after this one describe heads from before that rebase, which are no longer on the branch.main07ae6afceeinto the branch; the head is nowf585e8d6e5. The only conflict was the inventory count:mainstates 268 (60), which matches itsExport.cpp(268NotImplemented_nid_no_patchcalls, 60 of them NID-only), and this branch's 274 (59) matched its ownExport.cppthe same way. The merged number is counted from the mergedExport.cpp: 263 exports still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only. The branch's diff againstmainis the same five files as before.f585e8d6e5, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 47 of 47guest_webrtc_*tests pass, none Not Run, with all 47 test executables rebuilt and thelibwebrtclibrary target built. Three of them were added onmainafter the previous head:guest_webrtc_rate_tracker,guest_webrtc_copy_on_write_bufferandguest_webrtc_color_space.tools/check_conventions.py --base upstream/mainon the committed headf585e8d6e5: all checks pass.review-tools/sig_users.py HEAD --buildlists the four changed declarations; no file outside this branch's own changes names them, and both targets that do (guest_webrtc_trivial_returns_tests,libwebrtc) build.tools/pr_overlap.py --branch feat/libwebrtc-free-trivial-returns --jobs 8atf585e8d6e5, against 1,991 open pull requests: 23 share files with the branch, 6 of those it could compare have conflicting lines, and it lists no shared export or new file for any of them. 5 conflict only on the inventory count line (line 5 ofdocs/dev/debt/libwebrtc.mdonmain): #16850, #16870, #16894, #17313, #17725. #16893 conflicts on that line and also incore/libs/prx/libwebrtc/Export.cpp(lines 389-401 onmain) andcore/libs/prx/libwebrtc/include/Api.hpp(lines 148-150), next to declarations this branch changes. The run failed closed (exit 2) on 7 pull requests that conflict withmainthemselves and compared none of them: #14212, #17269, #17273, #17353, #17497, #17705 and #17722. All 7 were then checked by hand at this head: every added and removed line of each diff searched for the five exports:OnReceivedUplinkRecoverablePacketLossFraction, thePacketOptionsandrtcp::PliD1destructors andVideoFrameBuffer::GetI420by their mangled names, andVf6lJz4-bEUby its NID and bylibwebrtcUnknown37. None of them appears in any of the 7, and every diff was fetched.mainf35f1e5ecainto the branch; the head is nowb6accb023f. The only conflict was the inventory count:mainstates 279 (60), which matches itsExport.cpp(279NotImplemented_nid_no_patchcalls, 60 of them NID-only). The merged number is counted from the mergedExport.cpp: 274 exports still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only. The branch's diff againstmainis the same five files as before.b6accb023f, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 44 of 44guest_webrtc_*tests pass, none Not Run, with all 44 test executables rebuilt.tools/check_conventions.py --base upstream/mainon the committed headb6accb023f: all checks pass.review-tools/sig_users.py HEAD --buildlists the four changed declarations; no file outside this branch's own changes names them, and both targets that do (guest_webrtc_trivial_returns_tests,libwebrtc) build.tools/pr_overlap.py --branch feat/libwebrtc-free-trivial-returns --jobs 8atb6accb023f, against 1,824 open pull requests: 7 have conflicting lines and none shares an export or a new file. 5 conflict only on the inventory count line (docs/dev/debt/libwebrtc.md:5onmain): #16381, #16485, #16850, #16870, #16894. #16893 also conflicts incore/libs/prx/libwebrtc/Export.cpp(lines 419-431 onmain) andcore/libs/prx/libwebrtc/include/Api.hpp(lines 145-147), and #17269 inApi.hpp(lines 297-299), next to declarations this branch changes; both implement other exports. The run failed closed (exit 2) on #14212 (the debt file) and #15189 (CMakeLists.txt,Export.cpp,Api.hppand the debt file), which conflict withmainand were not compared line by line.main3aa0ac20dfinto the branch; the head is nowbea7df18b1. The only conflict was the inventory count:mainstates 296 (60), which matches itsExport.cpp(296NotImplemented_nid_no_patchcalls, 60 of them NID-only). The merged number is counted from the mergedExport.cpp: 291 exports still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only. The branch's diff againstmainis the same five files as before.bea7df18b1, Windows 11 Pro 10.0.26300, WinLibs GCC, Release:guest_webrtc_trivial_returnsandguest_webrtc_rtcp_plipass, 2 of 2, with both test executables and thelibwebrtclibrary target rebuilt. The rest of theguest_webrtc_*suite was not re-run at this head.tools/check_conventions.py --base upstream/mainon the committed headbea7df18b1: all checks pass.review-tools/sig_users.py HEAD --buildbuilds both targets that name the three changed declarations.tools/pr_overlap.py --branch feat/libwebrtc-free-trivial-returns --jobs 8atbea7df18b1, against 1,762 open pull requests: 15 have conflicting lines and none shares an export or a new file. 14 conflict only on the inventory count line (docs/dev/debt/libwebrtc.md:5onmain). #16893 also conflicts incore/libs/prx/libwebrtc/Export.cpp(lines 454-466 onmain) andcore/libs/prx/libwebrtc/include/Api.hpp(lines 139-141), next to declarations this branch changes. The run failed closed (exit 2) on #14212 (the debt file) and #15189 (CMakeLists.txt,Export.cpp,Api.hppand the debt file), which conflict withmainand were not compared line by line.main23bc7c7625into the branch; the head is nowa17645b557. The only conflict was the inventory count again: #15266 and #15267 had merged and lowered it to 318 (60), which matchesmain'sExport.cpp. The merged number is counted from the mergedExport.cpp: 313 exports still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only.a17645b557, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 93 of 93 pass, none Not Run, with the 28guest_webrtc_*test executables rebuilt, pluspublic_headersand thepublic_headers_compile_*batches. Thelibwebrtclibrary target builds too.mainare the same as at521f579343apart from the count line, so the negative control below was not repeated.tools/check_conventions.py --base upstream/mainon the committed heada17645b557: all checks pass.maincdefa2cf7cinto the branch; the head is now521f579343. The only conflict was the inventory count again: #15195 and #15196 had merged and lowered it to 320 (60), which matchesmain'sExport.cpp. The merged number is counted from the mergedExport.cpp: 315 exports still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only.521f579343, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 91 of 91 pass, none Not Run, with the 26guest_webrtc_*test executables rebuilt, pluspublic_headersand thepublic_headers_compile_*batches.mainare the same as ate0c8c01d20apart from the count line, so the negative control below was not repeated.tools/check_conventions.py --base upstream/mainon the committed head521f579343: all checks pass.maincdf371df68into the branch; the head is now3b4066d194. The only conflict was the inventory count indocs/dev/debt/libwebrtc.mdagain. The merged number is counted from the mergedExport.cpp: 320 exports still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only. The same count gives 325 and 60 onmaincdf371df68, which states 326 atdocs/dev/debt/libwebrtc.md:5: #15154 implementedrtc::CurrentThreadId(core/libs/prx/libwebrtc/Export.cpp:404) without lowering it.3b4066d194, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 89 of 89 pass, none Not Run, with the 24guest_webrtc_*test executables rebuilt (now includingaudio_network_adaptor_config,current_thread_id,race_checkerandrtcp_transport_feedback, added onmain), pluspublic_headersand thepublic_headers_compile_*batches.mainare the same as ate0c8c01d20apart from the count line, so the negative control below was not repeated.tools/check_conventions.py --base upstream/mainon the committed head3b4066d194: all checks pass.main56374036adinto the branch; the head is now4886fe077f. The only conflict was the inventory count indocs/dev/debt/libwebrtc.md, which #15261 had lowered to 334 when it implemented fivertc::SocketAddressaccessors. The merged number is counted from the mergedExport.cpp: 325 exports still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only. The same count gives 330 and 60 onmain56374036ad.4886fe077f, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 85 of 85 pass, none Not Run, with the 20guest_webrtc_*test executables rebuilt (now includingsocket_address, added onmainby #15261), pluspublic_headersand the 64public_headers_compile_*batches.mainare the same as ate0c8c01d20apart from the count line, so the negative control below was not repeated.tools/check_conventions.py --base upstream/mainon the committed head4886fe077f: all checks pass.e0c8c01d20(mainc9f43dfa1dmerged in): 84 of 84 pass, none Not Run, with the 19 test executables built at this head. The suite is the 19guest_webrtc_*tests registered at this head -file_wrapper(added onmainby #14246) andaudio_codec_info,audio_decoder,audio_device_generic,audio_encoder,audio_frame,cpu_features,exp_filter,fast_int_to_buffer,ip_address,opus,recursive_critical_section,rms_level,rtcp_common_header,rtcp_pli,task_queue_base,time,trivial_returnsandvad- pluspublic_headersand the 64public_headers_compile_*batches.core/libs/prx/libwebrtc/tests/TrivialReturns.cpp:thisare unchanged.2364923fa6; the branch's diff againstmaindiffers between that head ande0c8c01d20only in the count atdocs/dev/debt/libwebrtc.md:5and one blank linemainleft after theFileWrapperentry): I putNotImplemented_nid_no_patchback at the top of the five bodies, which ismain's behaviour, and kept this branch's signatures and test. The new test then aborts with_ZN6webrtc13PacketOptionsD1Ev_nid_postfix not implemented(1 of 1 failed).tools/check_conventions.py --base upstream/mainon the committed heade0c8c01d20: all checks pass.tools/pr_overlap.py --branch feat/libwebrtc-free-trivial-returns --jobs 8at heade0c8c01d20, against 1,901 open pull requests: 33 share files with the branch. It lists 28 with conflicting lines, all indocs/dev/debt/libwebrtc.md: 27 on the inventory count entry (line 5) alone and #15766 on lines 5 and 13. No row reports a shared export or a shared new file. The run failed closed (exit 2) and lists 3 more (#14212, #15154, #15264) in its "Some comparisons could not be completed" table, which it does not compare line by line. I grepped the added and removed lines of all 31 listed pull requests' diffs for the five exports' names and NIDs, and none of them names any of the five. Whichever lands second recounts the inventory entry.mainc9f43dfa1dconflicted only next to the new debt entry. The merged number is counted from the mergedExport.cpprather than subtracted: 330 of its 338APS5_VABIentries still throw throughNotImplemented_nid_no_patch, 59 of them bound by NID only. The same count gives 335 of 338 and 60 onmainc9f43dfa1d.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