wasapi: Rewrite most of the code to make it work
[platform/upstream/gstreamer.git] / sys / wasapi / gstwasapiutil.h
1 /*
2  * Copyright (C) 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __GST_WASAPI_UTIL_H__
21 #define __GST_WASAPI_UTIL_H__
22
23 #include <gst/gst.h>
24 #include <gst/audio/audio.h>
25 #include <gst/audio/gstaudiosrc.h>
26 #include <gst/audio/gstaudiosink.h>
27
28 #include <audioclient.h>
29
30 /* Device role enum property */
31 typedef enum
32 {
33   GST_WASAPI_DEVICE_ROLE_CONSOLE,
34   GST_WASAPI_DEVICE_ROLE_MULTIMEDIA,
35   GST_WASAPI_DEVICE_ROLE_COMMS
36 } GstWasapiDeviceRole;
37 #define GST_WASAPI_DEVICE_TYPE_ROLE (gst_wasapi_device_role_get_type())
38 GType gst_wasapi_device_role_get_type (void);
39
40 /* Utilities */
41
42 gint gst_wasapi_device_role_to_erole (gint role);
43
44 gint gst_wasapi_erole_to_device_role (gint erole);
45
46 const gchar *gst_wasapi_util_hresult_to_string (HRESULT hr);
47
48 gboolean
49 gst_wasapi_util_get_device_client (GstElement * element,
50     gboolean capture,
51     gint role, const wchar_t * device_name, IAudioClient ** ret_client);
52
53 gboolean gst_wasapi_util_get_render_client (GstElement * element,
54     IAudioClient * client, IAudioRenderClient ** ret_render_client);
55
56 gboolean gst_wasapi_util_get_capture_client (GstElement * element,
57     IAudioClient * client, IAudioCaptureClient ** ret_capture_client);
58
59 gboolean gst_wasapi_util_get_clock (GstElement * element,
60     IAudioClient * client, IAudioClock ** ret_clock);
61
62 GstCaps *gst_wasapi_util_waveformatex_to_caps (WAVEFORMATEXTENSIBLE * format,
63     GstCaps * template_caps);
64
65 #endif /* __GST_WASAPI_UTIL_H__ */