ao/wasapi: reorder priv members

This commit is contained in:
Kevin Mitchell 2015-03-27 16:48:39 -07:00
parent 4f84939310
commit fe60cff03b
1 changed files with 14 additions and 12 deletions

View File

@ -45,26 +45,18 @@ void wasapi_change_uninit(struct ao* ao);
typedef struct wasapi_state { typedef struct wasapi_state {
struct mp_log *log; struct mp_log *log;
HANDLE threadLoop;
/* Init phase */ /* Init phase */
HRESULT init_ret; HRESULT init_ret;
HANDLE init_done; HANDLE init_done;
int share_mode; int share_mode;
HANDLE hUninit;
/* volume control */ /* volume control */
DWORD vol_hw_support, status; DWORD vol_hw_support;
float audio_volume; float audio_volume;
float previous_volume; float previous_volume;
float initial_volume; float initial_volume;
/* Buffers */ /* WASAPI handles, owned by audio thread */
size_t buffer_block_size; /* Size of each block in bytes */
UINT32 bufferFrameCount; /* wasapi buffer block size, number of frames, frame size at format.nBlockAlign */
/* WASAPI handles, owned by other thread */
IMMDevice *pDevice; IMMDevice *pDevice;
IAudioClient *pAudioClient; IAudioClient *pAudioClient;
IAudioRenderClient *pRenderClient; IAudioRenderClient *pRenderClient;
@ -73,15 +65,19 @@ typedef struct wasapi_state {
IAudioSessionControl *pSessionControl; IAudioSessionControl *pSessionControl;
IMMDeviceEnumerator *pEnumerator; IMMDeviceEnumerator *pEnumerator;
/* thread handles */
HANDLE threadLoop; /* the thread itself */
HANDLE hUninit; /* thread shutdown */
HANDLE hFeed; /* wasapi event */ HANDLE hFeed; /* wasapi event */
HANDLE hResume; /* signal audio thread to resume the stream */ HANDLE hResume; /* signal audio thread to resume the stream */
HANDLE hReset; /* signal audio thread to reset the stream */ HANDLE hReset; /* signal audio thread to reset the stream */
/* for setting the audio thread priority */
HANDLE hTask; /* AV thread */ HANDLE hTask; /* AV thread */
DWORD taskIndex; /* AV task ID */ DWORD taskIndex; /* AV task ID */
WAVEFORMATEXTENSIBLE format;
/* WASAPI proxy handles, for Single-Threaded Apartment communication. /* WASAPI proxy handles, for Single-Threaded Apartment communication.
One is needed for each object that's accessed by a different thread. */ One is needed for each audio thread object that's accessed from the main thread. */
ISimpleAudioVolume *pAudioVolumeProxy; ISimpleAudioVolume *pAudioVolumeProxy;
IAudioEndpointVolume *pEndpointVolumeProxy; IAudioEndpointVolume *pEndpointVolumeProxy;
IAudioSessionControl *pSessionControlProxy; IAudioSessionControl *pSessionControlProxy;
@ -99,10 +95,16 @@ typedef struct wasapi_state {
atomic_ullong sample_count; /* the amount of samples per channel written to a GetBuffer buffer */ atomic_ullong sample_count; /* the amount of samples per channel written to a GetBuffer buffer */
LARGE_INTEGER qpc_frequency; /* frequency of windows' high resolution timer */ LARGE_INTEGER qpc_frequency; /* frequency of windows' high resolution timer */
/* ao options */
int opt_exclusive; int opt_exclusive;
int opt_list; int opt_list;
char *opt_device; char *opt_device;
/* format info */
WAVEFORMATEXTENSIBLE format;
size_t buffer_block_size; /* Size of each block in bytes */
UINT32 bufferFrameCount; /* wasapi buffer block size, number of frames, frame size at format.nBlockAlign */
/* Don't use these functions directly in case /* Don't use these functions directly in case
they are unimplemented for some reason. they are unimplemented for some reason.
(XP shouldn't be an issue since it doesn't support wasapi, maybe wine?) (XP shouldn't be an issue since it doesn't support wasapi, maybe wine?)