zenilib: zenilib/jni/external/openal-soft/Alc/backends/coreaudio.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
coreaudio.c File Reference
`#include "config.h"`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "alMain.h"`
`#include "alu.h"`
`#include <CoreServices/CoreServices.h>`
`#include <unistd.h>`
`#include <AudioUnit/AudioUnit.h>`
`#include <AudioToolbox/AudioToolbox.h>`

Go to the source code of this file.

## Functions

void | alc_ca_deinit (void)
ALCboolean | alc_ca_init (BackendFuncs *func_list)
void | alc_ca_probe (enum DevProbe type)
static AudioBufferList * | allocate_buffer_list (UInt32 channelCount, UInt32 byteSize)
static ALCuint | ca_available_samples (ALCdevice *device)
static OSStatus | ca_callback (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
static OSStatus | ca_capture_callback (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
static OSStatus | ca_capture_conversion_callback (AudioConverterRef inAudioConverter, UInt32 *ioNumberDataPackets, AudioBufferList *ioData, AudioStreamPacketDescription **outDataPacketDescription, void *inUserData)
static ALCenum | ca_capture_samples (ALCdevice *device, ALCvoid *buffer, ALCuint samples)
static void | ca_close_capture (ALCdevice *device)
static void | ca_close_playback (ALCdevice *device)
static ALCenum | ca_open_capture (ALCdevice *device, const ALCchar *deviceName)
static ALCenum | ca_open_playback (ALCdevice *device, const ALCchar *deviceName)
static ALCboolean | ca_reset_playback (ALCdevice *device)
static void | ca_start_capture (ALCdevice *device)
static ALCboolean | ca_start_playback (ALCdevice *device)
static void | ca_stop_capture (ALCdevice *device)
static void | ca_stop_playback (ALCdevice *device)
static void | destroy_buffer_list (AudioBufferList *list)

## Variables

static const ALCchar | ca_device [] = "CoreAudio Default"
static const BackendFuncs | ca_funcs

## Function Documentation

void alc_ca_deinit | ( | void |  | ) |

Definition at line 691 of file coreaudio.c.

ALCboolean alc_ca_init | ( | BackendFuncs * | func_list | ) |

Definition at line 685 of file coreaudio.c.

References ALC_TRUE, and ca_funcs.

void alc_ca_probe | ( | enum DevProbe | type | ) |

Definition at line 695 of file coreaudio.c.

References ALL_DEVICE_PROBE, AppendAllDevicesList(), AppendCaptureDeviceList(), ca_device, and CAPTURE_DEVICE_PROBE.

static AudioBufferList* allocate_buffer_list | ( | UInt32 | channelCount,
|  | UInt32 | byteSize
| ) |  |

static

Definition at line 64 of file coreaudio.c.

References calloc, free, malloc, and NULL.

Referenced by ca_open_capture().

static ALCuint ca_available_samples | ( | ALCdevice * | device | ) |

static

Definition at line 661 of file coreaudio.c.

References ALCdevice_struct::ExtraData, and RingBufferSize().

static OSStatus ca_callback | ( | void * | inRefCon,
|  | AudioUnitRenderActionFlags * | ioActionFlags,
|  | const AudioTimeStamp * | inTimeStamp,
|  | UInt32 | inBusNumber,
|  | UInt32 | inNumberFrames,
|  | AudioBufferList * | ioData
| ) |  |

static

Definition at line 85 of file coreaudio.c.

References aluMixData(), and ALCdevice_struct::ExtraData.

Referenced by ca_reset_playback().

static OSStatus ca_capture_callback | ( | void * | inRefCon,
|  | AudioUnitRenderActionFlags * | ioActionFlags,
|  | const AudioTimeStamp * | inTimeStamp,
|  | UInt32 | inBusNumber,
|  | UInt32 | inNumberFrames,
|  | AudioBufferList * | ioData
| ) |  |

static

Definition at line 115 of file coreaudio.c.

References ERR, ALCdevice_struct::ExtraData, and WriteRingBuffer().

Referenced by ca_open_capture().

static OSStatus ca_capture_conversion_callback | ( | AudioConverterRef | inAudioConverter,
|  | UInt32 * | ioNumberDataPackets,
|  | AudioBufferList * | ioData,
|  | AudioStreamPacketDescription ** | outDataPacketDescription,
|  | void * | inUserData
| ) |  |

static

Definition at line 97 of file coreaudio.c.

References ALCdevice_struct::ExtraData, and ReadRingBuffer().

Referenced by ca_capture_samples().

static ALCenum ca_capture_samples | ( | ALCdevice * | device,
|  | ALCvoid * | buffer,
|  | ALCuint | samples
| ) |  |

static

Definition at line 629 of file coreaudio.c.

References ALC_INVALID_VALUE, ALC_NO_ERROR, ca_capture_conversion_callback(), ERR, ALCdevice_struct::ExtraData, and NULL.

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

static

Definition at line 598 of file coreaudio.c.

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

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

static

Definition at line 188 of file coreaudio.c.

References ALCdevice_struct::ExtraData, free, and NULL.

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

static

Definition at line 370 of file coreaudio.c.

References ALC_INVALID_VALUE, ALC_NO_ERROR, allocate_buffer_list(), ca_capture_callback(), calloc, comp(), CreateRingBuffer(), destroy_buffer_list(), DestroyRingBuffer(), DevFmtByte, DevFmtChannelsString(), DevFmtFloat, DevFmtInt, DevFmtMono, DevFmtQuad, DevFmtShort, DevFmtStereo, DevFmtTypeString(), DevFmtUByte, DevFmtUInt, DevFmtUShort, DevFmtX51, DevFmtX51Side, DevFmtX61, DevFmtX71, ERR, error, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), free, ALCdevice_struct::Frequency, malloc, NULL, ALCdevice_struct::NumUpdates, and ALCdevice_struct::UpdateSize.

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

static

Definition at line 137 of file coreaudio.c.

References ALC_INVALID_VALUE, ALC_NO_ERROR, ca_device, calloc, comp(), ALCdevice_struct::DeviceName, ERR, ALCdevice_struct::ExtraData, free, NULL, and strdup().

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

static

Definition at line 199 of file coreaudio.c.

References ALC_FALSE, ALC_TRUE, ca_callback(), DevFmtByte, DevFmtFloat, DevFmtInt, DevFmtMono, DevFmtQuad, DevFmtShort, DevFmtStereo, DevFmtUByte, DevFmtUInt, DevFmtUShort, DevFmtX51, DevFmtX61, DevFmtX71, ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), ALCdevice_struct::Frequency, SetDefaultWFXChannelOrder(), TRACE, and ALCdevice_struct::UpdateSize.

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

static

Definition at line 613 of file coreaudio.c.

References ERR, and ALCdevice_struct::ExtraData.

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

static

Definition at line 345 of file coreaudio.c.

References ALC_FALSE, ALC_TRUE, ERR, and ALCdevice_struct::ExtraData.

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

static

Definition at line 621 of file coreaudio.c.

References ERR, and ALCdevice_struct::ExtraData.

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

static

Definition at line 360 of file coreaudio.c.

References ERR, and ALCdevice_struct::ExtraData.

static void destroy_buffer_list | ( | AudioBufferList * | list | ) |

static

Definition at line 53 of file coreaudio.c.

References free, and i.

Referenced by ca_close_capture(), and ca_open_capture().

## Variable Documentation

const ALCchar ca_device[] = "CoreAudio Default"

static

Definition at line 50 of file coreaudio.c.

Referenced by alc_ca_probe(), and ca_open_playback().

const BackendFuncs ca_funcs

static

Initial value:
= {
ca_open_playback,
ca_close_playback,
ca_reset_playback,
ca_start_playback,
ca_stop_playback,
ca_open_capture,
ca_close_capture,
ca_start_capture,
ca_stop_capture,
ca_capture_samples,
ca_available_samples,
ALCdevice_LockDefault,
ALCdevice_UnlockDefault,
ALCdevice_GetLatencyDefault
}
ca_open_capture
static ALCenum ca_open_capture(ALCdevice *device, const ALCchar *deviceName)
Definition: coreaudio.c:370
ca_available_samples
static ALCuint ca_available_samples(ALCdevice *device)
Definition: coreaudio.c:661
ca_close_capture
static void ca_close_capture(ALCdevice *device)
Definition: coreaudio.c:598
ALCdevice_GetLatencyDefault
ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device)
Definition: ALc.c:1285
ca_reset_playback
static ALCboolean ca_reset_playback(ALCdevice *device)
Definition: coreaudio.c:199
ca_stop_playback
static void ca_stop_playback(ALCdevice *device)
Definition: coreaudio.c:360
ca_start_capture
static void ca_start_capture(ALCdevice *device)
Definition: coreaudio.c:613
ca_stop_capture
static void ca_stop_capture(ALCdevice *device)
Definition: coreaudio.c:621
ca_open_playback
static ALCenum ca_open_playback(ALCdevice *device, const ALCchar *deviceName)
Definition: coreaudio.c:137
ALCdevice_LockDefault
void ALCdevice_LockDefault(ALCdevice *device)
Definition: ALc.c:1277
ca_start_playback
static ALCboolean ca_start_playback(ALCdevice *device)
Definition: coreaudio.c:345
ca_close_playback
static void ca_close_playback(ALCdevice *device)
Definition: coreaudio.c:188
ca_capture_samples
static ALCenum ca_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint samples)
Definition: coreaudio.c:629
ALCdevice_UnlockDefault
void ALCdevice_UnlockDefault(ALCdevice *device)
Definition: ALc.c:1281

Definition at line 668 of file coreaudio.c.

Referenced by alc_ca_init().