feat(libwebrtc): implement AudioEncoder::OnReceivedTargetAudioBitrate and OnReceivedUplinkAllocation #17269

Merged
alvaroelpob merged 4 commits from upstream-pr/17269 into main 2026-11-11 22:02:08 +00:00
alvaroelpob commented 2026-11-08 16:37:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-08T16:37:10Z.


What

Implements webrtc::AudioEncoder::OnReceivedTargetAudioBitrate(int) and OnReceivedUplinkAllocation(BitrateAllocationUpdate), which threw. Both call the virtual OnReceivedUplinkBandwidth through the encoder's own vtable (slot 21, the same at M127 and M134 in api/audio_codecs/audio_encoder.h), as audio_encoder.cc does: the first with an empty period, the second with target_bitrate.bps() and bwe_period.ms() (BitrateAllocationUpdate is identical at both revisions). The unmeasured parts (slot, optional passed in two registers) are in docs/dev/debt/libwebrtc.md.

Tested

Linux x86-64: full build, check_conventions.py --base upstream/main and the full suite pass on this branch (4549 of 4549 tests, none failing). ctest -R guest_webrtc_audio_encoder uses a fake vtable per encoder to check that the call goes through the object's own slot, and the rounding of bwe_period.ms(). upstream/main passes 4547 of 4547 here.

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: #14212, #15189, #15609, #16381, #16485, #16894
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5213081175 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17269). Originally posted by [alvaroelpob](https://github.com/alvaroelpob) on 2026-11-08T16:37:10Z. --- ### What Implements `webrtc::AudioEncoder::OnReceivedTargetAudioBitrate(int)` and `OnReceivedUplinkAllocation(BitrateAllocationUpdate)`, which threw. Both call the virtual `OnReceivedUplinkBandwidth` through the encoder's own vtable (slot 21, the same at M127 and M134 in `api/audio_codecs/audio_encoder.h`), as `audio_encoder.cc` does: the first with an empty period, the second with `target_bitrate.bps()` and `bwe_period.ms()` (`BitrateAllocationUpdate` is identical at both revisions). The unmeasured parts (slot, optional passed in two registers) are in `docs/dev/debt/libwebrtc.md`. ### 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 x86-64: full build, `check_conventions.py --base upstream/main` and the full suite pass on this branch (4549 of 4549 tests, none failing). `ctest -R guest_webrtc_audio_encoder` uses a fake vtable per encoder to check that the call goes through the object's own slot, and the rounding of `bwe_period.ms()`. `upstream/main` passes 4547 of 4547 here. ### 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: #14212, #15189, #15609, #16381, #16485, #16894 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
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!17269
No description provided.