xine-lib: xine-lib-1.2.13/src/audio_out/audio_coreaudio_out.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions | Variables
audio_coreaudio_out.c File Reference
`#include <stdio.h>`
`#include <errno.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include <fcntl.h>`
`#include <math.h>`
`#include <unistd.h>`
`#include <inttypes.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/audio_out.h>`
`#include <CoreAudio/CoreAudio.h>`
`#include <CoreAudio/CoreAudioTypes.h>`
`#include <AudioUnit/AUComponent.h>`
`#include <AudioUnit/AudioUnitProperties.h>`
`#include <AudioUnit/AudioUnitParameters.h>`
`#include <AudioUnit/AudioOutputUnit.h>`
`#include <CoreServices/CoreServices.h>`

## Data Structures
struct | coreaudio_driver_s
struct | coreaudio_class_t

## Macros
#define | AO_OUT_COREAUDIO_IFACE_VERSION 9
#define | GAP_TOLERANCE AO_MAX_GAP
#define | BUFSIZE 30720
#define | BUFFER_TIMEOUT 1

## Typedefs
typedef struct coreaudio_driver_s | coreaudio_driver_t

## Functions
void | set_to_future (struct timespec *spec)
static OSStatus | ao_coreaudio_render_proc (coreaudio_driver_t *this, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, unsigned int inBusNumber, unsigned int inNumberFrames, AudioBufferList *ioData)
static int | ao_coreaudio_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode)
static int | ao_coreaudio_num_channels (ao_driver_t *this_gen)
static int | ao_coreaudio_bytes_per_frame (ao_driver_t *this_gen)
static int | ao_coreaudio_get_gap_tolerance (ao_driver_t *this_gen)
static int | ao_coreaudio_write (ao_driver_t *this_gen, int16_t *data, uint32_t num_frames)
static int | ao_coreaudio_delay (ao_driver_t *this_gen)
static void | ao_coreaudio_close (ao_driver_t *this_gen)
static uint32_t | ao_coreaudio_get_capabilities (ao_driver_t *this_gen)
static void | ao_coreaudio_exit (ao_driver_t *this_gen)
static int | ao_coreaudio_get_property (ao_driver_t *this_gen, int property)
static int | ao_coreaudio_set_property (ao_driver_t *this_gen, int property, int value)
static int | ao_coreaudio_ctrl (ao_driver_t *this_gen, int cmd,...)
static ao_driver_t * | open_plugin (audio_driver_class_t *class_gen, const void *data)
static void * | init_class (xine_t *xine, const void *data)

## Variables
static const ao_info_t | ao_info_coreaudio
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ AO_OUT_COREAUDIO_IFACE_VERSION

#define AO_OUT_COREAUDIO_IFACE_VERSION 9

## ◆ BUFFER_TIMEOUT

#define BUFFER_TIMEOUT 1

Referenced by set_to_future().

## ◆ BUFSIZE

#define BUFSIZE 30720

Referenced by ao_coreaudio_render_proc(), and ao_coreaudio_write().

## ◆ GAP_TOLERANCE

#define GAP_TOLERANCE AO_MAX_GAP

Referenced by ao_coreaudio_get_gap_tolerance().

## Typedef Documentation

## ◆ coreaudio_driver_t

typedef struct coreaudio_driver_s coreaudio_driver_t

## Function Documentation

## ◆ ao_coreaudio_bytes_per_frame()

static int ao_coreaudio_bytes_per_frame | ( | ao_driver_t * | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ ao_coreaudio_close()

static void ao_coreaudio_close | ( | ao_driver_t * | this_gen | ) |
| static

References NULL.

Referenced by ao_coreaudio_exit(), and open_plugin().

## ◆ ao_coreaudio_ctrl()

static int ao_coreaudio_ctrl | ( | ao_driver_t * | this_gen,
|  | int | cmd,
|  |  | ... )
| static

References AO_CTRL_FLUSH_BUFFERS, AO_CTRL_PLAY_PAUSE, and AO_CTRL_PLAY_RESUME.

Referenced by open_plugin().

## ◆ ao_coreaudio_delay()

static int ao_coreaudio_delay | ( | ao_driver_t * | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ ao_coreaudio_exit()

static void ao_coreaudio_exit | ( | ao_driver_t * | this_gen | ) |
| static

References ao_coreaudio_close().

Referenced by open_plugin().

## ◆ ao_coreaudio_get_capabilities()

static uint32_t ao_coreaudio_get_capabilities | ( | ao_driver_t * | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ ao_coreaudio_get_gap_tolerance()

static int ao_coreaudio_get_gap_tolerance | ( | ao_driver_t * | this_gen | ) |
| static

References GAP_TOLERANCE.

Referenced by open_plugin().

## ◆ ao_coreaudio_get_property()

static int ao_coreaudio_get_property | ( | ao_driver_t * | this_gen,
|  | int | property )
| static

References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, and AO_PROP_PCM_VOL.

Referenced by open_plugin().

## ◆ ao_coreaudio_num_channels()

static int ao_coreaudio_num_channels | ( | ao_driver_t * | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ ao_coreaudio_open()

static int ao_coreaudio_open | ( | ao_driver_t * | this_gen,
|  | uint32_t | bits,
|  | uint32_t | rate,
|  | int | mode )
| static

References AO_CAP_16BITS, AO_CAP_MIXER_VOL, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, ao_coreaudio_render_proc(), bits, input(), mode(), NULL, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by open_plugin().

## ◆ ao_coreaudio_render_proc()

static OSStatus ao_coreaudio_render_proc | ( | coreaudio_driver_t * | this,
|  | AudioUnitRenderActionFlags * | ioActionFlags,
|  | const AudioTimeStamp * | inTimeStamp,
|  | unsigned int | inBusNumber,
|  | unsigned int | inNumberFrames,
|  | AudioBufferList * | ioData )
| static

References BUFSIZE, set_to_future(), and xine_fast_memcpy.

Referenced by ao_coreaudio_open().

## ◆ ao_coreaudio_set_property()

static int ao_coreaudio_set_property | ( | ao_driver_t * | this_gen,
|  | int | property,
|  | int | value )
| static

References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, and AO_PROP_PCM_VOL.

Referenced by open_plugin().

## ◆ ao_coreaudio_write()

static int ao_coreaudio_write | ( | ao_driver_t * | this_gen,
|  | int16_t * | data,
|  | uint32_t | num_frames )
| static

References BUFSIZE, set_to_future(), and xine_fast_memcpy.

Referenced by open_plugin().

## ◆ init_class()

static void * init_class | ( | xine_t * | xine,
|  | const void * | data )
| static

References default_audio_driver_class_dispose, audio_driver_class_s::description, audio_driver_class_s::dispose, coreaudio_class_t::driver_class, audio_driver_class_s::identifier, lprintf, N_, NULL, audio_driver_class_s::open_plugin, open_plugin(), and coreaudio_class_t::xine.

## ◆ open_plugin()

static ao_driver_t * open_plugin | ( | audio_driver_class_t * | class_gen,
|  | const void * | data )
| static

References AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, ao_coreaudio_bytes_per_frame(), ao_coreaudio_close(), ao_coreaudio_ctrl(), ao_coreaudio_delay(), ao_coreaudio_exit(), ao_coreaudio_get_capabilities(), ao_coreaudio_get_gap_tolerance(), ao_coreaudio_get_property(), ao_coreaudio_num_channels(), ao_coreaudio_open(), ao_coreaudio_set_property(), ao_coreaudio_write(), lprintf, NULL, and coreaudio_class_t::xine.

Referenced by init_class().

## ◆ set_to_future()

void set_to_future | ( | struct timespec * | spec | ) |
| inline

References BUFFER_TIMEOUT, and NULL.

Referenced by ao_coreaudio_render_proc(), and ao_coreaudio_write().

## Variable Documentation

## ◆ ao_info_coreaudio

const ao_info_t ao_info_coreaudio
| static

Initial value:
= {
.priority = 1,
}

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_AUDIO_OUT, 9 , "coreaudio", XINE_VERSION_CODE, &ao_info_coreaudio, init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
init_class
static void * init_class(xine_t *xine, const void *data)
Definition audio_coreaudio_out.c:562
ao_info_coreaudio
static const ao_info_t ao_info_coreaudio
Definition audio_coreaudio_out.c:582
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
NULL
Definition xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition xine_plugin.h:29
PLUGIN_AUDIO_OUT
#define PLUGIN_AUDIO_OUT
Definition xine_plugin.h:35