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

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions | Variables
audio_sun_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 <sys/audioio.h>`
`#include <sys/uio.h>`
`#include <sys/ioctl.h>`
`#include <inttypes.h>`
`#include <sys/param.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/audio_out.h>`

## Data Structures
struct | sun_class_t
struct | sun_driver_s

## Macros
#define | AUDIO_CHANNELS_MONO 1
#define | AUDIO_CHANNELS_STEREO 2
#define | AUDIO_PRECISION_8 8
#define | AUDIO_PRECISION_16 16
#define | AO_SUN_IFACE_VERSION 9
#define | GAP_TOLERANCE 5000
#define | GAP_NONRT_TOLERANCE AO_MAX_GAP
#define | NOT_REAL_TIME -1

## Typedefs
typedef struct sun_driver_s | sun_driver_t

## Functions
static int | realtime_samplecounter_available (xine_t *xine, char *dev)
static int | find_close_samplerate_match (int dev, int sample_rate)
static int | find_highest_samplerate (int dev)
static int | ao_sun_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode)
static int | ao_sun_num_channels (ao_driver_t *this_gen)
static int | ao_sun_bytes_per_frame (ao_driver_t *this_gen)
static int | ao_sun_delay (ao_driver_t *this_gen)
static int | ao_sun_get_gap_tolerance (ao_driver_t *this_gen)
static int | sun_audio_write (sun_driver_t *this, char *buf, unsigned nbytes)
static void | sun_audio_flush (sun_driver_t *this)
static int | ao_sun_write (ao_driver_t *this_gen, int16_t *data, uint32_t num_frames)
static void | ao_sun_close (ao_driver_t *this_gen)
static uint32_t | ao_sun_get_capabilities (ao_driver_t *this_gen)
static void | ao_sun_exit (ao_driver_t *this_gen)
static int | ao_sun_get_property (ao_driver_t *this_gen, int property)
static int | ao_sun_set_property (ao_driver_t *this_gen, int property, int value)
static int | ao_sun_ctrl (ao_driver_t *this_gen, int cmd,...)
static ao_driver_t * | ao_sun_open_plugin (audio_driver_class_t *class_gen, const void *data)
static void * | ao_sun_init_class (xine_t *xine, const void *data)

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

## Macro Definition Documentation

## ◆ AO_SUN_IFACE_VERSION

#define AO_SUN_IFACE_VERSION 9

## ◆ AUDIO_CHANNELS_MONO

#define AUDIO_CHANNELS_MONO 1

Referenced by ao_sun_open().

## ◆ AUDIO_CHANNELS_STEREO

#define AUDIO_CHANNELS_STEREO 2

Referenced by ao_sun_open(), and realtime_samplecounter_available().

## ◆ AUDIO_PRECISION_16

#define AUDIO_PRECISION_16 16

Referenced by ao_sun_open_plugin(), and realtime_samplecounter_available().

## ◆ AUDIO_PRECISION_8

#define AUDIO_PRECISION_8 8

## ◆ GAP_NONRT_TOLERANCE

#define GAP_NONRT_TOLERANCE AO_MAX_GAP

Referenced by ao_sun_get_gap_tolerance().

## ◆ GAP_TOLERANCE

#define GAP_TOLERANCE 5000

Referenced by ao_sun_get_gap_tolerance().

## ◆ NOT_REAL_TIME

#define NOT_REAL_TIME -1

Referenced by ao_sun_delay().

## Typedef Documentation

## ◆ sun_driver_t

typedef struct sun_driver_s sun_driver_t

## Function Documentation

## ◆ ao_sun_bytes_per_frame()

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

Referenced by ao_sun_open_plugin().

## ◆ ao_sun_close()

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

References sun_audio_flush().

Referenced by ao_sun_open_plugin().

## ◆ ao_sun_ctrl()

static int ao_sun_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 ao_sun_open_plugin().

## ◆ ao_sun_delay()

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

References abs, NOT_REAL_TIME, NULL, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by ao_sun_open_plugin(), and ao_sun_write().

## ◆ ao_sun_exit()

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

Referenced by ao_sun_open_plugin().

## ◆ ao_sun_get_capabilities()

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

Referenced by ao_sun_open_plugin().

## ◆ ao_sun_get_gap_tolerance()

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

References GAP_NONRT_TOLERANCE, and GAP_TOLERANCE.

Referenced by ao_sun_open_plugin().

## ◆ ao_sun_get_property()

static int ao_sun_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 ao_sun_open_plugin().

## ◆ ao_sun_init_class()

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

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

## ◆ ao_sun_num_channels()

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

Referenced by ao_sun_open_plugin().

## ◆ ao_sun_open()

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

References _, AO_CAP_MODE_STEREO, AUDIO_CHANNELS_MONO, AUDIO_CHANNELS_STEREO, bits, find_close_samplerate_match(), find_highest_samplerate(), mode(), xine_open_cloexec(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by ao_sun_open_plugin().

## ◆ ao_sun_open_plugin()

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

References _, AO_CAP_16BITS, AO_CAP_8BITS, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, AO_CAP_MUTE_VOL, AO_CAP_PCM_VOL, AO_PROP_MIXER_VOL, ao_sun_bytes_per_frame(), ao_sun_close(), ao_sun_ctrl(), ao_sun_delay(), ao_sun_exit(), ao_sun_get_capabilities(), ao_sun_get_gap_tolerance(), ao_sun_get_property(), ao_sun_num_channels(), ao_sun_open(), ao_sun_set_property(), ao_sun_write(), AUDIO_PRECISION_16, xine_s::config, NULL, realtime_samplecounter_available(), config_values_s::xine, sun_class_t::xine, XINE_CONFIG_SECURITY, XINE_CONFIG_STRING_IS_DEVICE_NAME, xine_open_cloexec(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by ao_sun_init_class().

## ◆ ao_sun_set_property()

static int ao_sun_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 ao_sun_open_plugin().

## ◆ ao_sun_write()

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

References ao_sun_delay(), and sun_audio_write().

Referenced by ao_sun_open_plugin().

## ◆ find_close_samplerate_match()

static int find_close_samplerate_match | ( | int | dev,
|  | int | sample_rate )
| static

References abs.

Referenced by ao_sun_open().

## ◆ find_highest_samplerate()

static int find_highest_samplerate | ( | int | dev | ) |
| static

Referenced by ao_sun_open().

## ◆ realtime_samplecounter_available()

static int realtime_samplecounter_available | ( | xine_t * | xine,
|  | char * | dev )
| static

References AUDIO_CHANNELS_STEREO, AUDIO_PRECISION_16, NULL, silence(), xine_open_cloexec(), XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by ao_sun_open_plugin().

## ◆ sun_audio_flush()

static void sun_audio_flush | ( | sun_driver_t * | this | ) |
| static

Referenced by ao_sun_close().

## ◆ sun_audio_write()

static int sun_audio_write | ( | sun_driver_t * | this,
|  | char * | buf,
|  | unsigned | nbytes )
| static

Referenced by ao_sun_write().

## Variable Documentation

## ◆ ao_info_sun

const ao_info_t ao_info_sun
| static

Initial value:
= {
.priority = 10,
}

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_AUDIO_OUT, 9 , "sun", XINE_VERSION_CODE, &ao_info_sun, ao_sun_init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
ao_sun_init_class
static void * ao_sun_init_class(xine_t *xine, const void *data)
Definition audio_sun_out.c:1014
ao_info_sun
static const ao_info_t ao_info_sun
Definition audio_sun_out.c:1032
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