feat(libwebrtc): implement the webrtc::VideoFrame::Builder timestamp, RTP timestamp, NTP time and id setters #15274
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15274"
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-02T22:37:22Z.
What
Implements
webrtc::VideoFrame::Builder::set_timestamp_ms(int64_t),set_timestamp_rtp(uint32_t),set_ntp_time_ms(int64_t)andset_id(uint16_t)in libwebrtc, which threw and were declared without parameters.The module's WebRTC revision lies between M127 and M134, as recorded in the debt file. The four setters in
video_frame.cc(M127, M134) are the same at both. TheBuildermembers are too, apart from M134 renamingcapture_time_identifier_topresentation_timestamp_.src/VideoFrameBuilder.cppstarts with that file's WebRTC notice and the BSD licence.WebRtcVideoFrameBuilderis the 192-byte layout, checked by compiling an equivalent struct withstd::optionalon the host:id_at 0, the buffer reference at 8,timestamp_us_at 16;timestamp_rtp_at 56,ntp_time_ms_at 64 and the rotation at 72;ColorSpace(68 bytes) at 76,RenderParametersat 148, the optionalUpdateRectat 160 andRtpPacketInfosat 184.The layout assumes the guest
std::optionalstores its flag after the value.set_timestamp_msstores milliseconds × 1000 intimestamp_us_; each setter returns the builder. A null builder throws. It removes 4 exports from the inventory.Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ON.guest_webrtc_video_frame_buildertest: each setter returns the builder and changes only its own field in a builder filled with 0xA5, including negative milliseconds,UINT32_MAXRTP timestamps andINT64_MINNTP times; a null builder throws.ctest -j16on head f08e8c83df: 3596/3596 pass.check_conventions.py --base upstream/mainpasses.pr_overlap.py: no open pull request implements these functions. The shared lines are the pending-export count indocs/dev/debt/libwebrtc.mdand the source, test and declaration lists inCMakeLists.txtandApi.hpp.main4f41f4c375, head 432413b6c2, to resolve the conflicts on the sharedCMakeLists.txt,Export.cppand debt-file lines; both sides are kept and the debt count is recomputed fromExport.cpp. Full build andctest -j16: 3796/3800 pass;guest_sce_net,guest_poll,guest_select_waitandguest_memoryfailed under that load, pass when run alone, andmain4f41f4c375passes all 3799 with-j16on the same machine.check_conventions.py --base upstream/mainpasses.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 BunnyFl on 2026-11-04T01:07:26Z.
Review: APPROVED
@alvaroelpob thanks, the four setters match the firmware module.
Firmware 13.42. In
system/common/lib/libwebrtc.sprx(sha256d59d0caf6967329b39201a2a0bd6df7b994516f21701b9801908db6735ae5314), read from disassembly to eachret, not run, not measured on a console:So the offsets the PR uses (
idat 0,timestampUsat 16,timestampRtpat 56,ntpTimeMsat 64), the store widths, the factor of 1000 and the returned builder all match. The 64-bitimulwraps, and so does yourstd::uint64_tmultiply. The stores above touch only those four fields, so this doesn't confirm the rest of the 192-byte layout.Optional, debt wording. The entry says "nothing is checked on the console". With the above, it could cite the module instead: "Firmware 13.42 stores directly with no null check (read from disassembly, not measured on a console), so the console faults on a null builder; AnyPS5 throws instead." The layout assumption for the remaining fields still stands.
What I ran: head
432413b6c2merged ontomain1c8c0efc8c, Windows 11, WinLibs GCC, Release:guest_webrtc_video_frame_builderandpublic_headerspass (2 of 2);* 1000uchanged to* 100uinset_timestamp_ms):guest_webrtc_video_frame_builderfails;tools/check_conventions.py --base upstream/mainon the head: all checks passed.Export.cpphas 347 throwing exports on the head (351 onmain), matching the debt entry.Approving.
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-05T17:57:36Z.
Review: APPROVED
@alvaroelpob re-approving at
3b81e53ed8, after the rebase.What changed since my approval at
432413b6c2(git range-diff): the code and test commits differ only in aCMakeLists.txtcontext line from the rebase. The new commits only touchdocs/dev/debt/libwebrtc.md:core/libs/prx/libwebrtc/Export.cpphas 343NotImplemented_nid_no_patchexports at this head and 347 onmainfc23faa40a, whose entry also says 347.What I ran: this head merged onto
mainfc23faa40a(mergea7ddcb591b, clean), Windows 11 Pro 10.0.26300, WinLibs GCC, Release:guest_webrtc_video_frame_builderandpublic_headerspass (2 of 2);* 1000uchanged to* 100uinset_timestamp_ms(the pattern matched once):guest_webrtc_video_frame_builderfails withlibwebrtc VideoFrame::Builder check failed at line 40.Overlap (
tools/pr_overlap.py --branchon this head): #15275 and #15276 share these exports and new files; both are yours and declareDepends on: #15274. The other rows are the sharedCMakeLists.txtsource list and the debt count line that every open libwebrtc PR edits, with no shared exports.AI-assisted: yes (Claude Code)