zenilib: zenilib/jni/external/openal-soft/Alc/helpers.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
Functions | Variables
helpers.c File Reference
`#include "config.h"`
`#include <stdlib.h>`
`#include <time.h>`
`#include <errno.h>`
`#include <stdarg.h>`
`#include "alMain.h"`
`#include <pthread.h>`
`#include <sched.h>`

Go to the source code of this file.

## Functions

void * | al_calloc (size_t alignment, size_t size)
void | al_free (void *ptr)
void * | al_malloc (size_t alignment, size_t size)
void | al_print (const char *type, const char *func, const char *fmt,...)
void | DeleteCriticalSection (CRITICAL_SECTION *cs)
void | EnterCriticalSection (CRITICAL_SECTION *cs)
void | FillCPUCaps (ALuint capfilter)
void | InitializeCriticalSection (CRITICAL_SECTION *cs)
void | InitUIntMap (UIntMap *map, ALsizei limit)
ALenum | InsertUIntMapEntry (UIntMap *map, ALuint key, ALvoid *value)
void | LeaveCriticalSection (CRITICAL_SECTION *cs)
static void | Lock (volatile ALenum *l)
ALvoid * | LookupUIntMapKey (UIntMap *map, ALuint key)
void | ReadLock (RWLock *lock)
void | ReadUnlock (RWLock *lock)
ALvoid * | RemoveUIntMapKey (UIntMap *map, ALuint key)
void | ResetUIntMap (UIntMap *map)
void | RestoreFPUMode (const FPUCtl *ctl)
void | RWLockInit (RWLock *lock)
void | SetMixerFPUMode (FPUCtl *ctl)
void | SetRTPriority (void)
void | Sleep (ALuint t)
ALuint | timeGetTime (void)
static void | Unlock (volatile ALenum *l)
void | WriteLock (RWLock *lock)
void | WriteUnlock (RWLock *lock)

## Variables

ALuint | CPUCapFlags = 0

## Function Documentation

void* al_calloc | ( | size_t | alignment,
|  | size_t | size
| ) |  |

Definition at line 161 of file helpers.c.

References al_malloc(), memset, and ret.

Referenced by alcCaptureOpenDevice(), alcLoopbackOpenDeviceSOFT(), alcOpenDevice(), alGenAuxiliaryEffectSlots(), and alGenSources().

void al_free | ( | void * | ptr | ) |

Definition at line 168 of file helpers.c.

References free, and NULL.

Referenced by alcCaptureOpenDevice(), alcOpenDevice(), alDeleteAuxiliaryEffectSlots(), alDeleteSources(), alGenAuxiliaryEffectSlots(), alGenSources(), FreeDevice(), ReleaseALAuxiliaryEffectSlots(), and ReleaseALSources().

void* al_malloc | ( | size_t | alignment,
|  | size_t | size
| ) |  |

Definition at line 137 of file helpers.c.

References malloc, NULL, and ret.

Referenced by al_calloc().

void al_print | ( | const char * | type,
|  | const char * | func,
|  | const char * | fmt,
|  |  | ...
| ) |  |

Definition at line 450 of file helpers.c.

References i, LogFile, and str.

void DeleteCriticalSection | ( | CRITICAL_SECTION * | cs | ) |

Definition at line 353 of file helpers.c.

References assert, and ret.

Referenced by alc_deinit_safe(), alcCaptureOpenDevice(), alcOpenDevice(), DestroyRingBuffer(), and FreeDevice().

void EnterCriticalSection | ( | CRITICAL_SECTION * | cs | ) |

Definition at line 359 of file helpers.c.

References assert, and ret.

Referenced by ALCdevice_LockDefault(), LockLists(), ReadRingBuffer(), RingBufferSize(), and WriteRingBuffer().

void FillCPUCaps | ( | ALuint | capfilter | ) |

Definition at line 73 of file helpers.c.

References BOOL(), CPU_CAP_NEON, CPU_CAP_SSE, CPUCapFlags, DWORD(), ERR, str, and TRACE.

Referenced by alc_initconfig().

void InitializeCriticalSection | ( | CRITICAL_SECTION * | cs | ) |

Definition at line 334 of file helpers.c.

References assert, and ret.

Referenced by alc_init(), alcCaptureOpenDevice(), alcLoopbackOpenDeviceSOFT(), alcOpenDevice(), and CreateRingBuffer().

void InitUIntMap | ( | UIntMap * | map,
|  | ALsizei | limit
| ) |  |

Definition at line 546 of file helpers.c.

References UIntMap::array, UIntMap::limit, UIntMap::lock, UIntMap::maxsize, NULL, RWLockInit(), and UIntMap::size.

Referenced by alcCaptureOpenDevice(), alcLoopbackOpenDeviceSOFT(), alcOpenDevice(), and InitContext().

ALenum InsertUIntMapEntry | ( | UIntMap * | map,
|  | ALuint | key,
|  | ALvoid * | value
| ) |  |

Definition at line 565 of file helpers.c.

References AL_NO_ERROR, AL_OUT_OF_MEMORY, UIntMap::array, UIntMap::key, UIntMap::limit, UIntMap::lock, low, UIntMap::maxsize, memmove, NULL, realloc, UIntMap::size, UIntMap::value, WriteLock(), and WriteUnlock().

Referenced by alGenAuxiliaryEffectSlots(), alGenBuffers(), alGenEffects(), alGenFilters(), and alGenSources().

void LeaveCriticalSection | ( | CRITICAL_SECTION * | cs | ) |

Definition at line 365 of file helpers.c.

References assert, and ret.

Referenced by ALCdevice_UnlockDefault(), ReadRingBuffer(), RingBufferSize(), UnlockLists(), and WriteRingBuffer().

static void Lock | ( | volatile ALenum * | l | ) |

static

Definition at line 495 of file helpers.c.

References AL_TRUE.

Referenced by DECLARE_INTERFACE_(), ReadLock(), WriteLock(), and SDL_BWin::~SDL_BWin().

ALvoid* LookupUIntMapKey | ( | UIntMap * | map,
|  | ALuint | key
| ) |  |

Definition at line 653 of file helpers.c.

References UIntMap::array, UIntMap::key, UIntMap::lock, low, NULL, ReadLock(), ReadUnlock(), UIntMap::size, and UIntMap::value.

void ReadLock | ( | RWLock * | lock | ) |

Definition at line 515 of file helpers.c.

References Lock(), RWLock::read_count, RWLock::read_entry_lock, RWLock::read_lock, Unlock(), and RWLock::write_lock.

Referenced by alGetBufferf(), alGetBufferi(), alGetBufferiv(), alGetBufferSamplesSOFT(), alSourceQueueBuffers(), FreeThunkEntry(), LockUIntMapRead(), LookupUIntMapKey(), NewThunkEntry(), and SetSourceiv().

void ReadUnlock | ( | RWLock * | lock | ) |

Definition at line 525 of file helpers.c.

References RWLock::read_count, Unlock(), and RWLock::write_lock.

Referenced by alGetBufferf(), alGetBufferi(), alGetBufferiv(), alGetBufferSamplesSOFT(), alSourceQueueBuffers(), FreeThunkEntry(), LookupUIntMapKey(), NewThunkEntry(), SetSourceiv(), and UnlockUIntMapRead().

ALvoid* RemoveUIntMapKey | ( | UIntMap * | map,
|  | ALuint | key
| ) |  |

Definition at line 624 of file helpers.c.

References UIntMap::array, UIntMap::key, UIntMap::lock, low, memmove, NULL, UIntMap::size, UIntMap::value, WriteLock(), and WriteUnlock().

void ResetUIntMap | ( | UIntMap * | map | ) |

Definition at line 555 of file helpers.c.

References UIntMap::array, free, UIntMap::lock, UIntMap::maxsize, NULL, UIntMap::size, WriteLock(), and WriteUnlock().

Referenced by FreeContext(), and FreeDevice().

void RestoreFPUMode | ( | const FPUCtl * | ctl | ) |

Definition at line 235 of file helpers.c.

References CPU_CAP_SSE, CPUCapFlags, NULL, and FPUCtl::state.

Referenced by alDeferUpdatesSOFT(), aluMixData(), InitializeEffect(), and UpdateDeviceParams().

void RWLockInit | ( | RWLock * | lock | ) |

Definition at line 506 of file helpers.c.

References AL_FALSE, RWLock::read_count, RWLock::read_entry_lock, RWLock::read_lock, RWLock::write_count, and RWLock::write_lock.

Referenced by alGenBuffers(), InitUIntMap(), and ThunkInit().

void SetMixerFPUMode | ( | FPUCtl * | ctl | ) |

Definition at line 193 of file helpers.c.

References CPU_CAP_SSE, CPUCapFlags, NULL, and FPUCtl::state.

Referenced by alDeferUpdatesSOFT(), aluMixData(), InitializeEffect(), and UpdateDeviceParams().

void SetRTPriority | ( | void |  | ) |

Definition at line 470 of file helpers.c.

References AL_FALSE, ERR, and RTPrioLevel.

Referenced by ALSANoMMapProc(), ALSAProc(), DSoundPlaybackProc(), MMDevApiProc(), OSSCaptureProc(), OSSProc(), PlaybackThreadProc(), sndio_proc(), and SolarisProc().

void Sleep | ( | ALuint | t | ) |

Definition at line 406 of file helpers.c.

ALuint timeGetTime | ( | void |  | ) |

Definition at line 376 of file helpers.c.

References assert, NULL, and ret.

Referenced by NullProc(), and WaveProc().

static void Unlock | ( | volatile ALenum * | l | ) |

static

Definition at line 501 of file helpers.c.

References AL_FALSE.

Referenced by DECLARE_INTERFACE_(), ReadLock(), ReadUnlock(), WriteUnlock(), and SDL_BWin::~SDL_BWin().

void WriteLock | ( | RWLock * | lock | ) |

Definition at line 531 of file helpers.c.

References Lock(), RWLock::read_lock, RWLock::write_count, and RWLock::write_lock.

Referenced by alBufferiv(), alBufferSubDataSOFT(), alBufferSubSamplesSOFT(), InsertUIntMapEntry(), LoadData(), LockUIntMapWrite(), NewThunkEntry(), RemoveUIntMapKey(), and ResetUIntMap().

void WriteUnlock | ( | RWLock * | lock | ) |

Definition at line 538 of file helpers.c.

References RWLock::read_lock, Unlock(), RWLock::write_count, and RWLock::write_lock.

Referenced by alBufferiv(), alBufferSubDataSOFT(), alBufferSubSamplesSOFT(), InsertUIntMapEntry(), LoadData(), NewThunkEntry(), RemoveUIntMapKey(), ResetUIntMap(), and UnlockUIntMapWrite().

## Variable Documentation

ALuint CPUCapFlags = 0

OpenAL cross platform audio library Copyright (C) 2011 by authors. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html

Definition at line 70 of file helpers.c.

Referenced by alcOpenDevice(), FillCPUCaps(), RestoreFPUMode(), SelectDirectMixer(), SelectHrtfMixer(), SelectSendMixer(), SetMixerFPUMode(), and UpdateDeviceParams().