upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/xma_decoder/leonida_xma2_decoder.h
diff options
context:
space:
mode:
authorRafael <rafaelalvesp2005@gmail.com>2026-11-23 15:36:26 -0300
committerRafael <rafaelalvesp2005@gmail.com>2026-11-23 15:36:26 -0300
commit63f0e0dea3a9d44201db408c4e2c3f2f5b2b94d6 (patch)
tree86f0dcad8070e2a3a693ef4897aa83950cfeb224 /runtime/xma_decoder/leonida_xma2_decoder.h
parentf78f7d6a2a9364cb128c03ac539fe540d5c70df1 (diff)
parent6dda0630bd6fc0514baadb94fb98e36bd7d64c0b (diff)
Merge main into fix/walk-bink_names
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/xma_decoder/leonida_xma2_decoder.h')
-rw-r--r--runtime/xma_decoder/leonida_xma2_decoder.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/runtime/xma_decoder/leonida_xma2_decoder.h b/runtime/xma_decoder/leonida_xma2_decoder.h
new file mode 100644
index 000000000..98dd5c49c
--- /dev/null
+++ b/runtime/xma_decoder/leonida_xma2_decoder.h
@@ -0,0 +1,40 @@
1#ifndef LEONIDA_XMA2_DECODER_H
2#define LEONIDA_XMA2_DECODER_H
3
4#include <stddef.h>
5#include <stdint.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define LEONIDA_XMA2_PACKET_BYTES 2048u
12
13typedef struct LeonidaXma2Decoder LeonidaXma2Decoder;
14typedef struct LeonidaXma2PcmBlock LeonidaXma2PcmBlock;
15
16enum LeonidaXma2Status {
17 LEONIDA_XMA2_OK = 0,
18 LEONIDA_XMA2_INVALID_ARGUMENT = 1,
19 LEONIDA_XMA2_INVALID_FORMAT = 2,
20 LEONIDA_XMA2_BAD_PACKET_SIZE = 3,
21 LEONIDA_XMA2_OUT_OF_MEMORY = 4,
22 LEONIDA_XMA2_DECODER_FAILURE = 5,
23 LEONIDA_XMA2_PANIC = 6,
24};
25
26int32_t leonida_xma2_decoder_create(uint32_t sample_rate, uint32_t channels,
27 LeonidaXma2Decoder **out_decoder);
28int32_t leonida_xma2_decode_buffer(LeonidaXma2Decoder *decoder,
29 const uint8_t *input, size_t input_len,
30 LeonidaXma2PcmBlock **out_block);
31void leonida_xma2_decoder_destroy(LeonidaXma2Decoder *decoder);
32const int16_t *leonida_xma2_pcm_data(const LeonidaXma2PcmBlock *block);
33size_t leonida_xma2_pcm_sample_count(const LeonidaXma2PcmBlock *block);
34void leonida_xma2_pcm_destroy(LeonidaXma2PcmBlock *block);
35
36#ifdef __cplusplus
37}
38#endif
39
40#endif