From a5dd540bccc6ce20971a6680f076beedc13f2a95 Mon Sep 17 00:00:00 2001 From: BubsMcgee Date: Wed, 25 Nov 2026 14:11:53 -0500 Subject: xapu: decode Opus packets through runtime/opus_decoder (RT-XAPU-OPUS-DECODE) Builds on #1144 (RT-XAPU-CONNECT-LAYOUTS): the queue and layouts stay there; fill() decodes each process packet through a Rust C-ABI crate over BSD-3 opus-pure when cargo builds it, and keeps the table-of-contents silence path otherwise. Adds xapu_opus_test (a generated 440 Hz stereo packet decoded to 960 frames) and the CMake wiring; xapu_chad_test keeps covering the layouts and the silent path. No game data. --- runtime/cmake/opus_decoder.cmake | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 runtime/cmake/opus_decoder.cmake (limited to 'runtime/cmake/opus_decoder.cmake') diff --git a/runtime/cmake/opus_decoder.cmake b/runtime/cmake/opus_decoder.cmake new file mode 100644 index 000000000..1286b15fa --- /dev/null +++ b/runtime/cmake/opus_decoder.cmake @@ -0,0 +1,23 @@ +# Resolves -DLEONIDA_OPUS_DECODER_LIB= for runtime/CMakeLists.txt. +# +# When LEONIDA_OPUS_DECODER_LIB is set, the runtime links that prebuilt static library directly and +# skips running cargo at configure time. A value that does not name an existing file is a configure +# error rather than a silent fallback to silent XAPU output. +function(leonida_resolve_prebuilt_opus_decoder lib_input base_dir out_var) + if(NOT lib_input) + set(${out_var} "" PARENT_SCOPE) + return() + endif() + if(IS_ABSOLUTE "${lib_input}") + set(_resolved "${lib_input}") + else() + cmake_path(ABSOLUTE_PATH lib_input BASE_DIRECTORY "${base_dir}" NORMALIZE OUTPUT_VARIABLE _resolved) + endif() + if(EXISTS "${_resolved}" AND NOT IS_DIRECTORY "${_resolved}") + set(${out_var} "${_resolved}" PARENT_SCOPE) + else() + message(FATAL_ERROR + "LEONIDA_OPUS_DECODER_LIB does not point to an existing file: ${_resolved} " + "(pass the path to leonida_opus_decoder.lib or leave it empty to build with cargo)") + endif() +endfunction() -- cgit v1.2.3