summaryrefslogtreecommitdiff
path: root/sys/wasapi2/gstwasapi2client.h
blob: 57b281101f6deb305f0c0c36d3962e375342dc03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 * 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>
#include "gstwasapi2util.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);

HRESULT   gst_wasapi2_client_open     (GstWasapi2Client * client,
                                       GstAudioRingBufferSpec * spec,
                                       GstAudioRingBuffer * buf);

HRESULT   gst_wasapi2_client_start    (GstWasapi2Client * client);

HRESULT   gst_wasapi2_client_stop     (GstWasapi2Client * client);

HRESULT   gst_wasapi2_client_read     (GstWasapi2Client * client,
                                       gpointer data,
                                       guint length,
                                       guint * read_length);

HRESULT   gst_wasapi2_client_write    (GstWasapi2Client * client,
                                       gpointer data,
                                       guint length,
                                       guint * write_length);

HRESULT   gst_wasapi2_client_delay  (GstWasapi2Client * client,
                                       guint32 * delay);

HRESULT   gst_wasapi2_client_set_mute  (GstWasapi2Client * client,
                                        gboolean mute);

HRESULT   gst_wasapi2_client_get_mute  (GstWasapi2Client * client,
                                        gboolean * mute);

HRESULT   gst_wasapi2_client_set_volume (GstWasapi2Client * client,
                                         gfloat volume);

HRESULT   gst_wasapi2_client_get_volume (GstWasapi2Client * client,
                                         gfloat * volume);

gboolean gst_wasapi2_client_ensure_activation (GstWasapi2Client * client);

GstWasapi2Client * gst_wasapi2_client_new (GstWasapi2ClientDeviceClass device_class,
                                           gboolean low_latency,
                                           gint device_index,
                                           const gchar * device_id,
                                           gpointer dispatcher);

G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstWasapi2Client, gst_object_unref)

G_END_DECLS

#endif /* __GST_WASAPI2_CLIENT_H__ */