xine-lib: xine-lib-1.2.12/src/audio_out/audio_oss_out.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Typedefs | Functions | Variables
audio_oss_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/ioctl.h>`
`#include <inttypes.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/compat.h>`
`#include <xine/audio_out.h>`
`#include <sys/time.h>`
`#include "speakers.h"`

## Data Structures
struct | oss_driver_s
struct | oss_class_t

## Macros
#define | LOG_MODULE "audio_oss_out"
#define | LOG_VERBOSE
#define | SNDCTL_DSP_SETFMT SOUND_PCM_SETFMT
#define | SNDCTL_DSP_SPEED SOUND_PCM_WRITE_RATE
#define | AFMT_S16_NE AFMT_S16_LE
#define | AFMT_AC3 0x00000400
#define | AO_OUT_OSS_IFACE_VERSION 9
#define | AUDIO_NUM_FRAGMENTS 15
#define | AUDIO_FRAGMENT_SIZE 8192
#define | ZERO_BUF_SIZE 15360
#define | GAP_TOLERANCE 5000
#define | MAX_GAP 90000
#define | OSS_SYNC_AUTO_DETECT 0
#define | OSS_SYNC_GETODELAY 1
#define | OSS_SYNC_GETOPTR 2
#define | OSS_SYNC_SOFTSYNC 3
#define | OSS_SYNC_PROBEBUFFER 4

## Typedefs
typedef struct oss_driver_s | oss_driver_t

## Functions
static int | ao_oss_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode)
static int | ao_oss_num_channels (ao_driver_t *this_gen)
static int | ao_oss_bytes_per_frame (ao_driver_t *this_gen)
static int | ao_oss_get_gap_tolerance (ao_driver_t *this_gen)
static int | ao_oss_delay (ao_driver_t *this_gen)
static int | ao_oss_write (ao_driver_t *this_gen, int16_t *frame_buffer, uint32_t num_frames)
static void | ao_oss_close (ao_driver_t *this_gen)
static uint32_t | ao_oss_get_capabilities (ao_driver_t *this_gen)
static void | ao_oss_exit (ao_driver_t *this_gen)
static int | ao_oss_get_property (ao_driver_t *this_gen, int property)
static int | ao_oss_set_property (ao_driver_t *this_gen, int property, int value)
static int | ao_oss_ctrl (ao_driver_t *this_gen, int cmd,...)
static int | probe_audio_devices (oss_driver_t *this)
static void | oss_speaker_arrangement_cb (void *user_data, xine_cfg_entry_t *entry)
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_oss
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ AFMT_AC3

#define AFMT_AC3 0x00000400

## ◆ AFMT_S16_NE

#define AFMT_S16_NE AFMT_S16_LE

## ◆ AO_OUT_OSS_IFACE_VERSION

#define AO_OUT_OSS_IFACE_VERSION 9

## ◆ AUDIO_FRAGMENT_SIZE

#define AUDIO_FRAGMENT_SIZE 8192

## ◆ AUDIO_NUM_FRAGMENTS

#define AUDIO_NUM_FRAGMENTS 15

## ◆ GAP_TOLERANCE

#define GAP_TOLERANCE 5000

## ◆ LOG_MODULE

#define LOG_MODULE "audio_oss_out"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAX_GAP

#define MAX_GAP 90000

## ◆ OSS_SYNC_AUTO_DETECT

#define OSS_SYNC_AUTO_DETECT 0

## ◆ OSS_SYNC_GETODELAY

#define OSS_SYNC_GETODELAY 1

## ◆ OSS_SYNC_GETOPTR

#define OSS_SYNC_GETOPTR 2

## ◆ OSS_SYNC_PROBEBUFFER

#define OSS_SYNC_PROBEBUFFER 4

## ◆ OSS_SYNC_SOFTSYNC

#define OSS_SYNC_SOFTSYNC 3

## ◆ SNDCTL_DSP_SETFMT

#define SNDCTL_DSP_SETFMT SOUND_PCM_SETFMT

## ◆ SNDCTL_DSP_SPEED

#define SNDCTL_DSP_SPEED SOUND_PCM_WRITE_RATE

## ◆ ZERO_BUF_SIZE

#define ZERO_BUF_SIZE 15360

## Typedef Documentation

## ◆ oss_driver_t

typedef struct oss_driver_s oss_driver_t

## Function Documentation

## ◆ ao_oss_bytes_per_frame()

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

Referenced by open_plugin().

## ◆ ao_oss_close()

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

Referenced by ao_oss_ctrl(), and open_plugin().

## ◆ ao_oss_ctrl()

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

References AO_CTRL_FLUSH_BUFFERS, AO_CTRL_PLAY_PAUSE, AO_CTRL_PLAY_RESUME, ao_oss_close(), ao_oss_open(), lprintf, mode(), NULL, OSS_SYNC_GETOPTR, and OSS_SYNC_SOFTSYNC.

Referenced by open_plugin().

## ◆ ao_oss_delay()

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

References lprintf, NULL, OSS_SYNC_GETODELAY, OSS_SYNC_GETOPTR, OSS_SYNC_PROBEBUFFER, OSS_SYNC_SOFTSYNC, and xine_monotonic_clock().

Referenced by open_plugin().

## ◆ ao_oss_exit()

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

References NULL.

Referenced by open_plugin().

## ◆ ao_oss_get_capabilities()

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

Referenced by open_plugin().

## ◆ ao_oss_get_gap_tolerance()

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

References GAP_TOLERANCE.

Referenced by open_plugin().

## ◆ ao_oss_get_property()

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

References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, AO_PROP_PCM_VOL, IOCTL_REQUEST_TYPE, and v.

Referenced by open_plugin().

## ◆ ao_oss_num_channels()

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

Referenced by open_plugin().

## ◆ ao_oss_open()

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

References _, AFMT_AC3, AFMT_S16_NE, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, AO_CAP_MODE_A52, AO_CAP_MODE_AC5, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, bits, lprintf, mode(), SNDCTL_DSP_SETFMT, SNDCTL_DSP_SPEED, xine_open_cloexec(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by ao_oss_ctrl(), and open_plugin().

## ◆ ao_oss_set_property()

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

References ao_oss_set_property(), AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, AO_PROP_PCM_VOL, IOCTL_REQUEST_TYPE, and v.

Referenced by ao_oss_set_property(), and open_plugin().

## ◆ ao_oss_write()

static int ao_oss_write | ( | ao_driver_t * | this_gen,
|  | int16_t * | frame_buffer,
|  | uint32_t | num_frames
| ) |  |
| static

References lprintf, NULL, OSS_SYNC_SOFTSYNC, and xine_monotonic_clock().

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, oss_class_t::driver_class, audio_driver_class_s::identifier, N_, NULL, open_plugin(), audio_driver_class_s::open_plugin, and oss_class_t::xine.

## ◆ open_plugin()

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

References _, A52_PASSTHRU, AFMT_S16_NE, AO_CAP_8BITS, AO_CAP_MIXER_VOL, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, AO_CAP_MODE_A52, AO_CAP_MODE_AC5, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, AO_CAP_MUTE_VOL, AO_CAP_NO_UNPAUSE, AO_CAP_PCM_VOL, ao_oss_bytes_per_frame(), ao_oss_close(), ao_oss_ctrl(), ao_oss_delay(), ao_oss_exit(), ao_oss_get_capabilities(), ao_oss_get_gap_tolerance(), ao_oss_get_property(), ao_oss_num_channels(), ao_oss_open(), ao_oss_set_property(), ao_oss_write(), AO_PROP_MIXER_VOL, AO_PROP_PCM_VOL, AUDIO_DEVICE_SPEAKER_ARRANGEMENT_HELP, AUDIO_DEVICE_SPEAKER_ARRANGEMENT_TYPES, xine_s::config, NULL, oss_speaker_arrangement_cb(), OSS_SYNC_AUTO_DETECT, OSS_SYNC_GETODELAY, OSS_SYNC_GETOPTR, OSS_SYNC_PROBEBUFFER, OSS_SYNC_SOFTSYNC, probe_audio_devices(), SNDCTL_DSP_SETFMT, SNDCTL_DSP_SPEED, STEREO, SURROUND4, SURROUND5, SURROUND51, config_values_s::xine, oss_class_t::xine, xine_monotonic_clock(), xine_open_cloexec(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by init_class().

## ◆ oss_speaker_arrangement_cb()

static void oss_speaker_arrangement_cb | ( | void * | user_data,
|  | xine_cfg_entry_t * | entry
| ) |  |
| static

References A52_PASSTHRU, AO_CAP_MODE_4_1CHANNEL, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, AO_CAP_MODE_A52, AO_CAP_MODE_AC5, xine_cfg_entry_s::num_value, SURROUND4, SURROUND41, SURROUND5, SURROUND51, and user_data().

Referenced by open_plugin().

## ◆ probe_audio_devices()

static int probe_audio_devices | ( | oss_driver_t * | this | ) |
| static

References SNDCTL_DSP_SPEED.

Referenced by open_plugin().

## Variable Documentation

## ◆ ao_info_oss

const ao_info_t ao_info_oss
| static

Initial value:
= {
.priority = 9,
}

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_AUDIO_OUT, 9 , "oss", XINE_VERSION_CODE, &ao_info_oss, init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
init_class
static void * init_class(xine_t *xine, const void *data)
Definition: audio_oss_out.c:1123
ao_info_oss
static const ao_info_t ao_info_oss
Definition: audio_oss_out.c:1142
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