/*****************************************************************************
* directx.c: Windows DirectX audio output method
*****************************************************************************
/*****************************************************************************
* directx.c: Windows DirectX audio output method
*****************************************************************************
static void Probe ( aout_instance_t * );
static int InitDirectSound ( aout_instance_t * );
static int CreateDSBuffer ( aout_instance_t *, int, int, int, int, int, bool );
static void Probe ( aout_instance_t * );
static int InitDirectSound ( aout_instance_t * );
static int CreateDSBuffer ( aout_instance_t *, int, int, int, int, int, bool );
-static int CreateDSBufferPCM ( aout_instance_t *, int*, int, int, int, bool );
+static int CreateDSBufferPCM ( aout_instance_t *, vlc_fourcc_t*, int, int, int, bool );
static void DestroyDSBuffer ( aout_instance_t * );
static void* DirectSoundThread( vlc_object_t * );
static int FillBuffer ( aout_instance_t *, int, aout_buffer_t * );
static void DestroyDSBuffer ( aout_instance_t * );
static void* DirectSoundThread( vlc_object_t * );
static int FillBuffer ( aout_instance_t *, int, aout_buffer_t * );
#define FLOAT_LONGTEXT N_( \
"The option allows you to enable or disable the high-quality float32 " \
"audio output mode (which is not well supported by some soundcards)." )
#define FLOAT_LONGTEXT N_( \
"The option allows you to enable or disable the high-quality float32 " \
"audio output mode (which is not well supported by some soundcards)." )
#define SPEAKER_LONGTEXT N_("Select speaker configuration you want to use. " \
"This option doesn't upmix! So NO e.g. Stereo -> 5.1 conversion." )
#define SPEAKER_LONGTEXT N_("Select speaker configuration you want to use. " \
"This option doesn't upmix! So NO e.g. Stereo -> 5.1 conversion." )
add_shortcut( "directx" )
add_integer( "directx-audio-device", 0, NULL, DEVICE_TEXT,
DEVICE_LONGTEXT, true )
add_shortcut( "directx" )
add_integer( "directx-audio-device", 0, NULL, DEVICE_TEXT,
DEVICE_LONGTEXT, true )
- add_bool( "directx-audio-float32", 0, 0, FLOAT_TEXT,
+ add_bool( "directx-audio-float32", false, NULL, FLOAT_TEXT,
FLOAT_LONGTEXT, true )
add_string( "directx-audio-speaker", "Windows default", NULL,
SPEAKER_TEXT, SPEAKER_LONGTEXT, true )
FLOAT_LONGTEXT, true )
add_string( "directx-audio-speaker", "Windows default", NULL,
SPEAKER_TEXT, SPEAKER_LONGTEXT, true )
AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT |
AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT |
AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE;
AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT |
AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT |
AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE;
- if( p_aout->output.output.i_physical_channels == i_physical_channels )
- {
- if( CreateDSBufferPCM( p_aout, &i_format, i_physical_channels, 8,
+ if( p_aout->output.output.i_physical_channels == i_physical_channels )
+ {
+ if( CreateDSBufferPCM( p_aout, &i_format, i_physical_channels, 8,
- == VLC_SUCCESS )
- {
- val.i_int = AOUT_VAR_7_1;
- text.psz_string = (char*) "7.1";
- var_Change( p_aout, "audio-device",
- VLC_VAR_ADDCHOICE, &val, &text );
- var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
- is_default_output_set = true;
- msg_Dbg( p_aout, "device supports 7.1 channels" );
- }
- }
+ == VLC_SUCCESS )
+ {
+ val.i_int = AOUT_VAR_7_1;
+ text.psz_string = (char*) "7.1";
+ var_Change( p_aout, "audio-device",
+ VLC_VAR_ADDCHOICE, &val, &text );
+ var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+ is_default_output_set = true;
+ msg_Dbg( p_aout, "device supports 7.1 channels" );
+ }
+ }
static int CALLBACK CallBackDirectSoundEnum( LPGUID p_guid, LPCSTR psz_desc,
LPCSTR psz_mod, LPVOID _p_aout )
{
static int CALLBACK CallBackDirectSoundEnum( LPGUID p_guid, LPCSTR psz_desc,
LPCSTR psz_mod, LPVOID _p_aout )
{
aout_instance_t *p_aout = (aout_instance_t *)_p_aout;
msg_Dbg( p_aout, "found device: %s", psz_desc );
aout_instance_t *p_aout = (aout_instance_t *)_p_aout;
msg_Dbg( p_aout, "found device: %s", psz_desc );
* We first try to create a WAVE_FORMAT_IEEE_FLOAT buffer if supported by
* the hardware, otherwise we create a WAVE_FORMAT_PCM buffer.
****************************************************************************/
* We first try to create a WAVE_FORMAT_IEEE_FLOAT buffer if supported by
* the hardware, otherwise we create a WAVE_FORMAT_PCM buffer.
****************************************************************************/
int i_channels, int i_nb_channels, int i_rate,
bool b_probe )
{
int i_channels, int i_nb_channels, int i_rate,
bool b_probe )
{
notification_thread_t *p_notif = p_aout->output.p_sys->p_notif;
aout_sys_t *p_sys = p_aout->output.p_sys;
void *p_write_position, *p_wrap_around;
notification_thread_t *p_notif = p_aout->output.p_sys->p_notif;
aout_sys_t *p_sys = p_aout->output.p_sys;
void *p_write_position, *p_wrap_around;
p_sys->i_channels, p_sys->pi_chan_table,
p_sys->i_bits_per_sample );
}
p_sys->i_channels, p_sys->pi_chan_table,
p_sys->i_bits_per_sample );
}