gstreamer/sys/wasapi2/gstwasapi2client.h
Seungha Yang 2778457678 wasapi2: Introduce new WASAPI plugin
Add a new wasapi implementation mainly to support UWP application.
Basically the core logic of this plugin is almost identical to
existing wasapi plugin, but main target is Windows 10 (+ UWP).
Since this plugin uses WinRT APIs, this plugin most likely might not
work Windows 8 or lower.

Compared with existing wasapi plugin, additional features of this plugin are
* Fully compatible with both Windows 10 desktop and UWP application
* Supports automatic stream routing (auto fallback when device was removed)
* Support device level mute/volume control

But some features of existing wasapi plugin are not implemented
in this plugin yet
* Exclusive streaming mode is not supported
* Loopback feature is not implemented
* Cross-compile is not possible with current mingw toolchain
  (meaning that MSVC and Windows 10 SDK are required to build this plugin)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1264>
2020-06-08 03:10:05 +00:00

83 lines
3 KiB
C

/*
* Copyright (C) 2020 Seungha Yang <seungha@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_WASAPI2_CLIENT_H__
#define __GST_WASAPI2_CLIENT_H__
#include <gst/gst.h>
#include <gst/audio/audio.h>
G_BEGIN_DECLS
typedef enum
{
GST_WASAPI2_CLIENT_DEVICE_CLASS_CAPTURE = 0,
GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER,
} GstWasapi2ClientDeviceClass;
#define GST_TYPE_WASAPI2_CLIENT_DEVICE_CLASS (gst_wasapi2_client_device_class_get_type())
GType gst_wasapi2_client_device_class_get_type (void);
#define GST_TYPE_WASAPI2_CLIENT (gst_wasapi2_client_get_type())
G_DECLARE_FINAL_TYPE (GstWasapi2Client,
gst_wasapi2_client, GST, WASAPI2_CLIENT, GstObject);
GstCaps * gst_wasapi2_client_get_caps (GstWasapi2Client * client);
gboolean gst_wasapi2_client_open (GstWasapi2Client * client,
GstAudioRingBufferSpec * spec,
GstAudioRingBuffer * buf);
gboolean gst_wasapi2_client_start (GstWasapi2Client * client);
gboolean gst_wasapi2_client_stop (GstWasapi2Client * client);
gint gst_wasapi2_client_read (GstWasapi2Client * client,
gpointer data,
guint length);
gint gst_wasapi2_client_write (GstWasapi2Client * client,
gpointer data,
guint length);
guint gst_wasapi2_client_delay (GstWasapi2Client * client);
gboolean gst_wasapi2_client_set_mute (GstWasapi2Client * client,
gboolean mute);
gboolean gst_wasapi2_client_get_mute (GstWasapi2Client * client,
gboolean * mute);
gboolean gst_wasapi2_client_set_volume (GstWasapi2Client * client,
gfloat volume);
gboolean gst_wasapi2_client_get_volume (GstWasapi2Client * client,
gfloat * volume);
GstWasapi2Client * gst_wasapi2_client_new (GstWasapi2ClientDeviceClass device_class,
gboolean low_latency,
gint device_index,
const gchar * device_id);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstWasapi2Client, gst_object_unref)
G_END_DECLS
#endif /* __GST_WASAPI2_CLIENT_H__ */