feat(libwebrtc): implement SmoothingFilterImpl::SmoothingFilterImpl(int) #18495
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18495"
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-11T18:40:16Z.
What
Implements
webrtc::SmoothingFilterImpl::SmoothingFilterImpl(int), which threw throughNotImplemented_nid_no_patch.The constructor follows smoothing_filter.cc and smoothing_filter.h, the same at M127 (e0b28a6a81a9) and M134 (8d78f5de6c27) apart from
absl::optionalbecomingstd::optional. It storesinit_time_ms_, computesinit_factor_andinit_const_withpowfandalpha_withexp, and leaves the optional end time disengaged. Because a guest callsAddSample,GetAverageandSetTimeConstantMsthrough the object's vtable and none of them is exported, the object gets a local vtable inSmoothingFilterorder (D1, D0,AddSample,GetAverage,SetTimeConstantMs) whose entries follow the same file, withrtc::TimeMillisas the clock and the existing D1, asrtc::RateTrackerdoes. The math goes through the guest libcpowf,expfandexp.src/SmoothingFilterImpl.cppalready carried the WebRTC notice and BSD licence; it now starts with theDerived fromline. The 64-byte layout is asserted ininclude/SmoothingFilterImpl.hpp. Unverified on the console and recorded as debt: the layout, the vtable order and the optional flag position.Tested
Linux:
suite.py feat/libwebrtc-smoothing-filter-implat2e2c5bdfff: CTest 5716/5722 passed; conventions passed. Failing on main too: agc_driver_global_atomic_csub, agc_driver_stencil_copy_draw, agc_driver_coherent_atomic_loads_enabled, agc_driver_recorder, agc_draw_input_mirrors, agc_draw_input_reuse. guest_webrtc_smoothing_filter now also constructs filters with init times 0, 1, 100 and 100000 and calls AddSample, GetAverage, SetTimeConstantMs and the deleting destructor through the vtable slots: the constructor factors and alpha, no average and a refused time constant before the first sample, the first sample's state and end time, a time constant refused during initialization and accepted after it, and with alpha 0 the average following the last sample once time advances.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)