Debian Codegraph @

lib/wp/si-interfaces.h

raw
1 /* WirePlumber
2 *
3 * Copyright © 2020 Collabora Ltd.
4 * @author George Kiagiadakis <[email protected]>
5 *
6 * SPDX-License-Identifier: MIT
7 */
8
9 #ifndef __WIREPLUMBER_SI_INTERFACES_H__
10 #define __WIREPLUMBER_SI_INTERFACES_H__
11
12 #include "session-item.h"
13 #include "properties.h"
14 #include "spa-pod.h"
15
16 G_BEGIN_DECLS
17
18 typedef struct _WpSiAcquisition WpSiAcquisition;
19
20 /*!
21 * \brief The WpSiAdapter GType
22 * \ingroup wpsiinterfaces
23 */
24 #define WP_TYPE_SI_ADAPTER (wp_si_adapter_get_type ())
25 WP_API
26 G_DECLARE_INTERFACE (WpSiAdapter, wp_si_adapter,
27 WP, SI_ADAPTER, WpSessionItem)
28
29 /*!
30 * \brief The ports configuration state of the adapter
31 * \ingroup wpsiinterfaces
32 * \since 0.4.10
33 */
34 typedef enum {
35 WP_SI_ADAPTER_PORTS_STATE_NONE = 0, /*!< the ports have never been configured */
36 WP_SI_ADAPTER_PORTS_STATE_CONFIGURING, /*!< the ports are being configured */
37 WP_SI_ADAPTER_PORTS_STATE_CONFIGURED, /*!< the ports are configured */
38 } WpSiAdapterPortsState;
39
40 struct _WpSiAdapterInterface
41 {
42 GTypeInterface interface;
43
44 WpSpaPod * (*get_ports_format) (WpSiAdapter * self, const gchar **mode);
45 void (*set_ports_format) (WpSiAdapter * self, WpSpaPod *format,
46 const gchar *mode, GAsyncReadyCallback callback, gpointer data);
47 gboolean (*set_ports_format_finish) (WpSiAdapter * self, GAsyncResult * res,
48 GError ** error);
49 WpSiAdapterPortsState (*get_ports_state) (WpSiAdapter * self);
50
51 /*< private >*/
52 WP_PADDING(4)
53 };
54
55 WP_API
56 WpSiAdapterPortsState wp_si_adapter_get_ports_state (WpSiAdapter * self);
57
58 WP_API
59 WpSpaPod *wp_si_adapter_get_ports_format (WpSiAdapter * self,
60 const gchar **mode);
61
62 WP_API
63 void wp_si_adapter_set_ports_format (WpSiAdapter * self, WpSpaPod *format,
64 const gchar *mode, GAsyncReadyCallback callback, gpointer data);
65
66 WP_API
67 gboolean wp_si_adapter_set_ports_format_finish (WpSiAdapter * self,
68 GAsyncResult * res, GError ** error);
69
70 /*!
71 * \brief The WpSiLinkable GType
72 * \ingroup wpsiinterfaces
73 */
74 #define WP_TYPE_SI_LINKABLE (wp_si_linkable_get_type ())
75 WP_API
76 G_DECLARE_INTERFACE (WpSiLinkable, wp_si_linkable,
77 WP, SI_LINKABLE, WpSessionItem)
78
79 struct _WpSiLinkableInterface
80 {
81 GTypeInterface interface;
82
83 GVariant * (*get_ports) (WpSiLinkable * self, const gchar * context);
84 WpSiAcquisition * (*get_acquisition) (WpSiLinkable * self);
85
86 /*< private >*/
87 WP_PADDING(6)
88 };
89
90 WP_API
91 GVariant * wp_si_linkable_get_ports (WpSiLinkable * self,
92 const gchar * context);
93
94 WP_API
95 WpSiAcquisition * wp_si_linkable_get_acquisition (WpSiLinkable * self);
96
97 /*!
98 * \brief The WpSiLink GType
99 * \ingroup wpsiinterfaces
100 */
101 #define WP_TYPE_SI_LINK (wp_si_link_get_type ())
102 WP_API
103 G_DECLARE_INTERFACE (WpSiLink, wp_si_link,
104 WP, SI_LINK, WpSessionItem)
105
106 struct _WpSiLinkInterface
107 {
108 GTypeInterface interface;
109
110 GVariant * (*get_registration_info) (WpSiLink * self);
111 WpProperties * (*get_properties) (WpSiLink * self);
112
113 WpSiLinkable * (*get_out_item) (WpSiLink * self);
114 WpSiLinkable * (*get_in_item) (WpSiLink * self);
115
116 /*< private >*/
117 WP_PADDING(4)
118 };
119
120 WP_API
121 GVariant * wp_si_link_get_registration_info (WpSiLink * self);
122
123 WP_API
124 WpProperties * wp_si_link_get_properties (WpSiLink * self);
125
126 WP_API
127 WpSiLinkable * wp_si_link_get_out_item (WpSiLink * self);
128
129 WP_API
130 WpSiLinkable * wp_si_link_get_in_item (WpSiLink * self);
131
132 /*!
133 * \brief The WpSiAcquisition GType
134 * \ingroup wpsiinterfaces
135 */
136 #define WP_TYPE_SI_ACQUISITION (wp_si_acquisition_get_type ())
137 WP_API
138 G_DECLARE_INTERFACE (WpSiAcquisition, wp_si_acquisition,
139 WP, SI_ACQUISITION, WpSessionItem)
140
141 struct _WpSiAcquisitionInterface
142 {
143 GTypeInterface interface;
144
145 void (*acquire) (WpSiAcquisition * self, WpSiLink * acquisitor,
146 WpSiLinkable * item, GAsyncReadyCallback callback, gpointer data);
147 gboolean (*acquire_finish) (WpSiAcquisition * self, GAsyncResult * res,
148 GError ** error);
149
150 void (*release) (WpSiAcquisition * self, WpSiLink * acquisitor,
151 WpSiLinkable * item);
152
153 /*< private >*/
154 WP_PADDING(5)
155 };
156
157 WP_API
158 void wp_si_acquisition_acquire (WpSiAcquisition * self, WpSiLink * acquisitor,
159 WpSiLinkable * item, GAsyncReadyCallback callback, gpointer data);
160
161 WP_API
162 gboolean wp_si_acquisition_acquire_finish (
163 WpSiAcquisition * self, GAsyncResult * res, GError ** error);
164
165 WP_API
166 void wp_si_acquisition_release (WpSiAcquisition * self, WpSiLink * acquisitor,
167 WpSiLinkable * item);
168
169 G_END_DECLS
170
171 #endif