xine-lib 1.2.11
Data Structures | Macros | Functions | Variables
audio_directx2_out.c File Reference
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include <windows.h>
#include <dsound.h>
#include <xine/xine_internal.h>
#include <xine/audio_out.h>

Data Structures

struct  dx2_class_t
 
struct  dx2_driver_t
 

Macros

#define LOG_MODULE   "audio_directx2_out"
 
#define LOG_VERBOSE
 
#define AO_OUT_DIRECTX2_IFACE_VERSION   9
 
#define GAP_TOLERANCE   (AO_MAX_GAP/3)
 
#define BUFFER_MS   1000
 
#define BUFFER_MIN_MS   200
 
#define FACTOR   60.0
 
#define STATUS_START   0
 
#define STATUS_WAIT   1
 
#define STATUS_RUNNING   2
 
#define PRIdword   "lu"
 
#define PRIsizet   "u"
 
#define IID_IDirectSoundNotify   xine_IID_IDirectSoundNotify
 

Functions

static void XINE_FORMAT_PRINTF (1, 2)
 
static char * dsound_strerror (HRESULT err)
 
static LPDIRECTSOUND dsound_create ()
 
static void dsound_destroy (LPDIRECTSOUND ds)
 
static void dsound_fill_wfx (WAVEFORMATEX *wfx, uint32_t bits, uint32_t rate, int channels, size_t frame_size)
 
static void dsound_fill_desc (DSBUFFERDESC *desc, DWORD flags, DWORD buffer_size, WAVEFORMATEX *wfx)
 
static void audio_thread_exit (dx2_driver_t *this)
 
static void audio_error (dx2_driver_t *this, HRESULT err, char *msg)
 
static int audio_create_buffers (dx2_driver_t *this)
 
static void audio_destroy_buffers (dx2_driver_t *this)
 
static int audio_play (dx2_driver_t *this)
 
static int audio_stop (dx2_driver_t *this)
 
static int audio_tell (dx2_driver_t *this, size_t *pos)
 
static int audio_seek (dx2_driver_t *this, size_t pos)
 
static int audio_flush (dx2_driver_t *this)
 
static int audio_set_volume (dx2_driver_t *this, int volume)
 
static int audio_fill (dx2_driver_t *this, char *data, size_t size)
 
static int mode2channels (uint32_t mode)
 
static int test_capability (LPDIRECTSOUNDBUFFER buffer, uint32_t bits, uint32_t rate, int mode)
 
static int test_capabilities (dx2_driver_t *this)
 
static size_t buffer_free_size (dx2_driver_t *this)
 
static size_t buffer_occupied_size (dx2_driver_t *this)
 
static void * buffer_service (void *data)
 
static uint32_t ao_dx2_get_capabilities (ao_driver_t *this_gen)
 
static int ao_dx2_get_property (ao_driver_t *this_gen, int property)
 
static int ao_dx2_set_property (ao_driver_t *this_gen, int property, int value)
 
static int ao_dx2_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode)
 
static int ao_dx2_num_channels (ao_driver_t *this_gen)
 
static int ao_dx2_bytes_per_frame (ao_driver_t *this_gen)
 
static int ao_dx2_delay (ao_driver_t *this_gen)
 
static int ao_dx2_write (ao_driver_t *this_gen, int16_t *audio_data, uint32_t num_samples)
 
static void ao_dx2_close (ao_driver_t *this_gen)
 
static void ao_dx2_exit (ao_driver_t *this_gen)
 
static int ao_dx2_get_gap_tolerance (ao_driver_t *this_gen)
 
static int ao_dx2_control (ao_driver_t *this_gen, int cmd,...)
 
static ao_driver_topen_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_directx2
 
const plugin_info_t xine_plugin_info[] EXPORTED
 

Macro Definition Documentation

◆ AO_OUT_DIRECTX2_IFACE_VERSION

#define AO_OUT_DIRECTX2_IFACE_VERSION   9

◆ BUFFER_MIN_MS

#define BUFFER_MIN_MS   200

◆ BUFFER_MS

#define BUFFER_MS   1000

◆ FACTOR

#define FACTOR   60.0

◆ GAP_TOLERANCE

#define GAP_TOLERANCE   (AO_MAX_GAP/3)

◆ IID_IDirectSoundNotify

#define IID_IDirectSoundNotify   xine_IID_IDirectSoundNotify

◆ LOG_MODULE

#define LOG_MODULE   "audio_directx2_out"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ PRIdword

#define PRIdword   "lu"

◆ PRIsizet

#define PRIsizet   "u"

◆ STATUS_RUNNING

#define STATUS_RUNNING   2

◆ STATUS_START

#define STATUS_START   0

◆ STATUS_WAIT

#define STATUS_WAIT   1

Function Documentation

◆ ao_dx2_bytes_per_frame()

static int ao_dx2_bytes_per_frame ( ao_driver_t this_gen)
static

References lprintf.

Referenced by open_plugin().

◆ ao_dx2_close()

static void ao_dx2_close ( ao_driver_t this_gen)
static

◆ ao_dx2_control()

static int ao_dx2_control ( ao_driver_t this_gen,
int  cmd,
  ... 
)
static

◆ ao_dx2_delay()

static int ao_dx2_delay ( ao_driver_t this_gen)
static

◆ ao_dx2_exit()

static void ao_dx2_exit ( ao_driver_t this_gen)
static

◆ ao_dx2_get_capabilities()

static uint32_t ao_dx2_get_capabilities ( ao_driver_t this_gen)
static

Referenced by open_plugin().

◆ ao_dx2_get_gap_tolerance()

static int ao_dx2_get_gap_tolerance ( ao_driver_t this_gen)
static

References GAP_TOLERANCE.

Referenced by open_plugin().

◆ ao_dx2_get_property()

static int ao_dx2_get_property ( ao_driver_t this_gen,
int  property 
)
static

◆ ao_dx2_num_channels()

static int ao_dx2_num_channels ( ao_driver_t this_gen)
static

References lprintf.

Referenced by open_plugin().

◆ ao_dx2_open()

static int ao_dx2_open ( ao_driver_t this_gen,
uint32_t  bits,
uint32_t  rate,
int  mode 
)
static

◆ ao_dx2_set_property()

static int ao_dx2_set_property ( ao_driver_t this_gen,
int  property,
int  value 
)
static

◆ ao_dx2_write()

static int ao_dx2_write ( ao_driver_t this_gen,
int16_t *  audio_data,
uint32_t  num_samples 
)
static

◆ audio_create_buffers()

static int audio_create_buffers ( dx2_driver_t this)
static

◆ audio_destroy_buffers()

static void audio_destroy_buffers ( dx2_driver_t this)
static

Referenced by ao_dx2_close(), and ao_dx2_open().

◆ audio_error()

static void audio_error ( dx2_driver_t this,
HRESULT  err,
char *  msg 
)
static

◆ audio_fill()

static int audio_fill ( dx2_driver_t this,
char *  data,
size_t  size 
)
static

◆ audio_flush()

static int audio_flush ( dx2_driver_t this)
static

References audio_seek(), and STATUS_WAIT.

Referenced by ao_dx2_control(), and buffer_service().

◆ audio_play()

static int audio_play ( dx2_driver_t this)
static

References _, and audio_error().

Referenced by ao_dx2_control(), and buffer_service().

◆ audio_seek()

static int audio_seek ( dx2_driver_t this,
size_t  pos 
)
static

References _, and audio_error().

Referenced by audio_flush(), and buffer_service().

◆ audio_set_volume()

static int audio_set_volume ( dx2_driver_t this,
int  volume 
)
static

References _, audio_error(), FACTOR, and lprintf.

Referenced by ao_dx2_open(), and ao_dx2_set_property().

◆ audio_stop()

static int audio_stop ( dx2_driver_t this)
static

References _, and audio_error().

Referenced by ao_dx2_control(), and buffer_service().

◆ audio_tell()

static int audio_tell ( dx2_driver_t this,
size_t *  pos 
)
static

◆ audio_thread_exit()

static void audio_thread_exit ( dx2_driver_t this)
static

◆ buffer_free_size()

static size_t buffer_free_size ( dx2_driver_t this)
static

References audio_tell().

Referenced by ao_dx2_write(), and buffer_service().

◆ buffer_occupied_size()

static size_t buffer_occupied_size ( dx2_driver_t this)
static

References audio_tell().

Referenced by ao_dx2_delay(), ao_dx2_write(), and buffer_service().

◆ buffer_service()

static void * buffer_service ( void *  data)
static

◆ dsound_create()

static LPDIRECTSOUND dsound_create ( )
static

References _, and NULL.

Referenced by open_plugin().

◆ dsound_destroy()

static void dsound_destroy ( LPDIRECTSOUND  ds)
static

Referenced by ao_dx2_exit().

◆ dsound_fill_desc()

static void dsound_fill_desc ( DSBUFFERDESC *  desc,
DWORD  flags,
DWORD  buffer_size,
WAVEFORMATEX *  wfx 
)
static

◆ dsound_fill_wfx()

static void dsound_fill_wfx ( WAVEFORMATEX *  wfx,
uint32_t  bits,
uint32_t  rate,
int  channels,
size_t  frame_size 
)
static

References bits.

Referenced by audio_create_buffers(), and test_capability().

◆ dsound_strerror()

static char * dsound_strerror ( HRESULT  err)
static

References _.

Referenced by audio_error().

◆ init_class()

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

◆ mode2channels()

static int mode2channels ( uint32_t  mode)
static

◆ open_plugin()

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

◆ test_capabilities()

static int test_capabilities ( dx2_driver_t this)
static

◆ test_capability()

static int test_capability ( LPDIRECTSOUNDBUFFER  buffer,
uint32_t  bits,
uint32_t  rate,
int  mode 
)
static

◆ XINE_FORMAT_PRINTF()

static void XINE_FORMAT_PRINTF ( ,
 
)
static

References _.

Variable Documentation

◆ ao_info_directx2

const ao_info_t ao_info_directx2
static
Initial value:
= {
.priority = 10,
}

◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED
Initial value:
= {
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
static void * init_class(xine_t *xine, const void *data)
Definition: audio_directx2_out.c:945
static const ao_info_t ao_info_directx2
Definition: audio_directx2_out.c:965
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
NULL
Definition: xine_plugin.c:78
#define PLUGIN_NONE
Definition: xine_plugin.h:29
#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}
}