winepulse: Move pulse_is_started to unix lib.
And move pulse_stream to pulse.c since it's accessed only from unix lib now. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bf74f36350
commit
aba40bd50a
|
@ -1611,7 +1611,7 @@ static HRESULT WINAPI AudioSessionControl_GetState(IAudioSessionControl2 *iface,
|
|||
goto out;
|
||||
}
|
||||
LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) {
|
||||
if (client->pulse_stream->started) {
|
||||
if (client->pulse_stream && pulse->is_started(client->pulse_stream)) {
|
||||
*state = AudioSessionStateActive;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,36 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(pulse);
|
||||
|
||||
struct pulse_stream
|
||||
{
|
||||
EDataFlow dataflow;
|
||||
|
||||
pa_stream *stream;
|
||||
pa_sample_spec ss;
|
||||
pa_channel_map map;
|
||||
pa_buffer_attr attr;
|
||||
|
||||
DWORD flags;
|
||||
AUDCLNT_SHAREMODE share;
|
||||
HANDLE event;
|
||||
float vol[PA_CHANNELS_MAX];
|
||||
BOOL mute;
|
||||
|
||||
INT32 locked;
|
||||
UINT32 bufsize_frames, real_bufsize_bytes, period_bytes;
|
||||
UINT32 started, peek_ofs, read_offs_bytes, lcl_offs_bytes, pa_offs_bytes;
|
||||
UINT32 tmp_buffer_bytes, held_bytes, peek_len, peek_buffer_len, pa_held_bytes;
|
||||
BYTE *local_buffer, *tmp_buffer, *peek_buffer;
|
||||
void *locked_ptr;
|
||||
BOOL please_quit, just_started, just_underran;
|
||||
pa_usec_t last_time, mmdev_period_usec;
|
||||
|
||||
INT64 clock_lastpos, clock_written;
|
||||
|
||||
struct list packet_free_head;
|
||||
struct list packet_filled_head;
|
||||
};
|
||||
|
||||
typedef struct _ACPacket
|
||||
{
|
||||
struct list entry;
|
||||
|
@ -1770,6 +1800,11 @@ static HRESULT WINAPI pulse_set_event_handle(struct pulse_stream *stream, HANDLE
|
|||
return hr;
|
||||
}
|
||||
|
||||
static BOOL WINAPI pulse_is_started(struct pulse_stream *stream)
|
||||
{
|
||||
return pulse_stream_valid(stream) && stream->started;
|
||||
}
|
||||
|
||||
static const struct unix_funcs unix_funcs =
|
||||
{
|
||||
pulse_lock,
|
||||
|
@ -1795,6 +1830,7 @@ static const struct unix_funcs unix_funcs =
|
|||
pulse_set_volumes,
|
||||
pulse_set_event_handle,
|
||||
pulse_test_connect,
|
||||
pulse_is_started,
|
||||
};
|
||||
|
||||
NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out)
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include "wine/list.h"
|
||||
|
||||
struct pulse_stream;
|
||||
|
||||
struct pulse_config
|
||||
{
|
||||
struct
|
||||
|
@ -29,35 +31,6 @@ struct pulse_config
|
|||
unsigned int speakers_mask;
|
||||
};
|
||||
|
||||
struct pulse_stream
|
||||
{
|
||||
EDataFlow dataflow;
|
||||
|
||||
pa_stream *stream;
|
||||
pa_sample_spec ss;
|
||||
pa_channel_map map;
|
||||
pa_buffer_attr attr;
|
||||
|
||||
DWORD flags;
|
||||
AUDCLNT_SHAREMODE share;
|
||||
HANDLE event;
|
||||
float vol[PA_CHANNELS_MAX];
|
||||
|
||||
INT32 locked;
|
||||
UINT32 bufsize_frames, real_bufsize_bytes, period_bytes;
|
||||
UINT32 started, peek_ofs, read_offs_bytes, lcl_offs_bytes, pa_offs_bytes;
|
||||
UINT32 tmp_buffer_bytes, held_bytes, peek_len, peek_buffer_len, pa_held_bytes;
|
||||
BYTE *local_buffer, *tmp_buffer, *peek_buffer;
|
||||
void *locked_ptr;
|
||||
BOOL please_quit, just_started, just_underran;
|
||||
pa_usec_t last_time, mmdev_period_usec;
|
||||
|
||||
INT64 clock_lastpos, clock_written;
|
||||
|
||||
struct list packet_free_head;
|
||||
struct list packet_filled_head;
|
||||
};
|
||||
|
||||
struct unix_funcs
|
||||
{
|
||||
void (WINAPI *lock)(void);
|
||||
|
@ -89,4 +62,5 @@ struct unix_funcs
|
|||
const float *volumes, const float *session_volumes);
|
||||
HRESULT (WINAPI *set_event_handle)(struct pulse_stream *stream, HANDLE event);
|
||||
HRESULT (WINAPI *test_connect)(const char *name, struct pulse_config *config);
|
||||
BOOL (WINAPI *is_started)(struct pulse_stream *stream);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue