summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi_utils.h
diff options
context:
space:
mode:
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>2014-03-11 00:47:33 -0300
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2014-03-11 16:37:02 -0300
commitf3e9b9462210021286bfbe98eef228ab74c8b490 (patch)
tree07c2b6691a37f220717dd88cd7579a1f2b46851f /audio/out/ao_wasapi_utils.h
parent58011810e5dad7c89a0123434fe9fe7cdaa26fac (diff)
downloadmpv-f3e9b9462210021286bfbe98eef228ab74c8b490.tar.bz2
mpv-f3e9b9462210021286bfbe98eef228ab74c8b490.tar.xz
ao_wasapi: Move non-critical code outside of the event thread
Due to the COM Single-Threaded Apartment model, the thread owning the objects will still do all the actual method calls (in the form of message dispatches), but at least this will be COM's problem rather than having to set up several handles and adding extra code to the event thread. Since the event thread still needs to own the WASAPI handles to avoid waiting on another thread to dispatch the messages, the init and uninit code still has to run in the thread. This also removes a broken drain implementation and removes unused headers from each of the files split from the original ao_wasapi.c.
Diffstat (limited to 'audio/out/ao_wasapi_utils.h')
-rwxr-xr-xaudio/out/ao_wasapi_utils.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/audio/out/ao_wasapi_utils.h b/audio/out/ao_wasapi_utils.h
index eb4b56556f..fdc6e4fb7c 100755
--- a/audio/out/ao_wasapi_utils.h
+++ b/audio/out/ao_wasapi_utils.h
@@ -20,37 +20,26 @@
#ifndef MP_AO_WASAPI_UTILS_H_
#define MP_AO_WASAPI_UTILS_H_
-#define COBJMACROS 1
-#define _WIN32_WINNT 0x600
-
#include "audio/out/ao_wasapi.h"
#include "options/m_option.h"
-#include "options/m_config.h"
-#include "audio/format.h"
#include "common/msg.h"
-#include "misc/ring.h"
#include "ao.h"
#include "internal.h"
-#include "compat/atomics.h"
-#include "osdep/timer.h"
int wasapi_fill_VistaBlob(wasapi_state *state);
const char *wasapi_explain_err(const HRESULT hr);
-char* wasapi_get_device_name(IMMDevice *pDevice);
-char* wasapi_get_device_id(IMMDevice *pDevice);
-
-int wasapi_find_formats(struct ao *const ao);
-int wasapi_fix_format(struct wasapi_state *state);
-
int wasapi_enumerate_devices(struct mp_log *log);
-HRESULT wasapi_find_and_load_device(struct ao *ao, IMMDevice **ppDevice,
- char *search);
-
int wasapi_validate_device(struct mp_log *log, const m_option_t *opt,
struct bstr name, struct bstr param);
-#endif \ No newline at end of file
+int wasapi_thread_init(struct ao *ao);
+void wasapi_thread_uninit(wasapi_state *state);
+
+HRESULT wasapi_setup_proxies(wasapi_state *state);
+void wasapi_release_proxies(wasapi_state *state);
+
+#endif