feat(libwebrtc): implement the CodecSpecificInfo constructor and destructor #20031
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20031"
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 Krille2004zzz on 2026-11-14T12:33:06Z.
What
Implements
webrtc::CodecSpecificInfo::CodecSpecificInfo()(_ZN6webrtc17CodecSpecificInfoC1Ev) and~CodecSpecificInfo()(_ZN6webrtc17CodecSpecificInfoD1Ev), replacing theirNotImplementedstubs.codecType = kVideoCodecGeneric, the codec-specific union zeroed,end_of_picture = true, all optionals disengaged.absl::InlinedVectorstorage inGenericFrameInfo/FrameDependencyStructure(including every template),part_of_chain, the templates vector, andFrameInstrumentationData::sample_values. Malformedsample_valuesand template vectors, unknown variant indexes and null objects throw before anything is freed.part_of_chainand heap-allocatedInlinedVectorstorage are freed as they are, without extra validation, as upstream's defaulted destructor does.frame_instrumentation_datawas added in M130, and the module exportsBuiltinAudioProcessingBuilder, which first appears in M132; all headers involved are identical between M132 and M134. Clang 19 + libc++ probes of the real headers give 2064 bytes (union at 8,end_of_pictureat 1632, optionals at 1640/1856/1992/2000, 4-byte variant index at 2048), and a cross-check reading real libc++ objects through the new structs matched every field.docs/dev/debt/libwebrtc.mdlists what is unverified: libc++ as the module's standard library,absl::variantasstd::variant, the allocator, and the console behaviour.Tested
Linux (Debian trixie, GCC 14.2), build with
BUILD_TESTING=ON. Not tested on a console, a title or Windows.core/libs/prx/libwebrtc/tests/CodecSpecificInfo.cppcover the default state, a destructor that frees every owned allocation and leaves inline storage alone, sync and valueless variants, malformed vectors and variant indexes, and null objects.ctest -R '[Ww]eb[Rr]tc|[Nn]ack|[Cc]odec|public_headers|export_gap|conventions|progress_report|test_registration|debt': 249/249 passed.python3 tools/check_conventions.py --base origin/main: all checks passed.tools/pr_overlap.pyreports no open PR with these exports.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 PrivacyOnion on 2026-11-14T13:11:13Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
6e7b4bbd8e:tools/check_conventions.pypassed;git diff --checkclean.guest_webrtc_codec_specific_info_testsbuilt cleanly.guest_webrtc_codec_specific_info_default,guest_webrtc_codec_specific_info_destructor):core/libs/prx/libwebrtc/Export.cpp,core/libs/prx/libwebrtc/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T14:29:43Z.
Review: COMMENTED
Reviewed — comments
The implementation and tests are readable, but the malformed-vector claim is broader than the destructor checks, and I could not run the reported checks.
What I ran
Reviewed head
6e7b4bbd8e617036d967328992225abce84974beusing the review reader. No build or test commands were run. Read all seven changed files listed as included; no changed files were excluded.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libwebrtc/src/CodecSpecificInfo.cpp:76freespartOfChain.beginwithout validating its size/capacity, and:53frees an inlined vector allocation based only on the metadata bit. The description says malformed vectors throw before anything is freed, but the tests only exercise malformed sample and template pointer ranges. Please validate these vector representations before freeing, or narrow the documented claim and add tests for malformedpartOfChainand inlined-vector state.Sources
Not verified
The reported Debian build, 249 CTest checks, convention check, and overlap check were author-reported and not run during this review. Console ABI, allocator behavior, and console execution remain unverified as the description notes.
To get this to a good state
Nothing is required. Optionally validate or clarify the malformed-vector behavior and add the corresponding edge-case tests.
Continued review (pass 2)
The three specified added lines and their surrounding context were read at head
6e7b4bbd8e617036d967328992225abce84974be; they introduce no additional issue.What I ran
Read the prepared description, commit list, diff, manifest, and the specified source lines with
repo_read.py. No tests or build commands were run in this continuation pass.Results
Findings
Blocking
None in the specified lines.
Non-blocking
None in the specified lines.
Not verified
This continuation pass covers only
core/libs/prx/libwebrtc/CMakeLists.txt:11,core/libs/prx/libwebrtc/include/Api.hpp:9, anddocs/dev/debt/libwebrtc.md:5. The rest of the changed lines and prior-pass findings are outside this pass. The reviewed source files were not excluded; other repository files were not read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T15:34:05Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
09ac0c32bb:tools/check_conventions.pypassed;git diff --checkclean.guest_webrtc_codec_specific_info_testsbuilt cleanly.guest_webrtc_codec_specific_info_default,guest_webrtc_codec_specific_info_destructor):core/libs/prx/libwebrtc/Export.cpp,core/libs/prx/libwebrtc/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me