zenilib: zenilib/jni/external/openal-soft/Alc/backends/opensl.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
opensl.c File Reference
`#include "config.h"`
`#include <stdlib.h>`
`#include "alMain.h"`
`#include "alu.h"`
`#include <SLES/OpenSLES.h>`
`#include <SLES/OpenSLES_Android.h>`

Go to the source code of this file.

## Macros

#define | PRINTERR(x, s)
#define | SLEngineItf_CreateAudioPlayer(a, b, c, d, e, f, g) ((*(a))->CreateAudioPlayer((a),(b),(c),(d),(e),(f),(g)))
#define | SLEngineItf_CreateOutputMix(a, b, c, d, e) ((*(a))->CreateOutputMix((a),(b),(c),(d),(e)))
#define | SLObjectItf_Destroy(a) ((*(a))->Destroy((a)))
#define | SLObjectItf_GetInterface(a, b, c) ((*(a))->GetInterface((a),(b),(c)))
#define | SLObjectItf_Realize(a, b) ((*(a))->Realize((a),(b)))
#define | SLPlayItf_SetPlayState(a, b) ((*(a))->SetPlayState((a),(b)))

## Functions

void | alc_opensl_deinit (void)
ALCboolean | alc_opensl_init (BackendFuncs *func_list)
void | alc_opensl_probe (enum DevProbe type)
static SLuint32 | GetChannelMask (enum DevFmtChannels chans)
static void | opensl_callback (SLAndroidSimpleBufferQueueItf bq, void *context)
static void | opensl_close_playback (ALCdevice *Device)
static ALCenum | opensl_open_playback (ALCdevice *Device, const ALCchar *deviceName)
static ALCboolean | opensl_reset_playback (ALCdevice *Device)
static ALCboolean | opensl_start_playback (ALCdevice *Device)
static void | opensl_stop_playback (ALCdevice *Device)
static const char * | res_str (SLresult result)

## Variables

static const ALCchar | opensl_device [] = "OpenSL"
static const BackendFuncs | opensl_funcs

## Macro Definition Documentation

#define PRINTERR | ( |  | x,
|  |  | s
| ) |  |

Value:
do { \
if((x) != SL_RESULT_SUCCESS) \
ERR("%s: %s\n", (s), res_str((x))); \
} while(0)
s
GLdouble s
Definition: glew.h:1376
x
EGLSurface EGLint x
Definition: eglext.h:293
if
if(!yyg->yy_init)
Definition: glslang_lex.cpp:1037
res_str
static const char * res_str(SLresult result)
Definition: opensl.c:134
ERR
#define ERR(...)
Definition: alMain.h:816

Definition at line 162 of file opensl.c.

Referenced by opensl_callback(), opensl_open_playback(), opensl_reset_playback(), and opensl_start_playback().

#define SLEngineItf_CreateAudioPlayer | ( |  | a,
|  |  | b,
|  |  | c,
|  |  | d,
|  |  | e,
|  |  | f,
|  |  | g
| ) |  | ((*(a))->CreateAudioPlayer((a),(b),(c),(d),(e),(f),(g)))

Definition at line 82 of file opensl.c.

Referenced by opensl_reset_playback().

#define SLEngineItf_CreateOutputMix | ( |  | a,
|  |  | b,
|  |  | c,
|  |  | d,
|  |  | e
| ) |  | ((*(a))->CreateOutputMix((a),(b),(c),(d),(e)))

Definition at line 81 of file opensl.c.

Referenced by opensl_open_playback().

#define SLObjectItf_Destroy | ( |  | a | ) | ((*(a))->Destroy((a)))

Definition at line 79 of file opensl.c.

Referenced by opensl_close_playback(), opensl_open_playback(), opensl_reset_playback(), and opensl_start_playback().

#define SLObjectItf_GetInterface | ( |  | a,
|  |  | b,
|  |  | c
| ) |  | ((*(a))->GetInterface((a),(b),(c)))

Definition at line 78 of file opensl.c.

Referenced by opensl_open_playback(), and opensl_start_playback().

#define SLObjectItf_Realize | ( |  | a,
|  |  | b
| ) |  | ((*(a))->Realize((a),(b)))

Definition at line 77 of file opensl.c.

Referenced by opensl_open_playback(), and opensl_reset_playback().

#define SLPlayItf_SetPlayState | ( |  | a,
|  |  | b
| ) |  | ((*(a))->SetPlayState((a),(b)))

Definition at line 84 of file opensl.c.

Referenced by opensl_start_playback().

## Function Documentation

void alc_opensl_deinit | ( | void |  | ) |

Definition at line 428 of file opensl.c.

ALCboolean alc_opensl_init | ( | BackendFuncs * | func_list | ) |

Definition at line 422 of file opensl.c.

References ALC_TRUE, and opensl_funcs.

void alc_opensl_probe | ( | enum DevProbe | type | ) |

Definition at line 432 of file opensl.c.

References ALL_DEVICE_PROBE, AppendAllDevicesList(), CAPTURE_DEVICE_PROBE, and opensl_device.

static SLuint32 GetChannelMask | ( | enum DevFmtChannels | chans | ) |

static

Definition at line 108 of file opensl.c.

References DevFmtMono, DevFmtQuad, DevFmtStereo, DevFmtX51, DevFmtX51Side, DevFmtX61, and DevFmtX71.

Referenced by opensl_reset_playback().

static void opensl_callback | ( | SLAndroidSimpleBufferQueueItf | bq,
|  | void * | context
| ) |  |

static

Definition at line 168 of file opensl.c.

References aluMixData(), context, ALCdevice_struct::ExtraData, and PRINTERR.

Referenced by opensl_start_playback().

static void opensl_close_playback | ( | ALCdevice * | Device | ) |

static

Definition at line 241 of file opensl.c.

References ALCdevice_struct::ExtraData, free, NULL, and SLObjectItf_Destroy.

static ALCenum opensl_open_playback | ( | ALCdevice * | Device,
|  | const ALCchar * | deviceName
| ) |  |

static

Definition at line 181 of file opensl.c.

References ALC_INVALID_VALUE, ALC_NO_ERROR, ALC_OUT_OF_MEMORY, calloc, ALCdevice_struct::DeviceName, ALCdevice_struct::ExtraData, free, NULL, opensl_device, PRINTERR, SLEngineItf_CreateOutputMix, SLObjectItf_Destroy, SLObjectItf_GetInterface, SLObjectItf_Realize, and strdup().

static ALCboolean opensl_reset_playback | ( | ALCdevice * | Device | ) |

static

Definition at line 260 of file opensl.c.

References ALC_FALSE, ALC_TRUE, BytesFromDevFmt(), ChannelsFromDevFmt(), DevFmtShort, DevFmtStereo, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, ALCdevice_struct::Frequency, GetChannelMask(), NULL, ALCdevice_struct::NumUpdates, PRINTERR, SetDefaultWFXChannelOrder(), SLEngineItf_CreateAudioPlayer, SLObjectItf_Destroy, SLObjectItf_Realize, and ALCdevice_struct::UpdateSize.

static ALCboolean opensl_start_playback | ( | ALCdevice * | Device | ) |

static

Definition at line 331 of file opensl.c.

References ALC_FALSE, ALC_TRUE, calloc, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), free, i, NULL, ALCdevice_struct::NumUpdates, opensl_callback(), PRINTERR, SLObjectItf_Destroy, SLObjectItf_GetInterface, SLPlayItf_SetPlayState, and ALCdevice_struct::UpdateSize.

static void opensl_stop_playback | ( | ALCdevice * | Device | ) |

static

Definition at line 394 of file opensl.c.

References ALCdevice_struct::ExtraData, free, and NULL.

static const char* res_str | ( | SLresult | result | ) |

static

Definition at line 134 of file opensl.c.

## Variable Documentation

const ALCchar opensl_device[] = "OpenSL"

static

Definition at line 105 of file opensl.c.

Referenced by alc_opensl_probe(), and opensl_open_playback().

const BackendFuncs opensl_funcs

static

Initial value:
= {
opensl_open_playback,
opensl_close_playback,
opensl_reset_playback,
opensl_start_playback,
opensl_stop_playback,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
ALCdevice_LockDefault,
ALCdevice_UnlockDefault,
ALCdevice_GetLatencyDefault
}
NULL
#define NULL
Definition: ftobjs.h:61
opensl_stop_playback
static void opensl_stop_playback(ALCdevice *Device)
Definition: opensl.c:394
ALCdevice_GetLatencyDefault
ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device)
Definition: ALc.c:1285
opensl_close_playback
static void opensl_close_playback(ALCdevice *Device)
Definition: opensl.c:241
ALCdevice_LockDefault
void ALCdevice_LockDefault(ALCdevice *device)
Definition: ALc.c:1277
opensl_reset_playback
static ALCboolean opensl_reset_playback(ALCdevice *Device)
Definition: opensl.c:260
ALCdevice_UnlockDefault
void ALCdevice_UnlockDefault(ALCdevice *device)
Definition: ALc.c:1281
opensl_open_playback
static ALCenum opensl_open_playback(ALCdevice *Device, const ALCchar *deviceName)
Definition: opensl.c:181
opensl_start_playback
static ALCboolean opensl_start_playback(ALCdevice *Device)
Definition: opensl.c:331

Definition at line 404 of file opensl.c.

Referenced by alc_opensl_init().