upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/cmake/opus_decoder.cmake
diff options
context:
space:
mode:
authorBubsMcgee <alexbraden99@gmail.com>2026-11-25 14:11:53 -0500
committerBubsMcgee <alexbraden99@gmail.com>2026-11-25 14:11:53 -0500
commita5dd540bccc6ce20971a6680f076beedc13f2a95 (patch)
tree5b5c60d1027384485d63b57e35def6bd38e65ee6 /runtime/cmake/opus_decoder.cmake
parent6ee7ef89b948a9942f5de0b61d1f6756f477d6d5 (diff)
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.
Diffstat (limited to 'runtime/cmake/opus_decoder.cmake')
-rw-r--r--runtime/cmake/opus_decoder.cmake23
1 files changed, 23 insertions, 0 deletions
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 @@
1# Resolves -DLEONIDA_OPUS_DECODER_LIB=<path> for runtime/CMakeLists.txt.
2#
3# When LEONIDA_OPUS_DECODER_LIB is set, the runtime links that prebuilt static library directly and
4# skips running cargo at configure time. A value that does not name an existing file is a configure
5# error rather than a silent fallback to silent XAPU output.
6function(leonida_resolve_prebuilt_opus_decoder lib_input base_dir out_var)
7 if(NOT lib_input)
8 set(${out_var} "" PARENT_SCOPE)
9 return()
10 endif()
11 if(IS_ABSOLUTE "${lib_input}")
12 set(_resolved "${lib_input}")
13 else()
14 cmake_path(ABSOLUTE_PATH lib_input BASE_DIRECTORY "${base_dir}" NORMALIZE OUTPUT_VARIABLE _resolved)
15 endif()
16 if(EXISTS "${_resolved}" AND NOT IS_DIRECTORY "${_resolved}")
17 set(${out_var} "${_resolved}" PARENT_SCOPE)
18 else()
19 message(FATAL_ERROR
20 "LEONIDA_OPUS_DECODER_LIB does not point to an existing file: ${_resolved} "
21 "(pass the path to leonida_opus_decoder.lib or leave it empty to build with cargo)")
22 endif()
23endfunction()