21 #include "../../SDL_internal.h" 23 #if SDL_AUDIO_DRIVER_ALSA 27 #include <sys/types.h> 34 #include "../SDL_audio_c.h" 37 #ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC 41 static int (*ALSA_snd_pcm_open)
42 (snd_pcm_t **,
const char *, snd_pcm_stream_t, int);
43 static int (*ALSA_snd_pcm_close) (snd_pcm_t * pcm);
44 static snd_pcm_sframes_t (*ALSA_snd_pcm_writei)
45 (snd_pcm_t *,
const void *, snd_pcm_uframes_t);
46 static snd_pcm_sframes_t (*ALSA_snd_pcm_readi)
47 (snd_pcm_t *,
void *, snd_pcm_uframes_t);
48 static int (*ALSA_snd_pcm_recover) (snd_pcm_t *, int, int);
49 static int (*ALSA_snd_pcm_prepare) (snd_pcm_t *);
50 static int (*ALSA_snd_pcm_drain) (snd_pcm_t *);
51 static const char *(*ALSA_snd_strerror) (int);
52 static size_t(*ALSA_snd_pcm_hw_params_sizeof) (
void);
53 static size_t(*ALSA_snd_pcm_sw_params_sizeof) (
void);
54 static void (*ALSA_snd_pcm_hw_params_copy)
55 (snd_pcm_hw_params_t *,
const snd_pcm_hw_params_t *);
56 static int (*ALSA_snd_pcm_hw_params_any) (snd_pcm_t *, snd_pcm_hw_params_t *);
57 static int (*ALSA_snd_pcm_hw_params_set_access)
58 (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_access_t);
59 static int (*ALSA_snd_pcm_hw_params_set_format)
60 (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_format_t);
61 static int (*ALSA_snd_pcm_hw_params_set_channels)
62 (snd_pcm_t *, snd_pcm_hw_params_t *,
unsigned int);
63 static int (*ALSA_snd_pcm_hw_params_get_channels)
64 (
const snd_pcm_hw_params_t *,
unsigned int *);
65 static int (*ALSA_snd_pcm_hw_params_set_rate_near)
66 (snd_pcm_t *, snd_pcm_hw_params_t *,
unsigned int *,
int *);
67 static int (*ALSA_snd_pcm_hw_params_set_period_size_near)
68 (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_uframes_t *,
int *);
69 static int (*ALSA_snd_pcm_hw_params_get_period_size)
70 (
const snd_pcm_hw_params_t *, snd_pcm_uframes_t *,
int *);
71 static int (*ALSA_snd_pcm_hw_params_set_periods_near)
72 (snd_pcm_t *, snd_pcm_hw_params_t *,
unsigned int *,
int *);
73 static int (*ALSA_snd_pcm_hw_params_get_periods)
74 (
const snd_pcm_hw_params_t *,
unsigned int *,
int *);
75 static int (*ALSA_snd_pcm_hw_params_set_buffer_size_near)
76 (snd_pcm_t *pcm, snd_pcm_hw_params_t *, snd_pcm_uframes_t *);
77 static int (*ALSA_snd_pcm_hw_params_get_buffer_size)
78 (
const snd_pcm_hw_params_t *, snd_pcm_uframes_t *);
79 static int (*ALSA_snd_pcm_hw_params) (snd_pcm_t *, snd_pcm_hw_params_t *);
80 static int (*ALSA_snd_pcm_sw_params_current) (snd_pcm_t *,
81 snd_pcm_sw_params_t *);
82 static int (*ALSA_snd_pcm_sw_params_set_start_threshold)
83 (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
84 static int (*ALSA_snd_pcm_sw_params) (snd_pcm_t *, snd_pcm_sw_params_t *);
85 static int (*ALSA_snd_pcm_nonblock) (snd_pcm_t *, int);
86 static int (*ALSA_snd_pcm_wait)(snd_pcm_t *, int);
87 static int (*ALSA_snd_pcm_sw_params_set_avail_min)
88 (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
89 static int (*ALSA_snd_pcm_reset)(snd_pcm_t *);
90 static int (*ALSA_snd_device_name_hint) (int,
const char *,
void ***);
91 static char* (*ALSA_snd_device_name_get_hint) (
const void *,
const char *);
92 static int (*ALSA_snd_device_name_free_hint) (
void **);
93 #ifdef SND_CHMAP_API_VERSION 94 static snd_pcm_chmap_t* (*ALSA_snd_pcm_get_chmap) (snd_pcm_t *);
95 static int (*ALSA_snd_pcm_chmap_print) (
const snd_pcm_chmap_t *
map,
size_t maxlen,
char *
buf);
98 #ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC 99 #define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof 100 #define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof 102 static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC;
103 static void *alsa_handle =
NULL;
106 load_alsa_sym(
const char *fn,
void **
addr)
118 #define SDL_ALSA_SYM(x) \ 119 if (!load_alsa_sym(#x, (void **) (char *) &ALSA_##x)) return -1 121 #define SDL_ALSA_SYM(x) ALSA_##x = x 127 SDL_ALSA_SYM(snd_pcm_open);
128 SDL_ALSA_SYM(snd_pcm_close);
129 SDL_ALSA_SYM(snd_pcm_writei);
130 SDL_ALSA_SYM(snd_pcm_readi);
131 SDL_ALSA_SYM(snd_pcm_recover);
132 SDL_ALSA_SYM(snd_pcm_prepare);
133 SDL_ALSA_SYM(snd_pcm_drain);
134 SDL_ALSA_SYM(snd_strerror);
135 SDL_ALSA_SYM(snd_pcm_hw_params_sizeof);
136 SDL_ALSA_SYM(snd_pcm_sw_params_sizeof);
137 SDL_ALSA_SYM(snd_pcm_hw_params_copy);
138 SDL_ALSA_SYM(snd_pcm_hw_params_any);
139 SDL_ALSA_SYM(snd_pcm_hw_params_set_access);
140 SDL_ALSA_SYM(snd_pcm_hw_params_set_format);
141 SDL_ALSA_SYM(snd_pcm_hw_params_set_channels);
142 SDL_ALSA_SYM(snd_pcm_hw_params_get_channels);
143 SDL_ALSA_SYM(snd_pcm_hw_params_set_rate_near);
144 SDL_ALSA_SYM(snd_pcm_hw_params_set_period_size_near);
145 SDL_ALSA_SYM(snd_pcm_hw_params_get_period_size);
146 SDL_ALSA_SYM(snd_pcm_hw_params_set_periods_near);
147 SDL_ALSA_SYM(snd_pcm_hw_params_get_periods);
148 SDL_ALSA_SYM(snd_pcm_hw_params_set_buffer_size_near);
149 SDL_ALSA_SYM(snd_pcm_hw_params_get_buffer_size);
150 SDL_ALSA_SYM(snd_pcm_hw_params);
151 SDL_ALSA_SYM(snd_pcm_sw_params_current);
152 SDL_ALSA_SYM(snd_pcm_sw_params_set_start_threshold);
153 SDL_ALSA_SYM(snd_pcm_sw_params);
154 SDL_ALSA_SYM(snd_pcm_nonblock);
155 SDL_ALSA_SYM(snd_pcm_wait);
156 SDL_ALSA_SYM(snd_pcm_sw_params_set_avail_min);
157 SDL_ALSA_SYM(snd_pcm_reset);
158 SDL_ALSA_SYM(snd_device_name_hint);
159 SDL_ALSA_SYM(snd_device_name_get_hint);
160 SDL_ALSA_SYM(snd_device_name_free_hint);
161 #ifdef SND_CHMAP_API_VERSION 162 SDL_ALSA_SYM(snd_pcm_get_chmap);
163 SDL_ALSA_SYM(snd_pcm_chmap_print);
171 #ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC 174 UnloadALSALibrary(
void)
176 if (alsa_handle !=
NULL) {
183 LoadALSALibrary(
void)
186 if (alsa_handle ==
NULL) {
188 if (alsa_handle ==
NULL) {
192 retval = load_alsa_syms();
204 UnloadALSALibrary(
void)
209 LoadALSALibrary(
void)
222 if (handle !=
NULL) {
223 return (
const char *)
handle;
228 if (device !=
NULL) {
233 return "plug:surround51";
234 }
else if (channels == 4) {
235 return "plug:surround40";
244 ALSA_WaitDevice(
_THIS)
256 #define SWIZ6(T, buf, numframes) \ 257 T *ptr = (T *) buf; \ 259 for (i = 0; i < numframes; i++, ptr += 6) { \ 261 tmp = ptr[2]; ptr[2] = ptr[4]; ptr[4] = tmp; \ 262 tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \ 266 swizzle_alsa_channels_6_64bit(
void *
buffer,
Uint32 bufferlen)
268 SWIZ6(
Uint64, buffer, bufferlen);
272 swizzle_alsa_channels_6_32bit(
void *
buffer,
Uint32 bufferlen)
274 SWIZ6(
Uint32, buffer, bufferlen);
278 swizzle_alsa_channels_6_16bit(
void *
buffer,
Uint32 bufferlen)
280 SWIZ6(
Uint16, buffer, bufferlen);
284 swizzle_alsa_channels_6_8bit(
void *
buffer,
Uint32 bufferlen)
286 SWIZ6(
Uint8, buffer, bufferlen);
301 case 8: swizzle_alsa_channels_6_8bit(buffer, bufferlen);
break;
302 case 16: swizzle_alsa_channels_6_16bit(buffer, bufferlen);
break;
303 case 32: swizzle_alsa_channels_6_32bit(buffer, bufferlen);
break;
304 case 64: swizzle_alsa_channels_6_64bit(buffer, bufferlen);
break;
305 default:
SDL_assert(!
"unhandled bitsize");
break;
312 #ifdef SND_CHMAP_API_VERSION 323 ALSA_PlayDevice(
_THIS)
325 const Uint8 *sample_buf = (
const Uint8 *) this->hidden->mixbuf;
328 snd_pcm_uframes_t frames_left = ((snd_pcm_uframes_t) this->
spec.
samples);
330 this->hidden->swizzle_func(
this, this->hidden->mixbuf, frames_left);
333 int status = ALSA_snd_pcm_writei(this->hidden->pcm_handle,
334 sample_buf, frames_left);
337 if (status == -EAGAIN) {
343 status = ALSA_snd_pcm_recover(this->hidden->pcm_handle, status, 0);
346 fprintf(stderr,
"ALSA write failed (unrecoverable): %s\n",
347 ALSA_snd_strerror(status));
353 else if (status == 0) {
360 sample_buf += status * frame_size;
361 frames_left -= status;
366 ALSA_GetDeviceBuf(
_THIS)
368 return (this->hidden->mixbuf);
372 ALSA_CaptureFromDevice(
_THIS,
void *buffer,
int buflen)
377 const int total_frames = buflen / frame_size;
378 snd_pcm_uframes_t frames_left = total_frames;
379 snd_pcm_uframes_t wait_time = frame_size / 2;
386 status = ALSA_snd_pcm_readi(this->hidden->pcm_handle,
387 sample_buf, frames_left);
389 if (status == -EAGAIN) {
390 ALSA_snd_pcm_wait(this->hidden->pcm_handle, wait_time);
393 else if (status < 0) {
395 status = ALSA_snd_pcm_recover(this->hidden->pcm_handle, status, 0);
398 fprintf(stderr,
"ALSA read failed (unrecoverable): %s\n",
399 ALSA_snd_strerror(status));
406 sample_buf += status * frame_size;
407 frames_left -= status;
410 this->hidden->swizzle_func(
this, buffer, total_frames - frames_left);
412 return (total_frames - frames_left) * frame_size;
416 ALSA_FlushCapture(
_THIS)
418 ALSA_snd_pcm_reset(this->hidden->pcm_handle);
422 ALSA_CloseDevice(
_THIS)
424 if (this->hidden->pcm_handle) {
431 ALSA_snd_pcm_close(this->hidden->pcm_handle);
438 ALSA_finalize_hardware(
_THIS, snd_pcm_hw_params_t *hwparams,
int override)
444 status = ALSA_snd_pcm_hw_params(this->hidden->pcm_handle, hwparams);
450 status = ALSA_snd_pcm_hw_params_get_buffer_size(hwparams, &bufsize);
454 if ( !
override && bufsize != this->
spec.
samples * 2 ) {
463 snd_pcm_uframes_t persize = 0;
464 unsigned int periods = 0;
466 ALSA_snd_pcm_hw_params_get_period_size(hwparams, &persize,
NULL);
467 ALSA_snd_pcm_hw_params_get_periods(hwparams, &periods,
NULL);
470 "ALSA: period size = %ld, periods = %u, buffer size = %lu\n",
471 persize, periods, bufsize);
478 ALSA_set_period_size(
_THIS, snd_pcm_hw_params_t *
params,
int override)
482 snd_pcm_hw_params_t *hwparams;
483 snd_pcm_uframes_t frames;
484 unsigned int periods;
487 snd_pcm_hw_params_alloca(&hwparams);
488 ALSA_snd_pcm_hw_params_copy(hwparams, params);
491 env =
SDL_getenv(
"SDL_AUDIO_ALSA_SET_PERIOD_SIZE");
494 if (
override == 0 ) {
501 status = ALSA_snd_pcm_hw_params_set_period_size_near(
502 this->hidden->pcm_handle, hwparams, &frames,
NULL);
508 status = ALSA_snd_pcm_hw_params_set_periods_near(
509 this->hidden->pcm_handle, hwparams, &periods,
NULL);
514 return ALSA_finalize_hardware(
this, hwparams,
override);
518 ALSA_set_buffer_size(
_THIS, snd_pcm_hw_params_t *params,
int override)
522 snd_pcm_hw_params_t *hwparams;
523 snd_pcm_uframes_t frames;
526 snd_pcm_hw_params_alloca(&hwparams);
527 ALSA_snd_pcm_hw_params_copy(hwparams, params);
530 env =
SDL_getenv(
"SDL_AUDIO_ALSA_SET_BUFFER_SIZE");
533 if (
override == 0 ) {
540 status = ALSA_snd_pcm_hw_params_set_buffer_size_near(
541 this->hidden->pcm_handle, hwparams, &frames);
546 return ALSA_finalize_hardware(
this, hwparams,
override);
550 ALSA_OpenDevice(
_THIS,
void *handle,
const char *devname,
int iscapture)
553 snd_pcm_t *pcm_handle =
NULL;
554 snd_pcm_hw_params_t *hwparams =
NULL;
555 snd_pcm_sw_params_t *swparams =
NULL;
556 snd_pcm_format_t
format = 0;
558 unsigned int rate = 0;
559 unsigned int channels = 0;
560 #ifdef SND_CHMAP_API_VERSION 561 snd_pcm_chmap_t *chmap;
568 if (this->hidden ==
NULL) {
575 status = ALSA_snd_pcm_open(&pcm_handle,
577 iscapture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK,
581 return SDL_SetError(
"ALSA: Couldn't open audio device: %s",
582 ALSA_snd_strerror(status));
588 snd_pcm_hw_params_alloca(&hwparams);
589 status = ALSA_snd_pcm_hw_params_any(pcm_handle, hwparams);
591 return SDL_SetError(
"ALSA: Couldn't get hardware config: %s",
592 ALSA_snd_strerror(status));
596 status = ALSA_snd_pcm_hw_params_set_access(pcm_handle, hwparams,
597 SND_PCM_ACCESS_RW_INTERLEAVED);
599 return SDL_SetError(
"ALSA: Couldn't set interleaved access: %s",
600 ALSA_snd_strerror(status));
606 test_format && (status < 0);) {
608 switch (test_format) {
610 format = SND_PCM_FORMAT_U8;
613 format = SND_PCM_FORMAT_S8;
616 format = SND_PCM_FORMAT_S16_LE;
619 format = SND_PCM_FORMAT_S16_BE;
622 format = SND_PCM_FORMAT_U16_LE;
625 format = SND_PCM_FORMAT_U16_BE;
628 format = SND_PCM_FORMAT_S32_LE;
631 format = SND_PCM_FORMAT_S32_BE;
634 format = SND_PCM_FORMAT_FLOAT_LE;
637 format = SND_PCM_FORMAT_FLOAT_BE;
644 status = ALSA_snd_pcm_hw_params_set_format(pcm_handle,
652 return SDL_SetError(
"ALSA: Couldn't find any hardware audio formats");
659 this->hidden->swizzle_func = swizzle_alsa_channels;
660 #ifdef SND_CHMAP_API_VERSION 661 chmap = ALSA_snd_pcm_get_chmap(pcm_handle);
663 ALSA_snd_pcm_chmap_print(chmap,
sizeof(chmap_str), chmap_str);
664 if (
SDL_strcmp(
"FL FR FC LFE RL RR", chmap_str) == 0 ||
665 SDL_strcmp(
"FL FR FC LFE SL SR", chmap_str) == 0) {
666 this->hidden->swizzle_func = no_swizzle;
673 status = ALSA_snd_pcm_hw_params_set_channels(pcm_handle, hwparams,
677 status = ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels);
679 return SDL_SetError(
"ALSA: Couldn't set audio channels");
686 status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams,
689 return SDL_SetError(
"ALSA: Couldn't set audio frequency: %s",
690 ALSA_snd_strerror(status));
695 if ( ALSA_set_period_size(
this, hwparams, 0) < 0 &&
696 ALSA_set_buffer_size(
this, hwparams, 0) < 0 ) {
698 status = ALSA_set_period_size(
this, hwparams, 1);
700 return SDL_SetError(
"Couldn't set hardware audio parameters: %s", ALSA_snd_strerror(status));
704 snd_pcm_sw_params_alloca(&swparams);
705 status = ALSA_snd_pcm_sw_params_current(pcm_handle, swparams);
707 return SDL_SetError(
"ALSA: Couldn't get software config: %s",
708 ALSA_snd_strerror(status));
710 status = ALSA_snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, this->
spec.
samples);
712 return SDL_SetError(
"Couldn't set minimum available samples: %s",
713 ALSA_snd_strerror(status));
716 ALSA_snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, 1);
718 return SDL_SetError(
"ALSA: Couldn't set start threshold: %s",
719 ALSA_snd_strerror(status));
721 status = ALSA_snd_pcm_sw_params(pcm_handle, swparams);
723 return SDL_SetError(
"Couldn't set software audio parameters: %s",
724 ALSA_snd_strerror(status));
732 this->hidden->mixlen = this->
spec.
size;
734 if (this->hidden->mixbuf ==
NULL) {
737 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
741 ALSA_snd_pcm_nonblock(pcm_handle, 0);
748 typedef struct ALSA_Device
752 struct ALSA_Device *next;
756 add_device(
const int iscapture,
const char *
name,
void *hint, ALSA_Device **pSeen)
758 ALSA_Device *dev =
SDL_malloc(
sizeof (ALSA_Device));
772 desc = ALSA_snd_device_name_get_hint(hint,
"DESC");
778 desc = (
char *) name;
786 if ((ptr = strchr(desc,
'\n')) !=
NULL) {
805 dev->iscapture = iscapture;
815 ALSA_HotplugThread(
void *arg)
817 SDL_sem *first_run_semaphore = (SDL_sem *) arg;
831 if (ALSA_snd_device_name_hint(-1,
"pcm", &hints) != -1) {
833 const char *match =
NULL;
834 int bestmatch = 0xFFFF;
835 size_t match_len = 0;
837 static const char *
const prefixes[] = {
838 "hw:",
"sysdefault:",
"default:",
NULL 847 for (i = 0; hints[
i]; i++) {
848 char *name = ALSA_snd_device_name_get_hint(hints[i],
"NAME");
854 if ((defaultdev == -1) && (
SDL_strcmp(name,
"default") == 0)) {
858 for (j = 0; prefixes[
j]; j++) {
859 const char *prefix = prefixes[
j];
865 match_len = prefixlen;
874 for (i = 0; hints[
i]; i++) {
878 if ((!match) && (defaultdev != i)) {
882 name = ALSA_snd_device_name_get_hint(hints[i],
"NAME");
888 if (!match || (
SDL_strncmp(name, match, match_len) == 0)) {
889 char *ioid = ALSA_snd_device_name_get_hint(hints[i],
"IOID");
897 if (!isoutput && !isinput) {
903 for (dev = unseen; dev; dev = next) {
905 if ( (
SDL_strcmp(dev->name, name) == 0) && (((isinput) && dev->iscapture) || ((isoutput) && !dev->iscapture)) ) {
914 if (isoutput) have_output =
SDL_TRUE;
920 if (isinput && !have_input) {
921 add_device(
SDL_TRUE, name, hints[i], &seen);
923 if (isoutput && !have_output) {
924 add_device(
SDL_FALSE, name, hints[i], &seen);
931 ALSA_snd_device_name_free_hint(hints);
936 for (dev = unseen; dev; dev = next) {
946 if (first_run_semaphore) {
948 first_run_semaphore =
NULL;
959 for (dev = devices; dev; dev = next) {
970 ALSA_DetectDevices(
void)
980 ALSA_hotplug_thread =
SDL_CreateThread(ALSA_HotplugThread,
"SDLHotplugALSA", semaphore);
981 if (ALSA_hotplug_thread) {
989 ALSA_Deinitialize(
void)
991 if (ALSA_hotplug_thread !=
NULL) {
994 ALSA_hotplug_thread =
NULL;
1003 if (LoadALSALibrary() < 0) {
1025 "alsa",
"ALSA PCM audio", ALSA_Init, 0
SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format)
void(* DetectDevices)(void)
A type representing an atomic integer value. It is a struct so people don't accidentally use numeric ...
#define SDL_CreateSemaphore
void(* PlayDevice)(_THIS)
void(* WaitDevice)(_THIS)
void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
Uint16 SDL_AudioFormat
Audio format flags.
SDL_AudioFormat SDL_NextAudioFormat(void)
GLenum GLuint GLsizei bufsize
GLuint const GLchar * name
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
static SDL_AudioDeviceID device
EGLImageKHR EGLint EGLint * handle
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
void SDL_RemoveAudioDevice(const int iscapture, void *handle)
#define SDL_AUDIO_BITSIZE(x)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
void(* Deinitialize)(void)
void SDL_CalculateAudioSpec(SDL_AudioSpec *spec)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLenum GLsizei const GLuint GLboolean enabled
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
AudioBootStrap ALSA_bootstrap
#define SDL_assert(condition)
int(* OpenDevice)(_THIS, void *handle, const char *devname, int iscapture)
#define SDL_OutOfMemory()
int(* CaptureFromDevice)(_THIS, void *buffer, int buflen)
void(* CloseDevice)(_THIS)
void(* FlushCapture)(_THIS)
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
#define SDL_DestroySemaphore
Uint8 *(* GetDeviceBuf)(_THIS)
void * SDL_LoadFunction(void *handle, const char *name)
const GLubyte GLuint GLuint GLuint GLuint alpha GLboolean GLboolean GLboolean GLboolean alpha GLint GLint GLsizei GLsizei GLenum type GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint border GLenum GLint GLint GLint GLint GLint GLsizei GLsizei height GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLint j2 GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLfloat *params GLenum GLint GLenum GLenum GLvoid *pixels GLenum GLint GLenum GLint *params GLenum GLenum GLint *params GLenum GLsizei const GLvoid *pointer GLenum GLenum const GLint *params GLenum GLfloat GLfloat GLint GLint const GLfloat *points GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat *points GLint GLfloat GLfloat GLint GLfloat GLfloat v2 GLenum GLenum const GLint *params GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum map
#define SDL_TICKS_PASSED(A, B)
Compare SDL ticks values, and return true if A has passed B.
static SDL_AudioDevice * get_audio_device(SDL_AudioDeviceID id)
#define SDL_SetThreadPriority
void SDL_AddAudioDevice(const int iscapture, const char *name, void *handle)