Commit cc9e486b authored by Davide Beatrici's avatar Davide Beatrici Committed by Alexandre Julliard

winealsa: Use mmdevapi's AudioClient's GetDevicePeriod, GetMixFormat, IsFormatSupported.

parent 9cd13ecb
......@@ -716,86 +716,15 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
return params.result;
}
static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient3 *iface,
extern HRESULT WINAPI client_IsFormatSupported(IAudioClient3 *iface,
AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *fmt,
WAVEFORMATEX **out)
{
ACImpl *This = impl_from_IAudioClient3(iface);
struct is_format_supported_params params;
TRACE("(%p)->(%x, %p, %p)\n", This, mode, fmt, out);
if(fmt) dump_fmt(fmt);
params.device = This->device_name;
params.flow = This->dataflow;
params.share = mode;
params.fmt_in = fmt;
params.fmt_out = NULL;
if(out){
*out = NULL;
if(mode == AUDCLNT_SHAREMODE_SHARED)
params.fmt_out = CoTaskMemAlloc(sizeof(*params.fmt_out));
}
ALSA_CALL(is_format_supported, &params);
if(params.result == S_FALSE)
*out = &params.fmt_out->Format;
else
CoTaskMemFree(params.fmt_out);
return params.result;
}
static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient3 *iface,
WAVEFORMATEX **pwfx)
{
ACImpl *This = impl_from_IAudioClient3(iface);
struct get_mix_format_params params;
TRACE("(%p)->(%p)\n", This, pwfx);
if(!pwfx)
return E_POINTER;
*pwfx = NULL;
params.device = This->device_name;
params.flow = This->dataflow;
params.fmt = CoTaskMemAlloc(sizeof(WAVEFORMATEXTENSIBLE));
if(!params.fmt)
return E_OUTOFMEMORY;
WAVEFORMATEX **out);
ALSA_CALL(get_mix_format, &params);
extern HRESULT WINAPI client_GetMixFormat(IAudioClient3 *iface,
WAVEFORMATEX **pwfx);
if(SUCCEEDED(params.result)){
*pwfx = &params.fmt->Format;
dump_fmt(*pwfx);
} else
CoTaskMemFree(params.fmt);
return params.result;
}
static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient3 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
ACImpl *This = impl_from_IAudioClient3(iface);
struct get_device_period_params params;
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
if (!defperiod && !minperiod)
return E_POINTER;
params.device = This->device_name;
params.flow = This->dataflow;
params.def_period = defperiod;
params.min_period = minperiod;
ALSA_CALL(get_device_period, &params);
return params.result;
}
extern HRESULT WINAPI client_GetDevicePeriod(IAudioClient3 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod);
extern HRESULT WINAPI client_Start(IAudioClient3 *iface);
......@@ -839,9 +768,9 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
AudioClient_GetBufferSize,
AudioClient_GetStreamLatency,
AudioClient_GetCurrentPadding,
AudioClient_IsFormatSupported,
AudioClient_GetMixFormat,
AudioClient_GetDevicePeriod,
client_IsFormatSupported,
client_GetMixFormat,
client_GetDevicePeriod,
client_Start,
client_Stop,
client_Reset,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment