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

xine-lib 1.2.12

Data Structures | Macros | Typedefs | Functions | Variables
audio_directx_out.c File Reference
`#include <windows.h>`
`#include <dsound.h>`
`#include <xine/audio_out.h>`
`#include <xine/xine_internal.h>`

## Data Structures
struct | ao_directx_t
struct | audiox_class_t

## Macros
#define | LOG_MODULE "audio_directx_out"
#define | LOG_VERBOSE
#define | MAX_CHANNELS 6
#define | MAX_BITS 16
#define | MAX_SAMPLE_RATE 44100
#define | SOUND_BUFFER_DIV 32
#define | SOUND_BUFFER_MAX MAX_CHANNELS * (MAX_BITS / 8) * (((MAX_SAMPLE_RATE / SOUND_BUFFER_DIV) + 1) & ~1)
#define | DSBUFF_INIT 0
#define | DSBUFF_LEFT 1
#define | DSBUFF_RIGHT 2
#define | AO_DIRECTX_IFACE_VERSION 9
#define | IID_IDirectSoundNotify xine_IID_IDirectSoundNotify

## Typedefs
typedef unsigned char | boolean

## Functions
static void | Error (HWND hwnd, LPCSTR szfmt,...)
static boolean | CreateDirectSound (ao_directx_t *ao_directx)
static void | DestroyDirectSound (ao_directx_t *ao_directx)
static uint32_t | FillSoundBuffer (ao_directx_t *ao_directx, int code, unsigned char *samples)
static void | DestroySoundBuffer (ao_directx_t *ao_directx)
static boolean | CreateSoundBuffer (ao_directx_t *ao_directx)
static int | ao_directx_control (ao_driver_t *this_gen, int cmd,...)
static int | ao_directx_open (ao_driver_t *ao_driver, uint32_t bits, uint32_t rate, int mode)
static int | ao_directx_num_channels (ao_driver_t *ao_driver)
static int | ao_directx_bytes_per_frame (ao_driver_t *ao_driver)
static int | ao_directx_get_gap_tolerance (ao_driver_t *ao_driver)
static int | ao_directx_delay (ao_driver_t *ao_driver)
static int | ao_directx_write (ao_driver_t *ao_driver, int16_t *frame_buffer, uint32_t num_frames)
static void | ao_directx_close (ao_driver_t *ao_driver)
static uint32_t | ao_directx_get_capabilities (ao_driver_t *ao_driver)
static void | ao_directx_exit (ao_driver_t *ao_driver)
static int | ao_directx_get_property (ao_driver_t *ao_driver, int property)
static int | ao_directx_set_property (ao_driver_t *ao_driver, int property, int value)
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 GUID | xine_IID_IDirectSoundNotify
static const ao_info_t | ao_info_directx
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ AO_DIRECTX_IFACE_VERSION

#define AO_DIRECTX_IFACE_VERSION 9

## ◆ DSBUFF_INIT

#define DSBUFF_INIT 0

## ◆ DSBUFF_LEFT

#define DSBUFF_LEFT 1

## ◆ DSBUFF_RIGHT

#define DSBUFF_RIGHT 2

## ◆ IID_IDirectSoundNotify

#define IID_IDirectSoundNotify xine_IID_IDirectSoundNotify

## ◆ LOG_MODULE

#define LOG_MODULE "audio_directx_out"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAX_BITS

#define MAX_BITS 16

## ◆ MAX_CHANNELS

#define MAX_CHANNELS 6

## ◆ MAX_SAMPLE_RATE

#define MAX_SAMPLE_RATE 44100

## ◆ SOUND_BUFFER_DIV

#define SOUND_BUFFER_DIV 32

## ◆ SOUND_BUFFER_MAX

#define SOUND_BUFFER_MAX MAX_CHANNELS * (MAX_BITS / 8) * (((MAX_SAMPLE_RATE / SOUND_BUFFER_DIV) + 1) & ~1)

## Typedef Documentation

## ◆ boolean

typedef unsigned char boolean

## Function Documentation

## ◆ ao_directx_bytes_per_frame()

static int ao_directx_bytes_per_frame | ( | ao_driver_t * | ao_driver | ) |
| static

References ao_directx_t::frsz.

Referenced by open_plugin().

## ◆ ao_directx_close()

static void ao_directx_close | ( | ao_driver_t * | ao_driver | ) |
| static

References DestroySoundBuffer(), and lprintf.

Referenced by open_plugin().

## ◆ ao_directx_control()

static int ao_directx_control | ( | 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_directx_delay()

static int ao_directx_delay | ( | ao_driver_t * | ao_driver | ) |
| static

References ao_directx_t::buffer_size, ao_directx_t::dsbuffer, ao_directx_t::frsz, lprintf, ao_directx_t::prebuff_size, and ao_directx_t::write_pos.

Referenced by open_plugin().

## ◆ ao_directx_exit()

static void ao_directx_exit | ( | ao_driver_t * | ao_driver | ) |
| static

References DestroyDirectSound(), DestroySoundBuffer(), and lprintf.

Referenced by open_plugin().

## ◆ ao_directx_get_capabilities()

static uint32_t ao_directx_get_capabilities | ( | ao_driver_t * | ao_driver | ) |
| static

References AO_CAP_MIXER_VOL, AO_CAP_MODE_STEREO, AO_CAP_MUTE_VOL, and AO_CAP_PCM_VOL.

Referenced by open_plugin().

## ◆ ao_directx_get_gap_tolerance()

static int ao_directx_get_gap_tolerance | ( | ao_driver_t * | ao_driver | ) |
| static

Referenced by open_plugin().

## ◆ ao_directx_get_property()

static int ao_directx_get_property | ( | ao_driver_t * | ao_driver,
|  | int | property
| ) |  |
| static

Referenced by open_plugin().

## ◆ ao_directx_num_channels()

static int ao_directx_num_channels | ( | ao_driver_t * | ao_driver | ) |
| static

References ao_directx_t::chnn.

Referenced by open_plugin().

## ◆ ao_directx_open()

static int ao_directx_open | ( | ao_driver_t * | ao_driver,
|  | uint32_t | bits,
|  | uint32_t | rate,
|  | int | mode
| ) |  |
| static

References 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_directx_t::bits, bits, ao_directx_t::chnn, CreateSoundBuffer(), lprintf, mode(), ao_directx_t::rate, ao_directx_t::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by open_plugin().

## ◆ ao_directx_set_property()

static int ao_directx_set_property | ( | ao_driver_t * | ao_driver,
|  | int | property,
|  | int | value
| ) |  |
| static

References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, AO_PROP_PCM_VOL, ao_directx_t::dsbuffer, lprintf, ao_directx_t::mute, ao_directx_t::volume, ao_directx_t::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by open_plugin().

## ◆ ao_directx_write()

static int ao_directx_write | ( | ao_driver_t * | ao_driver,
|  | int16_t * | frame_buffer,
|  | uint32_t | num_frames
| ) |  |
| static

References ao_directx_t::buffer_size, DSBUFF_LEFT, DSBUFF_RIGHT, FillSoundBuffer(), ao_directx_t::frsz, lprintf, ao_directx_t::notify_events, ao_directx_t::prebuff, ao_directx_t::prebuff_size, ao_directx_t::write_pos, and ao_directx_t::write_status.

Referenced by open_plugin().

## ◆ CreateDirectSound()

static boolean CreateDirectSound | ( | ao_directx_t * | ao_directx | ) |
| static

References ao_directx_t::dsobj, Error(), and lprintf.

Referenced by open_plugin().

## ◆ CreateSoundBuffer()

static boolean CreateSoundBuffer | ( | ao_directx_t * | ao_directx | ) |
| static

References ao_directx_t::bits, ao_directx_t::buffer_size, ao_directx_t::chnn, DestroySoundBuffer(), ao_directx_t::dsbcaps, DSBUFF_INIT, ao_directx_t::dsbuffer, ao_directx_t::dsobj, Error(), FillSoundBuffer(), ao_directx_t::frsz, IID_IDirectSoundNotify, lprintf, ao_directx_t::notify, ao_directx_t::notify_events, NULL, ao_directx_t::rate, and SOUND_BUFFER_DIV.

Referenced by ao_directx_open().

## ◆ DestroyDirectSound()

static void DestroyDirectSound | ( | ao_directx_t * | ao_directx | ) |
| static

References ao_directx_t::dsobj, and lprintf.

Referenced by ao_directx_exit().

## ◆ DestroySoundBuffer()

static void DestroySoundBuffer | ( | ao_directx_t * | ao_directx | ) |
| static

References DSBUFF_INIT, ao_directx_t::dsbuffer, FillSoundBuffer(), lprintf, ao_directx_t::notify, and ao_directx_t::notify_events.

Referenced by ao_directx_close(), ao_directx_exit(), and CreateSoundBuffer().

## ◆ Error()

static void Error | ( | HWND | hwnd,
|  | LPCSTR | szfmt,
|  |  | ...
| ) |  |
| static

Referenced by CreateDirectSound(), CreateSoundBuffer(), and FillSoundBuffer().

## ◆ FillSoundBuffer()

static uint32_t FillSoundBuffer | ( | ao_directx_t * | ao_directx,
|  | int | code,
|  | unsigned char * | samples
| ) |  |
| static

References ao_directx_t::buffer_size, code, DSBUFF_INIT, DSBUFF_LEFT, DSBUFF_RIGHT, ao_directx_t::dsbuffer, Error(), lprintf, NULL, ao_directx_t::volume, and ao_directx_t::write_status.

Referenced by ao_directx_write(), CreateSoundBuffer(), and DestroySoundBuffer().

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

## ◆ open_plugin()

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

References ao_directx_bytes_per_frame(), ao_directx_close(), ao_directx_control(), ao_directx_delay(), ao_directx_exit(), ao_directx_get_capabilities(), ao_directx_get_gap_tolerance(), ao_directx_get_property(), ao_directx_num_channels(), ao_directx_open(), ao_directx_set_property(), ao_directx_write(), CreateDirectSound(), lprintf, and NULL.

Referenced by init_class().

## Variable Documentation

## ◆ ao_info_directx

const ao_info_t ao_info_directx
| static

Initial value:
= {
.priority = 1,
}

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_AUDIO_OUT, 9 , "directx", XINE_VERSION_CODE, &ao_info_directx, init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
init_class
static void * init_class(xine_t *xine, const void *data)
Definition: audio_directx_out.c:819
ao_info_directx
static const ao_info_t ao_info_directx
Definition: audio_directx_out.c:843
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

## ◆ xine_IID_IDirectSoundNotify

const GUID xine_IID_IDirectSoundNotify
| static

Initial value:
= {
0xB0210783,0x89CD,0x11D0,{0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16}
}