2 * Copyright (C) 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
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.
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.
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.
20 #ifndef __GST_WASAPI_UTIL_H__
21 #define __GST_WASAPI_UTIL_H__
24 #include <gst/audio/audio.h>
25 #include <gst/audio/gstaudiosrc.h>
26 #include <gst/audio/gstaudiosink.h>
28 #include <audioclient.h>
30 /* Device role enum property */
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);
42 gint gst_wasapi_device_role_to_erole (gint role);
44 gint gst_wasapi_erole_to_device_role (gint erole);
46 const gchar *gst_wasapi_util_hresult_to_string (HRESULT hr);
49 gst_wasapi_util_get_device_client (GstElement * element,
51 gint role, const wchar_t * device_name, IAudioClient ** ret_client);
53 gboolean gst_wasapi_util_get_render_client (GstElement * element,
54 IAudioClient * client, IAudioRenderClient ** ret_render_client);
56 gboolean gst_wasapi_util_get_capture_client (GstElement * element,
57 IAudioClient * client, IAudioCaptureClient ** ret_capture_client);
59 gboolean gst_wasapi_util_get_clock (GstElement * element,
60 IAudioClient * client, IAudioClock ** ret_clock);
62 GstCaps *gst_wasapi_util_waveformatex_to_caps (WAVEFORMATEXTENSIBLE * format,
63 GstCaps * template_caps);
65 #endif /* __GST_WASAPI_UTIL_H__ */