feat(libwebrtc): implement AudioState::Config::~Config #18498

Merged
alvaroelpob merged 5 commits from upstream-pr/18498 into main 2026-11-30 04:10:21 +00:00
alvaroelpob commented 2026-11-11 18:58:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-11T18:58:35Z.


What

Implements webrtc::AudioState::Config::~Config, which threw through NotImplemented_nid_no_patch.

audio_state.cc defaults the destructor, so it destroys the four scoped_refptr members of audio_state.h in reverse order: async audio processing factory, audio device module, audio processing, audio mixer. Each one that is not null calls Release() on its object (scoped_refptr.h). All four types (AudioMixer, AudioProcessing, AudioDeviceModule, AsyncAudioProcessing::Factory) derive only from RefCountInterface, whose virtuals are AddRef, Release and the destructor in that order (ref_count.h), so Release is vtable slot 1 and is called through the guest object's vtable. The member list, the bases and the slot order are the same at M127 (e0b28a6a81a9) and M134 (8d78f5de6c27).

The debt entry for the constructor now covers the destructor too; the slot is not checked on the console.

Tested

Linux: suite.py feat/libwebrtc-audio-state-config-destructor at e908c9d48d: CTest 6573/6574 passed; guest_libressl_tls_engine_transport failed once and passed on rerun; conventions passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Summary by CodeRabbit

  • Bug Fixes
    • WebRTC audio configuration now releases its associated audio resources when destroyed, helping prevent resources from being retained longer than necessary. Cleanup also handles configurations with optional audio components unset.
  • Documentation
    • Updated developer notes to reflect the audio configuration cleanup behavior and the revised list of unimplemented WebRTC exports.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5265171288 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18498). Originally posted by [alvaroelpob](https://github.com/alvaroelpob) on 2026-11-11T18:58:35Z. --- ### What Implements `webrtc::AudioState::Config::~Config`, which threw through `NotImplemented_nid_no_patch`. [audio_state.cc](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/call/audio_state.cc) defaults the destructor, so it destroys the four `scoped_refptr` members of [audio_state.h](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/call/audio_state.h) in reverse order: async audio processing factory, audio device module, audio processing, audio mixer. Each one that is not null calls `Release()` on its object ([scoped_refptr.h](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/api/scoped_refptr.h)). All four types (`AudioMixer`, `AudioProcessing`, `AudioDeviceModule`, `AsyncAudioProcessing::Factory`) derive only from `RefCountInterface`, whose virtuals are `AddRef`, `Release` and the destructor in that order ([ref_count.h](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/api/ref_count.h)), so `Release` is vtable slot 1 and is called through the guest object's vtable. The member list, the bases and the slot order are the same at M127 (e0b28a6a81a9) and M134 (8d78f5de6c27). The debt entry for the constructor now covers the destructor too; the slot is not checked on the console. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux: `suite.py feat/libwebrtc-audio-state-config-destructor` at e908c9d48d: CTest 6573/6574 passed; guest_libressl_tls_engine_transport failed once and passed on rerun; conventions passed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * WebRTC audio configuration now releases its associated audio resources when destroyed, helping prevent resources from being retained longer than necessary. Cleanup also handles configurations with optional audio components unset. * **Documentation** * Updated developer notes to reflect the audio configuration cleanup behavior and the revised list of unimplemented WebRTC exports. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-11-12 14:28:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T14:28:07Z.

Review: COMMENTED


Reviewed — no blocking findings

The PR replaces the throwing AudioState::Config destructor with one that releases the four references in the order factory, device module, processing, mixer; the code read at head 40fe52da453f shows no blocking defect.

What I ran

  • Head: 40fe52da453f46599c3132e8e720790328e6b375, base main.
  • Read the description, commits, manifest and diff, then the head copy of AudioStateConfig.hpp and the start of the test file, through the reader.
  • Reader searches for the destructor symbol and for RefCountInterface.
  • No build, no test run, no check_conventions run.
Commands
python3 <reader> cat core/libs/prx/libwebrtc/include/AudioStateConfig.hpp 1 13
python3 <reader> search WebRtcAudioStateConfig
python3 <reader> search AudioState6ConfigD1Ev
python3 <reader> search RefCountInterface

Results

Check Result Note
Build and test suite not run Author reports 4925/4925 on 40fe52da45
check_conventions not run Author reports pass
Release order vs. test passed By reading: struct order matches the fdpm expectation
Declaration matches definition passed By reading: Api.hpp:328, AudioStateConfig.cpp:71

Findings

Blocking

None.

Non-blocking

None.

Sources

  • Upstream audio_state.cc and ref_count.h, as pinned in the debt entry at docs/dev/debt/libwebrtc.md:147.

Not verified

  • Build, unit tests and check_conventions were not run here. The pass results are the author's.
  • Slot 1 as Release in RefCountInterface rests on the upstream permalink. ref_count.h is not in this repository, so I did not check it.
  • Real guest objects releasing to zero were not exercised. The new tests use fake vtables. The debt entry already says console behaviour is unmeasured.
  • Dependency on #18495 was not checked.
  • Files read: AudioStateConfig.cpp, Api.hpp, Export.cpp and docs/dev/debt/libwebrtc.md were read through their changed hunks in diff.patch. tests/AudioStateConfig.cpp was read at lines 1–40 plus its hunks. Nothing was excluded by rule.

To get this to a good state

Nothing blocking. No new commands are needed on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5876130691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18498#pullrequestreview-5876130691). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-12T14:28:07Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The PR replaces the throwing `AudioState::Config` destructor with one that releases the four references in the order factory, device module, processing, mixer; the code read at head 40fe52da453f shows no blocking defect. ## What I ran - Head: `40fe52da453f46599c3132e8e720790328e6b375`, base `main`. - Read the description, commits, manifest and diff, then the head copy of `AudioStateConfig.hpp` and the start of the test file, through the reader. - Reader searches for the destructor symbol and for `RefCountInterface`. - No build, no test run, no `check_conventions` run. <details> <summary>Commands</summary> ``` python3 <reader> cat core/libs/prx/libwebrtc/include/AudioStateConfig.hpp 1 13 python3 <reader> search WebRtcAudioStateConfig python3 <reader> search AudioState6ConfigD1Ev python3 <reader> search RefCountInterface ``` </details> ## Results | Check | Result | Note | | --- | --- | --- | | Build and test suite | not run | Author reports 4925/4925 on 40fe52da45 | | check_conventions | not run | Author reports pass | | Release order vs. test | passed | By reading: struct order matches the `fdpm` expectation | | Declaration matches definition | passed | By reading: Api.hpp:328, AudioStateConfig.cpp:71 | ## Findings ### Blocking None. ### Non-blocking None. ## Sources - Upstream `audio_state.cc` and `ref_count.h`, as pinned in the debt entry at `docs/dev/debt/libwebrtc.md:147`. ## Not verified - Build, unit tests and `check_conventions` were not run here. The pass results are the author's. - Slot 1 as `Release` in `RefCountInterface` rests on the upstream permalink. `ref_count.h` is not in this repository, so I did not check it. - Real guest objects releasing to zero were not exercised. The new tests use fake vtables. The debt entry already says console behaviour is unmeasured. - Dependency on #18495 was not checked. - Files read: `AudioStateConfig.cpp`, `Api.hpp`, `Export.cpp` and `docs/dev/debt/libwebrtc.md` were read through their changed hunks in `diff.patch`. `tests/AudioStateConfig.cpp` was read at lines 1–40 plus its hunks. Nothing was excluded by rule. ## To get this to a good state Nothing blocking. No new commands are needed on the new head.
MarcZX10 commented 2026-11-14 00:13:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T00:13:35Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the destructor’s reverse release order, null handling, and guest vtable slot call are consistent with the inspected layout and existing implementation patterns.

What I ran

Reviewed head 82101e4db1ac311fd027a75e961e91b4adc73f54. No commands or tests were run; the author reports a full build and suite, a serial rerun with 4925/4925 tests passing, and convention checks passing.

Results

Check Result Note
Source review passed Changed implementation and call sites inspected
Tests not run Results supplied by author
Console behavior not run Destructor slot not checked on console

Findings

Blocking

None.

Non-blocking

None.

Not verified

Console behavior and the Release vtable slot were not verified. All changed files listed in the manifest were read: core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp, core/libs/prx/libwebrtc/src/AudioStateConfig.cpp, core/libs/prx/libwebrtc/tests/AudioStateConfig.cpp, and docs/dev/debt/libwebrtc.md. No files were excluded by the prepared manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5899878846 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18498#pullrequestreview-5899878846). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T00:13:35Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the destructor’s reverse release order, null handling, and guest vtable slot call are consistent with the inspected layout and existing implementation patterns. ## What I ran Reviewed head `82101e4db1ac311fd027a75e961e91b4adc73f54`. No commands or tests were run; the author reports a full build and suite, a serial rerun with 4925/4925 tests passing, and convention checks passing. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Changed implementation and call sites inspected | | Tests | not run | Results supplied by author | | Console behavior | not run | Destructor slot not checked on console | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Console behavior and the `Release` vtable slot were not verified. All changed files listed in the manifest were read: `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp`, `core/libs/prx/libwebrtc/src/AudioStateConfig.cpp`, `core/libs/prx/libwebrtc/tests/AudioStateConfig.cpp`, and `docs/dev/debt/libwebrtc.md`. No files were excluded by the prepared manifest. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-15 12:13:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T12:13:23Z.

Review: COMMENTED


Reviewed — no blocking findings

The implementation and focused tests support the documented destructor behavior at head ae78422ce310feea7430e5b786d4148c038c31df; no checks were run in this review, so approval is not justified.

What I ran

No commands or tests were run. I inspected the prepared diff and changed source at the pinned head.

Results

Check Result Note
Diff and changed code review passed Five changed files inspected
Build and test suite not run Author reports passing runs
Console behavior not run Release slot is not checked on console

Findings

Blocking

None.

Non-blocking

None.

Not verified

No build, test, or console checks were run. The author reports a full Linux/WSL2 build and suite on an earlier commit, 40fe52da45; that result was not independently verified here. All files marked reviewed in the review manifest were read: core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp, core/libs/prx/libwebrtc/src/AudioStateConfig.cpp, core/libs/prx/libwebrtc/tests/AudioStateConfig.cpp, and docs/dev/debt/libwebrtc.md. No changed files were excluded.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5910622987 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18498#pullrequestreview-5910622987). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T12:13:23Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The implementation and focused tests support the documented destructor behavior at head `ae78422ce310feea7430e5b786d4148c038c31df`; no checks were run in this review, so approval is not justified. ## What I ran No commands or tests were run. I inspected the prepared diff and changed source at the pinned head. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code review | passed | Five changed files inspected | | Build and test suite | not run | Author reports passing runs | | Console behavior | not run | Release slot is not checked on console | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No build, test, or console checks were run. The author reports a full Linux/WSL2 build and suite on an earlier commit, `40fe52da45`; that result was not independently verified here. All files marked `reviewed` in the review manifest were read: `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp`, `core/libs/prx/libwebrtc/src/AudioStateConfig.cpp`, `core/libs/prx/libwebrtc/tests/AudioStateConfig.cpp`, and `docs/dev/debt/libwebrtc.md`. No changed files were excluded. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 05:26:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T05:26:48Z.

Review: APPROVED


Reviewed — looks good

The destructor releases the four references in reverse member order through the declared Release slot; all five changed files were read, and no blocking defect was verified.

What I ran

Reviewed head e509c172e2bdf4275bae1b3cb827f11b79b30f67. Read the prepared description, commits, diff, manifest, and all five changed files through repo_read.py. No build or tests were run; the test results in the PR description are author-reported.

Results

Check Result Note
Changed code review passed All five changed files read
Build and tests not run Author reports passing results

Findings

Blocking

None.

Non-blocking

None.

Not verified

The claimed Linux build, test suite, and convention check were not run by this review. Console behavior and the Release slot were not checked on hardware. The changed files reviewed were core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp, core/libs/prx/libwebrtc/src/AudioStateConfig.cpp, core/libs/prx/libwebrtc/tests/AudioStateConfig.cpp, and docs/dev/debt/libwebrtc.md; files.json was not available from the reader, and the manifest lists no excluded changed files.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6010542013 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18498#pullrequestreview-6010542013). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T05:26:48Z. **Review:** APPROVED --- # Reviewed — looks good The destructor releases the four references in reverse member order through the declared `Release` slot; all five changed files were read, and no blocking defect was verified. ## What I ran Reviewed head `e509c172e2bdf4275bae1b3cb827f11b79b30f67`. Read the prepared description, commits, diff, manifest, and all five changed files through `repo_read.py`. No build or tests were run; the test results in the PR description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | All five changed files read | | Build and tests | not run | Author reports passing results | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The claimed Linux build, test suite, and convention check were not run by this review. Console behavior and the `Release` slot were not checked on hardware. The changed files reviewed were `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp`, `core/libs/prx/libwebrtc/src/AudioStateConfig.cpp`, `core/libs/prx/libwebrtc/tests/AudioStateConfig.cpp`, and `docs/dev/debt/libwebrtc.md`; `files.json` was not available from the reader, and the manifest lists no excluded changed files. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 06:52:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T06:52:51Z.

Review: COMMENTED


Reviewed — comments

The change implements the destructor and adds coverage, but I could not run the checks on this head, so I cannot make a formal merge decision.

What I ran

Reviewed head e908c9d48d33cdcabf4f7f8e2812b220a0bf5a20 using the prepared review bundle and pinned reader repo_read.py. No commands or tests were run.

Results

Check Result Note
Diff and changed code review passed Six changed files inspected
Test suite not run Author reports Linux suite results
Negative control not run Could not run checks

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

The Linux test results in the PR description are author-reported, not independently verified. I read the changed hunks and full text for the other changed files; Export.cpp was read only around the removed stub. I did not inspect excluded files, if any, or verify behavior on a console.

To get this to a good state

Nothing is required. The Linux checks reported in the description are optional to rerun on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6010876530 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18498#pullrequestreview-6010876530). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T06:52:51Z. **Review:** COMMENTED --- # Reviewed — comments The change implements the destructor and adds coverage, but I could not run the checks on this head, so I cannot make a formal merge decision. ## What I ran Reviewed head `e908c9d48d33cdcabf4f7f8e2812b220a0bf5a20` using the prepared review bundle and pinned reader `repo_read.py`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code review | passed | Six changed files inspected | | Test suite | not run | Author reports Linux suite results | | Negative control | not run | Could not run checks | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified The Linux test results in the PR description are author-reported, not independently verified. I read the changed hunks and full text for the other changed files; `Export.cpp` was read only around the removed stub. I did not inspect excluded files, if any, or verify behavior on a console. ## To get this to a good state Nothing is required. The Linux checks reported in the description are optional to rerun on this head.
MarcZX10 commented 2026-11-30 02:00:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T02:00:58Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the host-side destructor behavior is covered by focused tests, while the guest Release slot remains unverified on console.

What I ran

Reviewed head 36fc6ff2f7aa2385708928e50386ec2dc9e13f15. I read the prepared description, commits, manifest, diff, all six changed files, and targeted destructor and ABI context through repo_read.py. I did not run tests or builds; the Linux test results below were reported by the author.

Results

Check Result Note
Diff and changed files passed All six changed files read
Destructor behavior passed Order and null handling covered
Linux test suite not run Author reported 6573/6574, then rerun passed
Console ABI behavior not run Release slot not checked on console

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not run the test suite or verify guest object vtables and Release slot behavior on console. The reported Linux suite initially had one failure, which passed on rerun; conventions reportedly passed. No files were excluded from the review: the manifest lists six changed files, all included and read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6106075499 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18498#pullrequestreview-6106075499). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-30T02:00:58Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the host-side destructor behavior is covered by focused tests, while the guest `Release` slot remains unverified on console. ## What I ran Reviewed head `36fc6ff2f7aa2385708928e50386ec2dc9e13f15`. I read the prepared description, commits, manifest, diff, all six changed files, and targeted destructor and ABI context through `repo_read.py`. I did not run tests or builds; the Linux test results below were reported by the author. ## Results | Check | Result | Note | |---|---|---| | Diff and changed files | passed | All six changed files read | | Destructor behavior | passed | Order and null handling covered | | Linux test suite | not run | Author reported 6573/6574, then rerun passed | | Console ABI behavior | not run | `Release` slot not checked on console | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not run the test suite or verify guest object vtables and `Release` slot behavior on console. The reported Linux suite initially had one failure, which passed on rerun; conventions reportedly passed. No files were excluded from the review: the manifest lists six changed files, all included and read. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!18498
No description provided.