feat(libwebrtc): implement the webrtc::AudioDecoder PLC and error code defaults #14148
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14148"
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-10-31T20:53:38Z.
What
Implements these
webrtc::AudioDecoderbase methods in libwebrtc, which threw and were declared without parameters:HasDecodePlc()DecodePlc(size_t, int16_t*)GeneratePlc(size_t, rtc::BufferT<int16_t>*)ErrorCode()AudioDecoderis the abstract base of the audio decoders. A decoder that does not override these methods gets the base versions in its vtable, so calls through the vtable reach these exports.The module's WebRTC revision lies between M127 and M134, as recorded in the debt file by #13687. These methods in
api/audio_codecs/audio_decoder.ccare the same at M127 branch-heads/6533 and M134 branch-heads/6998; M134 only comments out the unused parameter names ofDecodePlc.The functions are adapted from
audio_decoder.ccand live insrc/AudioDecoder.cpp, which starts with that file's WebRTC copyright notice and the BSD licence text from WebRTC'sLICENSE. The debt entry says it is adapted fromaudio_decoder.cc.As upstream:
HasDecodePlcreturns false.DecodePlcandErrorCodereturn 0.GeneratePlcleaves the concealment buffer untouched.None of them reads the decoder, the output pointer or the buffer, so their layouts are not needed and null is accepted.
DecodeandDecodeRedundantcall the virtualPacketDurationandDecodeInternal, and theParseResultmembers hold astd::unique_ptrto an encoded frame. Those need the vtable and frame layouts, so they are left throwing. The inventory drops from 379 to 375.Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ON.guest_webrtc_audio_decodertest, on a decoder filled with 0xC3, a buffer filled with 0xA5 and samples set to 0x1234:HasDecodePlcreturns false.DecodePlcreturns 0 for 0 and 3 frames and for a null output.GeneratePlcreturns for a buffer and for null.ErrorCodereturns 0.ctest -j16on head 638940eec0: 3038/3038 pass.check_conventions.py --base upstream/mainpasses.pr_overlap.pyreports the open pull requests listed in Depends on.1bc97b9527after #13736 merged; the only conflicts were the include, CMake source and debt count lines. Fullctest -j16on the top of the stack, #14148 head 0884de5716 (which contains this head, 0884de5716): 3087/3087 pass.check_conventions.py --base upstream/mainpasses.dc9dc7eaaeafter #13764 and #13816 merged. The conflicts were the debt count line and, in the AudioDeviceGeneric commit, theExport.cppstubs next to the removed VAD stubs; that commit keepsmain's side and removes only its own seven stubs. The count is now set from the stubs left inExport.cppplus the 60 bound by NID (35231 on this head,
44e052f6dd). Fullctest -j16on the top of the stack, #14148 head44e052f6dd: 3113/3113 pass.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 CnRJay on 2026-11-01T19:49:25Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.