Example #1
0
// Backend functions, in same order as type BackendFuncs
static ALCboolean opensles_open_playback(ALCdevice *pDevice, const ALCchar *deviceName)
{
    LOGV("opensles_open_playback pDevice=%p, deviceName=%s", pDevice, deviceName);

    // Check if probe has linked the opensl symbols
    if (pslCreateEngine == NULL) {
        alc_opensles_probe(DEVICE_PROBE);
        if (pslCreateEngine == NULL) {
            return ALC_FALSE;
        }
    }

	if (!deviceName)
	{
		deviceName = opensles_device;
	}
	else if (strcmp(deviceName, opensles_device) != 0)
	{
		return ALC_FALSE;
	}
	pDevice->szDeviceName = strdup(deviceName);

	if (pDevice->ExtraData == NULL) {
        alc_opensles_init_extradata(pDevice);
    }

    // create the engine and output mix objects
    alc_opensles_create_native_audio_engine();

    return ALC_TRUE;
}
Example #2
0
// Backend functions, in same order as type BackendFuncs
static ALCboolean opensles_open_playback(ALCdevice *pDevice, const ALCchar *deviceName)
{
    LOGV("opensles_open_playback pDevice=%p, deviceName=%s", pDevice, deviceName);
    opesles_data_t *devState;

    // Check if probe has linked the opensl symbols
    if (pslCreateEngine == NULL) {
        alc_opensles_probe(DEVICE_PROBE);
        if (pslCreateEngine == NULL) {
            return ALC_FALSE;
        }
    }

    if (pDevice->ExtraData == NULL) {
        alc_opensles_init_extradata(pDevice);
    } else {
        devState = (opesles_data_t *) pDevice->ExtraData;
    }

    // create the engine and output mix objects
    SLresult result = alc_opensles_create_native_audio_engine();

    return ALC_TRUE;
}