From: Davide Beatrici git@davidebeatrici.dev
--- dlls/mmdevapi/client.c | 91 +++++++++++++++++++++++++++++ dlls/winepulse.drv/mmdevdrv.c | 106 ++++++---------------------------- 2 files changed, 109 insertions(+), 88 deletions(-)
diff --git a/dlls/mmdevapi/client.c b/dlls/mmdevapi/client.c index ea279da34a1..acc3868ce6a 100644 --- a/dlls/mmdevapi/client.c +++ b/dlls/mmdevapi/client.c @@ -53,6 +53,11 @@ static inline struct audio_client *impl_from_IAudioCaptureClient(IAudioCaptureCl return CONTAINING_RECORD(iface, struct audio_client, IAudioCaptureClient_iface); }
+static inline struct audio_client *impl_from_IAudioClient3(IAudioClient3 *iface) +{ + return CONTAINING_RECORD(iface, struct audio_client, IAudioClient3_iface); +} + static inline struct audio_client *impl_from_IAudioClock(IAudioClock *iface) { return CONTAINING_RECORD(iface, struct audio_client, IAudioClock_iface); @@ -341,6 +346,92 @@ const IAudioClock2Vtbl AudioClock2_Vtbl = clock2_GetDevicePosition };
+HRESULT WINAPI client_IsOffloadCapable(IAudioClient3 *iface, AUDIO_STREAM_CATEGORY category, + BOOL *offload_capable) +{ + struct audio_client *This = impl_from_IAudioClient3(iface); + + TRACE("(%p)->(0x%x, %p)\n", This, category, offload_capable); + + if (!offload_capable) + return E_INVALIDARG; + + *offload_capable = FALSE; + + return S_OK; +} + +HRESULT WINAPI client_SetClientProperties(IAudioClient3 *iface, + const AudioClientProperties *prop) +{ + struct audio_client *This = impl_from_IAudioClient3(iface); + const Win8AudioClientProperties *legacy_prop = (const Win8AudioClientProperties *)prop; + + TRACE("(%p)->(%p)\n", This, prop); + + if (!legacy_prop) + return E_POINTER; + + if (legacy_prop->cbSize == sizeof(AudioClientProperties)) { + TRACE("{ bIsOffload: %u, eCategory: 0x%x, Options: 0x%x }\n", legacy_prop->bIsOffload, + legacy_prop->eCategory, + prop->Options); + } else if(legacy_prop->cbSize == sizeof(Win8AudioClientProperties)) { + TRACE("{ bIsOffload: %u, eCategory: 0x%x }\n", legacy_prop->bIsOffload, + legacy_prop->eCategory); + } else { + WARN("Unsupported Size = %d\n", legacy_prop->cbSize); + return E_INVALIDARG; + } + + if (legacy_prop->bIsOffload) + return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE; + + return S_OK; +} + +HRESULT WINAPI client_GetBufferSizeLimits(IAudioClient3 *iface, const WAVEFORMATEX *format, + BOOL event_driven, REFERENCE_TIME *min_duration, + REFERENCE_TIME *max_duration) +{ + struct audio_client *This = impl_from_IAudioClient3(iface); + FIXME("(%p)->(%p, %u, %p, %p) - stub\n", This, format, event_driven, min_duration, max_duration); + return E_NOTIMPL; +} + +HRESULT WINAPI client_GetSharedModeEnginePeriod(IAudioClient3 *iface, + const WAVEFORMATEX *format, + UINT32 *default_period_frames, + UINT32 *unit_period_frames, + UINT32 *min_period_frames, + UINT32 *max_period_frames) +{ + struct audio_client *This = impl_from_IAudioClient3(iface); + FIXME("(%p)->(%p, %p, %p, %p, %p) - stub\n", This, format, default_period_frames, + unit_period_frames, min_period_frames, + max_period_frames); + return E_NOTIMPL; +} + +HRESULT WINAPI client_GetCurrentSharedModeEnginePeriod(IAudioClient3 *iface, + WAVEFORMATEX **cur_format, + UINT32 *cur_period_frames) +{ + struct audio_client *This = impl_from_IAudioClient3(iface); + FIXME("(%p)->(%p, %p) - stub\n", This, cur_format, cur_period_frames); + return E_NOTIMPL; +} + +HRESULT WINAPI client_InitializeSharedAudioStream(IAudioClient3 *iface, DWORD flags, + UINT32 period_frames, + const WAVEFORMATEX *format, + const GUID *session_guid) +{ + struct audio_client *This = impl_from_IAudioClient3(iface); + FIXME("(%p)->(0x%lx, %u, %p, %s) - stub\n", This, flags, period_frames, format, debugstr_guid(session_guid)); + return E_NOTIMPL; +} + static HRESULT WINAPI render_QueryInterface(IAudioRenderClient *iface, REFIID riid, void **ppv) { struct audio_client *This = impl_from_IAudioRenderClient(iface); diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 110f23e1319..def79d7f961 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -1071,96 +1071,26 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, return E_NOINTERFACE; }
-static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient3 *iface, - AUDIO_STREAM_CATEGORY category, BOOL *offload_capable) -{ - ACImpl *This = impl_from_IAudioClient3(iface); - - TRACE("(%p)->(0x%x, %p)\n", This, category, offload_capable); - - if(!offload_capable) - return E_INVALIDARG; - - *offload_capable = FALSE; +extern HRESULT WINAPI client_IsOffloadCapable(IAudioClient3 *iface, + AUDIO_STREAM_CATEGORY category, BOOL *offload_capable);
- return S_OK; -} - -static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient3 *iface, - const AudioClientProperties *prop) -{ - ACImpl *This = impl_from_IAudioClient3(iface); - const Win8AudioClientProperties *legacy_prop = (const Win8AudioClientProperties *)prop; - - TRACE("(%p)->(%p)\n", This, prop); - - if(!legacy_prop) - return E_POINTER; - - if(legacy_prop->cbSize == sizeof(AudioClientProperties)){ - TRACE("{ bIsOffload: %u, eCategory: 0x%x, Options: 0x%x }\n", - legacy_prop->bIsOffload, - legacy_prop->eCategory, - prop->Options); - }else if(legacy_prop->cbSize == sizeof(Win8AudioClientProperties)){ - TRACE("{ bIsOffload: %u, eCategory: 0x%x }\n", - legacy_prop->bIsOffload, - legacy_prop->eCategory); - }else{ - WARN("Unsupported Size = %d\n", legacy_prop->cbSize); - return E_INVALIDARG; - } - - - if(legacy_prop->bIsOffload) - return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE; - - return S_OK; -} +extern HRESULT WINAPI client_SetClientProperties(IAudioClient3 *iface, + const AudioClientProperties *prop);
-static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient3 *iface, +extern HRESULT WINAPI client_GetBufferSizeLimits(IAudioClient3 *iface, const WAVEFORMATEX *format, BOOL event_driven, REFERENCE_TIME *min_duration, - REFERENCE_TIME *max_duration) -{ - ACImpl *This = impl_from_IAudioClient3(iface); - - FIXME("(%p)->(%p, %u, %p, %p)\n", This, format, event_driven, min_duration, max_duration); - - return E_NOTIMPL; -} + REFERENCE_TIME *max_duration);
-static HRESULT WINAPI AudioClient_GetSharedModeEnginePeriod(IAudioClient3 *iface, +extern HRESULT WINAPI client_GetSharedModeEnginePeriod(IAudioClient3 *iface, const WAVEFORMATEX *format, UINT32 *default_period_frames, UINT32 *unit_period_frames, - UINT32 *min_period_frames, UINT32 *max_period_frames) -{ - ACImpl *This = impl_from_IAudioClient3(iface); + UINT32 *min_period_frames, UINT32 *max_period_frames);
- FIXME("(%p)->(%p, %p, %p, %p, %p)\n", This, format, default_period_frames, unit_period_frames, - min_period_frames, max_period_frames); +extern HRESULT WINAPI client_GetCurrentSharedModeEnginePeriod(IAudioClient3 *iface, + WAVEFORMATEX **cur_format, UINT32 *cur_period_frames);
- return E_NOTIMPL; -} - -static HRESULT WINAPI AudioClient_GetCurrentSharedModeEnginePeriod(IAudioClient3 *iface, - WAVEFORMATEX **cur_format, UINT32 *cur_period_frames) -{ - ACImpl *This = impl_from_IAudioClient3(iface); - - FIXME("(%p)->(%p, %p)\n", This, cur_format, cur_period_frames); - - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioClient_InitializeSharedAudioStream(IAudioClient3 *iface, +extern HRESULT WINAPI client_InitializeSharedAudioStream(IAudioClient3 *iface, DWORD flags, UINT32 period_frames, const WAVEFORMATEX *format, - const GUID *session_guid) -{ - ACImpl *This = impl_from_IAudioClient3(iface); - - FIXME("(%p)->(0x%lx, %u, %p, %s)\n", This, flags, period_frames, format, debugstr_guid(session_guid)); - - return E_NOTIMPL; -} + const GUID *session_guid);
static const IAudioClient3Vtbl AudioClient3_Vtbl = { @@ -1179,12 +1109,12 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl = AudioClient_Reset, AudioClient_SetEventHandle, AudioClient_GetService, - AudioClient_IsOffloadCapable, - AudioClient_SetClientProperties, - AudioClient_GetBufferSizeLimits, - AudioClient_GetSharedModeEnginePeriod, - AudioClient_GetCurrentSharedModeEnginePeriod, - AudioClient_InitializeSharedAudioStream, + client_IsOffloadCapable, + client_SetClientProperties, + client_GetBufferSizeLimits, + client_GetSharedModeEnginePeriod, + client_GetCurrentSharedModeEnginePeriod, + client_InitializeSharedAudioStream, };
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)