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

mmdevapi: Integrate winepulse's additions in unixlib.h.

parent 19baa295
/* /*
* Copyright 2021 Jacek Caban for CodeWeavers
* Copyright 2022 Huw Davies * Copyright 2022 Huw Davies
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -27,6 +28,11 @@ struct endpoint ...@@ -27,6 +28,11 @@ struct endpoint
unsigned int device; unsigned int device;
}; };
struct main_loop_params
{
HANDLE event;
};
struct get_endpoint_ids_params struct get_endpoint_ids_params
{ {
EDataFlow flow; EDataFlow flow;
...@@ -39,6 +45,7 @@ struct get_endpoint_ids_params ...@@ -39,6 +45,7 @@ struct get_endpoint_ids_params
struct create_stream_params struct create_stream_params
{ {
const char *name;
const char *device; const char *device;
EDataFlow flow; EDataFlow flow;
AUDCLNT_SHAREMODE share; AUDCLNT_SHAREMODE share;
...@@ -47,6 +54,7 @@ struct create_stream_params ...@@ -47,6 +54,7 @@ struct create_stream_params
REFERENCE_TIME period; REFERENCE_TIME period;
const WAVEFORMATEX *fmt; const WAVEFORMATEX *fmt;
HRESULT result; HRESULT result;
UINT32 *channel_count;
stream_handle *stream; stream_handle *stream;
}; };
...@@ -110,7 +118,7 @@ struct get_capture_buffer_params ...@@ -110,7 +118,7 @@ struct get_capture_buffer_params
struct release_capture_buffer_params struct release_capture_buffer_params
{ {
stream_handle stream; stream_handle stream;
UINT32 done; BOOL done;
HRESULT result; HRESULT result;
}; };
...@@ -132,6 +140,15 @@ struct get_mix_format_params ...@@ -132,6 +140,15 @@ struct get_mix_format_params
HRESULT result; HRESULT result;
}; };
struct get_device_period_params
{
const char *device;
EDataFlow flow;
HRESULT result;
REFERENCE_TIME *def_period;
REFERENCE_TIME *min_period;
};
struct get_buffer_size_params struct get_buffer_size_params
{ {
stream_handle stream; stream_handle stream;
...@@ -170,6 +187,7 @@ struct get_frequency_params ...@@ -170,6 +187,7 @@ struct get_frequency_params
struct get_position_params struct get_position_params
{ {
stream_handle stream; stream_handle stream;
BOOL device;
HRESULT result; HRESULT result;
UINT64 *pos; UINT64 *pos;
UINT64 *qpctime; UINT64 *qpctime;
...@@ -190,6 +208,12 @@ struct set_event_handle_params ...@@ -190,6 +208,12 @@ struct set_event_handle_params
HRESULT result; HRESULT result;
}; };
struct test_connect_params
{
const char *name;
HRESULT result;
};
struct is_started_params struct is_started_params
{ {
stream_handle stream; stream_handle stream;
...@@ -251,6 +275,9 @@ struct midi_notify_wait_params ...@@ -251,6 +275,9 @@ struct midi_notify_wait_params
enum unix_funcs enum unix_funcs
{ {
process_attach,
process_detach,
main_loop,
get_endpoint_ids, get_endpoint_ids,
create_stream, create_stream,
release_stream, release_stream,
...@@ -264,6 +291,7 @@ enum unix_funcs ...@@ -264,6 +291,7 @@ enum unix_funcs
release_capture_buffer, release_capture_buffer,
is_format_supported, is_format_supported,
get_mix_format, get_mix_format,
get_device_period,
get_buffer_size, get_buffer_size,
get_latency, get_latency,
get_current_padding, get_current_padding,
...@@ -272,6 +300,7 @@ enum unix_funcs ...@@ -272,6 +300,7 @@ enum unix_funcs
get_position, get_position,
set_volumes, set_volumes,
set_event_handle, set_event_handle,
test_connect,
is_started, is_started,
get_prop_value, get_prop_value,
midi_release, midi_release,
......
...@@ -2431,6 +2431,9 @@ static NTSTATUS alsa_get_prop_value(void *args) ...@@ -2431,6 +2431,9 @@ static NTSTATUS alsa_get_prop_value(void *args)
unixlib_entry_t __wine_unix_call_funcs[] = unixlib_entry_t __wine_unix_call_funcs[] =
{ {
NULL,
NULL,
NULL,
alsa_get_endpoint_ids, alsa_get_endpoint_ids,
alsa_create_stream, alsa_create_stream,
alsa_release_stream, alsa_release_stream,
...@@ -2444,6 +2447,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -2444,6 +2447,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
alsa_release_capture_buffer, alsa_release_capture_buffer,
alsa_is_format_supported, alsa_is_format_supported,
alsa_get_mix_format, alsa_get_mix_format,
NULL,
alsa_get_buffer_size, alsa_get_buffer_size,
alsa_get_latency, alsa_get_latency,
alsa_get_current_padding, alsa_get_current_padding,
...@@ -2452,6 +2456,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -2452,6 +2456,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
alsa_get_position, alsa_get_position,
alsa_set_volumes, alsa_set_volumes,
alsa_set_event_handle, alsa_set_event_handle,
NULL,
alsa_is_started, alsa_is_started,
alsa_get_prop_value, alsa_get_prop_value,
alsa_midi_release, alsa_midi_release,
...@@ -2493,6 +2498,7 @@ static NTSTATUS alsa_wow64_create_stream(void *args) ...@@ -2493,6 +2498,7 @@ static NTSTATUS alsa_wow64_create_stream(void *args)
{ {
struct struct
{ {
PTR32 name;
PTR32 device; PTR32 device;
EDataFlow flow; EDataFlow flow;
AUDCLNT_SHAREMODE share; AUDCLNT_SHAREMODE share;
...@@ -2501,10 +2507,12 @@ static NTSTATUS alsa_wow64_create_stream(void *args) ...@@ -2501,10 +2507,12 @@ static NTSTATUS alsa_wow64_create_stream(void *args)
REFERENCE_TIME period; REFERENCE_TIME period;
PTR32 fmt; PTR32 fmt;
HRESULT result; HRESULT result;
PTR32 channel_count;
PTR32 stream; PTR32 stream;
} *params32 = args; } *params32 = args;
struct create_stream_params params = struct create_stream_params params =
{ {
.name = ULongToPtr(params32->name),
.device = ULongToPtr(params32->device), .device = ULongToPtr(params32->device),
.flow = params32->flow, .flow = params32->flow,
.share = params32->share, .share = params32->share,
...@@ -2512,6 +2520,7 @@ static NTSTATUS alsa_wow64_create_stream(void *args) ...@@ -2512,6 +2520,7 @@ static NTSTATUS alsa_wow64_create_stream(void *args)
.duration = params32->duration, .duration = params32->duration,
.period = params32->period, .period = params32->period,
.fmt = ULongToPtr(params32->fmt), .fmt = ULongToPtr(params32->fmt),
.channel_count = ULongToPtr(params32->channel_count),
.stream = ULongToPtr(params32->stream) .stream = ULongToPtr(params32->stream)
}; };
alsa_create_stream(&params); alsa_create_stream(&params);
...@@ -2837,6 +2846,9 @@ static NTSTATUS alsa_wow64_get_prop_value(void *args) ...@@ -2837,6 +2846,9 @@ static NTSTATUS alsa_wow64_get_prop_value(void *args)
unixlib_entry_t __wine_unix_call_wow64_funcs[] = unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{ {
NULL,
NULL,
NULL,
alsa_wow64_get_endpoint_ids, alsa_wow64_get_endpoint_ids,
alsa_wow64_create_stream, alsa_wow64_create_stream,
alsa_wow64_release_stream, alsa_wow64_release_stream,
...@@ -2850,6 +2862,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = ...@@ -2850,6 +2862,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
alsa_release_capture_buffer, alsa_release_capture_buffer,
alsa_wow64_is_format_supported, alsa_wow64_is_format_supported,
alsa_wow64_get_mix_format, alsa_wow64_get_mix_format,
NULL,
alsa_wow64_get_buffer_size, alsa_wow64_get_buffer_size,
alsa_wow64_get_latency, alsa_wow64_get_latency,
alsa_wow64_get_current_padding, alsa_wow64_get_current_padding,
...@@ -2858,6 +2871,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = ...@@ -2858,6 +2871,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
alsa_wow64_get_position, alsa_wow64_get_position,
alsa_wow64_set_volumes, alsa_wow64_set_volumes,
alsa_wow64_set_event_handle, alsa_wow64_set_event_handle,
NULL,
alsa_is_started, alsa_is_started,
alsa_wow64_get_prop_value, alsa_wow64_get_prop_value,
alsa_midi_release, alsa_midi_release,
......
...@@ -746,6 +746,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, ...@@ -746,6 +746,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
dump_fmt(fmt); dump_fmt(fmt);
params.name = NULL;
params.device = This->alsa_name; params.device = This->alsa_name;
params.flow = This->dataflow; params.flow = This->dataflow;
params.share = mode; params.share = mode;
...@@ -753,6 +754,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, ...@@ -753,6 +754,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
params.duration = duration; params.duration = duration;
params.period = period; params.period = period;
params.fmt = fmt; params.fmt = fmt;
params.channel_count = NULL;
params.stream = &stream; params.stream = &stream;
ALSA_CALL(create_stream, &params); ALSA_CALL(create_stream, &params);
......
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