zenilib: zenilib/jni/external/openal-soft/Alc/backends/oss.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
oss.c File Reference
`#include "config.h"`
`#include <sys/ioctl.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include <stdlib.h>`
`#include <stdio.h>`
`#include <memory.h>`
`#include <unistd.h>`
`#include <errno.h>`
`#include <math.h>`
`#include "alMain.h"`
`#include "alu.h"`
`#include <sys/soundcard.h>`

Go to the source code of this file.

## Macros

#define | CHECKERR(func)
#define | CHECKERR(func)
#define | SOUND_MIXER_READ MIXER_READ
#define | SOUND_MIXER_WRITE MIXER_WRITE

## Functions

void | alc_oss_deinit (void)
ALCboolean | alc_oss_init (BackendFuncs *func_list)
void | alc_oss_probe (enum DevProbe type)
static int | log2i (ALCuint x)
static ALCuint | oss_available_samples (ALCdevice *Device)
static ALCenum | oss_capture_samples (ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples)
static void | oss_close_capture (ALCdevice *device)
static void | oss_close_playback (ALCdevice *device)
static ALCenum | oss_open_capture (ALCdevice *device, const ALCchar *deviceName)
static ALCenum | oss_open_playback (ALCdevice *device, const ALCchar *deviceName)
static ALCboolean | oss_reset_playback (ALCdevice *device)
static void | oss_start_capture (ALCdevice *Device)
static ALCboolean | oss_start_playback (ALCdevice *device)
static void | oss_stop_capture (ALCdevice *Device)
static void | oss_stop_playback (ALCdevice *device)
static ALuint | OSSCaptureProc (ALvoid *ptr)
static ALuint | OSSProc (ALvoid *ptr)

## Variables

static const char * | oss_capture = "/dev/dsp"
static const ALCchar | oss_device [] = "OSS Default"
static const char * | oss_driver = "/dev/dsp"
static const BackendFuncs | oss_funcs

## Macro Definition Documentation

#define CHECKERR | ( |  | func | ) |

Value:
if((func) < 0) { \
err = #func; \
goto err; \
}
func
GLenum func
Definition: SDL_opengl.h:5654

Referenced by oss_open_capture(), and oss_reset_playback().

#define CHECKERR | ( |  | func | ) |

Value:
if((func) < 0) { \
err = #func; \
goto err; \
}
func
GLenum func
Definition: SDL_opengl.h:5654

#define SOUND_MIXER_READ MIXER_READ

OpenAL cross platform audio library Copyright (C) 1999-2007 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 44 of file oss.c.

#define SOUND_MIXER_WRITE MIXER_WRITE

Definition at line 47 of file oss.c.

## Function Documentation

void alc_oss_deinit | ( | void |  | ) |

Definition at line 509 of file oss.c.

ALCboolean alc_oss_init | ( | BackendFuncs * | func_list | ) |

Definition at line 500 of file oss.c.

References ALC_TRUE, ConfigValueStr(), oss_capture, oss_driver, and oss_funcs.

void alc_oss_probe | ( | enum DevProbe | type | ) |

Definition at line 513 of file oss.c.

References ALL_DEVICE_PROBE, AppendAllDevicesList(), AppendCaptureDeviceList(), CAPTURE_DEVICE_PROBE, oss_capture, oss_device, and oss_driver.

static int log2i | ( | ALCuint | x | ) |

static

Definition at line 68 of file oss.c.

Referenced by oss_open_capture(), and oss_reset_playback().

static ALCuint oss_available_samples | ( | ALCdevice * | Device | ) |

static

Definition at line 476 of file oss.c.

References ALCdevice_struct::ExtraData, and RingBufferSize().

static ALCenum oss_capture_samples | ( | ALCdevice * | Device,
|  | ALCvoid * | pBuffer,
|  | ALCuint | lSamples
| ) |  |

static

Definition at line 469 of file oss.c.

References ALC_NO_ERROR, ALCdevice_struct::ExtraData, and ReadRingBuffer().

static void oss_close_capture | ( | ALCdevice * | device | ) |

static

Definition at line 442 of file oss.c.

References DestroyRingBuffer(), ALCdevice_struct::ExtraData, free, NULL, and StopThread().

static void oss_close_playback | ( | ALCdevice * | device | ) |

static

Definition at line 182 of file oss.c.

References ALCdevice_struct::ExtraData, free, and NULL.

static ALCenum oss_open_capture | ( | ALCdevice * | device,
|  | const ALCchar * | deviceName
| ) |  |

static

Definition at line 318 of file oss.c.

References ALC_INVALID_VALUE, ALC_NO_ERROR, ALC_OUT_OF_MEMORY, BytesFromDevFmt(), calloc, ChannelsFromDevFmt(), CHECKERR, CreateRingBuffer(), DevFmtByte, DevFmtChannelsString(), DevFmtFloat, DevFmtInt, DevFmtShort, DevFmtTypeString(), DevFmtUByte, DevFmtUInt, DevFmtUShort, ALCdevice_struct::DeviceName, ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, free, ALCdevice_struct::Frequency, log2i(), NULL, ALCdevice_struct::NumUpdates, oss_capture, oss_device, OSSCaptureProc(), StartThread(), strdup(), and ALCdevice_struct::UpdateSize.

static ALCenum oss_open_playback | ( | ALCdevice * | device,
|  | const ALCchar * | deviceName
| ) |  |

static

Definition at line 157 of file oss.c.

References ALC_INVALID_VALUE, ALC_NO_ERROR, calloc, ALCdevice_struct::DeviceName, ERR, ALCdevice_struct::ExtraData, free, oss_device, oss_driver, and strdup().

static ALCboolean oss_reset_playback | ( | ALCdevice * | device | ) |

static

Definition at line 191 of file oss.c.

References ALC_FALSE, ALC_TRUE, BytesFromDevFmt(), ChannelsFromDevFmt(), CHECKERR, DevFmtByte, DevFmtChannelsString(), DevFmtFloat, DevFmtInt, DevFmtShort, DevFmtTypeString(), DevFmtUByte, DevFmtUInt, DevFmtUShort, ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, ALCdevice_struct::Frequency, log2i(), ALCdevice_struct::NumUpdates, SetDefaultChannelOrder(), and ALCdevice_struct::UpdateSize.

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

static

Definition at line 457 of file oss.c.

References ALCdevice_struct::ExtraData.

static ALCboolean oss_start_playback | ( | ALCdevice * | device | ) |

static

Definition at line 280 of file oss.c.

References ALC_FALSE, ALC_TRUE, calloc, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), free, NULL, OSSProc(), StartThread(), and ALCdevice_struct::UpdateSize.

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

static

Definition at line 463 of file oss.c.

References ALCdevice_struct::ExtraData.

static void oss_stop_playback | ( | ALCdevice * | device | ) |

static

Definition at line 298 of file oss.c.

References ERR, ALCdevice_struct::ExtraData, free, NULL, and StopThread().

static ALuint OSSCaptureProc | ( | ALvoid * | ptr | ) |

static

Definition at line 123 of file oss.c.

References ALCdevice_Lock, ALCdevice_Unlock, aluHandleDisconnect(), ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), SetRTPriority(), Sleep, and WriteRingBuffer().

Referenced by oss_open_capture().

static ALuint OSSProc | ( | ALvoid * | ptr | ) |

static

Definition at line 80 of file oss.c.

References ALCdevice_Lock, ALCdevice_Unlock, aluHandleDisconnect(), aluMixData(), ALCdevice_struct::Connected, ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), SetRTPriority(), and Sleep.

Referenced by oss_start_playback().

## Variable Documentation

const char* oss_capture = "/dev/dsp"

static

Definition at line 53 of file oss.c.

Referenced by alc_oss_init(), alc_oss_probe(), and oss_open_capture().

const ALCchar oss_device[] = "OSS Default"

static

Definition at line 50 of file oss.c.

Referenced by alc_oss_probe(), oss_open_capture(), and oss_open_playback().

const char* oss_driver = "/dev/dsp"

static

Definition at line 52 of file oss.c.

Referenced by alc_oss_init(), alc_oss_probe(), and oss_open_playback().

const BackendFuncs oss_funcs

static

Initial value:
= {
oss_open_playback,
oss_close_playback,
oss_reset_playback,
oss_start_playback,
oss_stop_playback,
oss_open_capture,
oss_close_capture,
oss_start_capture,
oss_stop_capture,
oss_capture_samples,
oss_available_samples,
ALCdevice_LockDefault,
ALCdevice_UnlockDefault,
ALCdevice_GetLatencyDefault
}
oss_start_playback
static ALCboolean oss_start_playback(ALCdevice *device)
Definition: oss.c:280
ALCdevice_GetLatencyDefault
ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device)
Definition: ALc.c:1285
oss_open_capture
static ALCenum oss_open_capture(ALCdevice *device, const ALCchar *deviceName)
Definition: oss.c:318
oss_stop_playback
static void oss_stop_playback(ALCdevice *device)
Definition: oss.c:298
oss_close_playback
static void oss_close_playback(ALCdevice *device)
Definition: oss.c:182
ALCdevice_LockDefault
void ALCdevice_LockDefault(ALCdevice *device)
Definition: ALc.c:1277
oss_stop_capture
static void oss_stop_capture(ALCdevice *Device)
Definition: oss.c:463
oss_open_playback
static ALCenum oss_open_playback(ALCdevice *device, const ALCchar *deviceName)
Definition: oss.c:157
oss_reset_playback
static ALCboolean oss_reset_playback(ALCdevice *device)
Definition: oss.c:191
oss_start_capture
static void oss_start_capture(ALCdevice *Device)
Definition: oss.c:457
oss_close_capture
static void oss_close_capture(ALCdevice *device)
Definition: oss.c:442
ALCdevice_UnlockDefault
void ALCdevice_UnlockDefault(ALCdevice *device)
Definition: ALc.c:1281
oss_capture_samples
static ALCenum oss_capture_samples(ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples)
Definition: oss.c:469
oss_available_samples
static ALCuint oss_available_samples(ALCdevice *Device)
Definition: oss.c:476

Definition at line 483 of file oss.c.

Referenced by alc_oss_init().