Commit 7389eb0
committed
Add SDL_sound streaming support and CFFI bindings
Expose SDL_sound streaming to the engine and update related plumbing.
- Add SDLSound streaming API (SDLSoundStreamInfo / SDLSoundStream) and functions: GetStreamInfo, OpenStream, ReadStream, RewindStream, SeekStream, CloseStream.
- Implement robust SDL_sound handling in SDLSound.cpp: sample creation, buffer alignment, prepare/resize logic, better error reporting, and streaming decode paths.
- Add SDLSoundBindings.cpp: CFFI/Haxe/HL bindings to work with SDL_sound streams (get info, open stream from bytes/file, read, seek, rewind, clear).
- Register new native CFFI functions in NativeCFFI.hx (regular and HL variants) and add CFFI callables.
- Extend AudioBuffer with fields for SDL sound sources and new helpers: fromBytesStream / fromFileStream and internal SDLSound metadata handling.
- Enhance NativeAudioSource to support SDL_sound streaming: open/reset/clear stream, buffer alignment, queue management, reading stream data and seeking; integrate with existing Vorbis streaming logic.
- Add TryResize API to Bytes and ArrayBufferView and update usages to avoid unnecessary allocations and handle OOM safely.
- Add SDLSoundBindings.cpp to project Build.xml and check Sound_Init() result during SDL init.
These changes enable streamed playback of compressed audio via SDL_sound (bytes or file), improve memory handling during decoding, and expose the required native bindings to Haxe/HL runtimes.1 parent ec6d491 commit 7389eb0
File tree
14 files changed
+1677
-122
lines changed- project
- include
- media
- utils
- src
- backend/sdl
- media
- utils
- src/lime
- _internal/backend/native
- media
- utils
14 files changed
+1677
-122
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
12 | 35 | | |
13 | 36 | | |
14 | 37 | | |
15 | 38 | | |
16 | 39 | | |
17 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
18 | 47 | | |
19 | 48 | | |
20 | 49 | | |
| |||
23 | 52 | | |
24 | 53 | | |
25 | 54 | | |
26 | | - | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
0 commit comments