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

winecoreaudio: Use mmdevapi's AudioClient's GetService.

parent 09b24317
......@@ -861,88 +861,8 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
return params.result;
}
static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
void **ppv)
{
ACImpl *This = impl_from_IAudioClient3(iface);
HRESULT hr;
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
sessions_lock();
if(IsEqualIID(riid, &IID_IAudioRenderClient)){
if(This->dataflow != eRender){
hr = AUDCLNT_E_WRONG_ENDPOINT_TYPE;
goto end;
}
IAudioRenderClient_AddRef(&This->IAudioRenderClient_iface);
*ppv = &This->IAudioRenderClient_iface;
}else if(IsEqualIID(riid, &IID_IAudioCaptureClient)){
if(This->dataflow != eCapture){
hr = AUDCLNT_E_WRONG_ENDPOINT_TYPE;
goto end;
}
IAudioCaptureClient_AddRef(&This->IAudioCaptureClient_iface);
*ppv = &This->IAudioCaptureClient_iface;
}else if(IsEqualIID(riid, &IID_IAudioClock)){
IAudioClock_AddRef(&This->IAudioClock_iface);
*ppv = &This->IAudioClock_iface;
}else if(IsEqualIID(riid, &IID_IAudioStreamVolume)){
IAudioStreamVolume_AddRef(&This->IAudioStreamVolume_iface);
*ppv = &This->IAudioStreamVolume_iface;
}else if(IsEqualIID(riid, &IID_IAudioSessionControl)){
if(!This->session_wrapper){
This->session_wrapper = session_wrapper_create(This);
if(!This->session_wrapper){
hr = E_OUTOFMEMORY;
goto end;
}
}else
IAudioSessionControl2_AddRef(&This->session_wrapper->IAudioSessionControl2_iface);
*ppv = &This->session_wrapper->IAudioSessionControl2_iface;
}else if(IsEqualIID(riid, &IID_IChannelAudioVolume)){
if(!This->session_wrapper){
This->session_wrapper = session_wrapper_create(This);
if(!This->session_wrapper){
hr = E_OUTOFMEMORY;
goto end;
}
}else
IChannelAudioVolume_AddRef(&This->session_wrapper->IChannelAudioVolume_iface);
*ppv = &This->session_wrapper->IChannelAudioVolume_iface;
}else if(IsEqualIID(riid, &IID_ISimpleAudioVolume)){
if(!This->session_wrapper){
This->session_wrapper = session_wrapper_create(This);
if(!This->session_wrapper){
hr = E_OUTOFMEMORY;
goto end;
}
}else
ISimpleAudioVolume_AddRef(&This->session_wrapper->ISimpleAudioVolume_iface);
*ppv = &This->session_wrapper->ISimpleAudioVolume_iface;
}
if(*ppv) hr = S_OK;
else{
FIXME("stub %s\n", debugstr_guid(riid));
hr = E_NOINTERFACE;
}
end:
sessions_unlock();
return hr;
}
extern HRESULT WINAPI client_GetService(IAudioClient3 *iface, REFIID riid,
void **ppv);
extern HRESULT WINAPI client_IsOffloadCapable(IAudioClient3 *iface,
AUDIO_STREAM_CATEGORY category, BOOL *offload_capable);
......@@ -981,7 +901,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
AudioClient_Stop,
AudioClient_Reset,
AudioClient_SetEventHandle,
AudioClient_GetService,
client_GetService,
client_IsOffloadCapable,
client_SetClientProperties,
client_GetBufferSizeLimits,
......
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