winecoreaudio: Move get_buffer_size to the unixlib.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2021-11-23 07:55:00 +00:00 committed by Alexandre Julliard
parent de39001552
commit 68c63beeca
3 changed files with 26 additions and 7 deletions

View file

@ -1115,6 +1115,18 @@ static NTSTATUS capture_resample(void *args)
return STATUS_SUCCESS;
}
static NTSTATUS get_buffer_size(void *args)
{
struct get_buffer_size_params *params = args;
struct coreaudio_stream *stream = params->stream;
OSSpinLockLock(&stream->lock);
*params->frames = stream->bufsize_frames;
OSSpinLockUnlock(&stream->lock);
params->result = S_OK;
return STATUS_SUCCESS;
}
unixlib_entry_t __wine_unix_call_funcs[] =
{
get_endpoint_ids,
@ -1122,6 +1134,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
release_stream,
get_mix_format,
is_format_supported,
get_buffer_size,
capture_resample /* temporary */
};

View file

@ -855,6 +855,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
UINT32 *frames)
{
ACImpl *This = impl_from_IAudioClient3(iface);
struct get_buffer_size_params params;
TRACE("(%p)->(%p)\n", This, frames);
@ -864,13 +865,10 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
OSSpinLockLock(&This->stream->lock);
*frames = This->stream->bufsize_frames;
OSSpinLockUnlock(&This->stream->lock);
return S_OK;
params.stream = This->stream;
params.frames = frames;
UNIX_CALL(get_buffer_size, &params);
return params.result;
}
static HRESULT ca_get_max_stream_latency(ACImpl *This, UInt32 *max)

View file

@ -93,6 +93,13 @@ struct is_format_supported_params
HRESULT result;
};
struct get_buffer_size_params
{
struct coreaudio_stream *stream;
HRESULT result;
UINT32 *frames;
};
enum unix_funcs
{
unix_get_endpoint_ids,
@ -100,6 +107,7 @@ enum unix_funcs
unix_release_stream,
unix_get_mix_format,
unix_is_format_supported,
unix_get_buffer_size,
unix_capture_resample /* temporary */
};