mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 21:09:34 -10:00
OpenSL's blocks are one arena, so its lend runs from the fill point through every block the device does not hold, to the arena's end: the pipeline produces its output in the buffers the device plays, and the end enqueues each block it completes, sharing write()'s enqueue. DirectSound and SDL2 lend the ring their pump and callback drain, and JACK the first part of its ringbuffer's write vector, whose two entry points join the table it loads; each in whole frames. opensl's mock now plays back what each block held when it finished, and the lend's spans are checked to cross blocks and play in order. dsound_pump lends through wine's DirectSound, jack_runtime through the fake server into the port buffers, and sdl_lost_wakeup against SDL's dummy device, which the samples/audio workflow now runs. pipeline_wakeups reports the staged writes a lending device still takes.
29 lines
954 B
C
29 lines
954 B
C
/* JACK's ringbuffer API with JACK's own prototypes; see jack.h. */
|
|
#ifndef JACK_RUNTIME_SHIM_RINGBUFFER_H
|
|
#define JACK_RUNTIME_SHIM_RINGBUFFER_H
|
|
|
|
#include <stddef.h>
|
|
|
|
typedef struct
|
|
{
|
|
char *buf;
|
|
size_t len;
|
|
} jack_ringbuffer_data_t;
|
|
|
|
typedef struct jack_ringbuffer jack_ringbuffer_t;
|
|
|
|
jack_ringbuffer_t *jack_ringbuffer_create(size_t sz);
|
|
void jack_ringbuffer_free(jack_ringbuffer_t *rb);
|
|
void jack_ringbuffer_get_read_vector(const jack_ringbuffer_t *rb,
|
|
jack_ringbuffer_data_t *vec);
|
|
int jack_ringbuffer_mlock(jack_ringbuffer_t *rb);
|
|
void jack_ringbuffer_read_advance(jack_ringbuffer_t *rb, size_t cnt);
|
|
size_t jack_ringbuffer_write(jack_ringbuffer_t *rb, const char *src,
|
|
size_t cnt);
|
|
size_t jack_ringbuffer_write_space(const jack_ringbuffer_t *rb);
|
|
void jack_ringbuffer_get_write_vector(const jack_ringbuffer_t *rb,
|
|
jack_ringbuffer_data_t *vec);
|
|
void jack_ringbuffer_write_advance(jack_ringbuffer_t *rb, size_t cnt);
|
|
|
|
#endif
|