PipeWire 1.0.5
Loading...
Searching...
No Matches
impl-interfaces.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2019 Collabora Ltd. */
3/* @author George Kiagiadakis <george.kiagiadakis@collabora.com> */
4/* SPDX-License-Identifier: MIT */
5
6#ifndef PIPEWIRE_EXT_SESSION_MANAGER_IMPL_INTERFACES_H
7#define PIPEWIRE_EXT_SESSION_MANAGER_IMPL_INTERFACES_H
8
9#include <spa/utils/defs.h>
10#include <spa/utils/hook.h>
11#include <errno.h>
12
13#include "introspect.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
24#define PW_TYPE_INTERFACE_ClientEndpoint PW_TYPE_INFO_INTERFACE_BASE "ClientEndpoint"
25
26#define PW_VERSION_CLIENT_ENDPOINT 0
28
29#define PW_CLIENT_ENDPOINT_EVENT_SET_SESSION_ID 0
30#define PW_CLIENT_ENDPOINT_EVENT_SET_PARAM 1
31#define PW_CLIENT_ENDPOINT_EVENT_STREAM_SET_PARAM 2
32#define PW_CLIENT_ENDPOINT_EVENT_CREATE_LINK 3
33#define PW_CLIENT_ENDPOINT_EVENT_NUM 4
34
36#define PW_VERSION_CLIENT_ENDPOINT_EVENTS 0
37 uint32_t version;
54 int (*set_session_id) (void *data, uint32_t session_id);
55
77 int (*set_param) (void *data,
78 uint32_t id, uint32_t flags,
79 const struct spa_pod *param);
80
101 int (*stream_set_param) (void *data, uint32_t stream_id,
102 uint32_t id, uint32_t flags,
103 const struct spa_pod *param);
104
105 int (*create_link) (void *data, const struct spa_dict *props);
106};
107
108#define PW_CLIENT_ENDPOINT_METHOD_ADD_LISTENER 0
109#define PW_CLIENT_ENDPOINT_METHOD_UPDATE 1
110#define PW_CLIENT_ENDPOINT_METHOD_STREAM_UPDATE 2
111#define PW_CLIENT_ENDPOINT_METHOD_NUM 3
112
114#define PW_VERSION_CLIENT_ENDPOINT_METHODS 0
115 uint32_t version;
117 int (*add_listener) (void *object,
118 struct spa_hook *listener,
119 const struct pw_client_endpoint_events *events,
120 void *data);
121
123 int (*update) (void *object,
124#define PW_CLIENT_ENDPOINT_UPDATE_PARAMS (1 << 0)
125#define PW_CLIENT_ENDPOINT_UPDATE_INFO (1 << 1)
126 uint32_t change_mask,
127 uint32_t n_params,
128 const struct spa_pod **params,
129 const struct pw_endpoint_info *info);
132 int (*stream_update) (void *object,
133 uint32_t stream_id,
134#define PW_CLIENT_ENDPOINT_STREAM_UPDATE_PARAMS (1 << 0)
135#define PW_CLIENT_ENDPOINT_STREAM_UPDATE_INFO (1 << 1)
136#define PW_CLIENT_ENDPOINT_STREAM_UPDATE_DESTROYED (1 << 2)
137 uint32_t change_mask,
138 uint32_t n_params,
139 const struct spa_pod **params,
140 const struct pw_endpoint_stream_info *info);
142
143#define pw_client_endpoint_method(o,method,version,...) \
144({ \
145 int _res = -ENOTSUP; \
146 spa_interface_call_res((struct spa_interface*)o, \
147 struct pw_client_endpoint_methods, _res, \
148 method, version, ##__VA_ARGS__); \
149 _res; \
150})
151
152#define pw_client_endpoint_add_listener(o,...) pw_client_endpoint_method(o,add_listener,0,__VA_ARGS__)
153#define pw_client_endpoint_update(o,...) pw_client_endpoint_method(o,update,0,__VA_ARGS__)
154#define pw_client_endpoint_stream_update(o,...) pw_client_endpoint_method(o,stream_update,0,__VA_ARGS__)
155
156#define PW_TYPE_INTERFACE_ClientSession PW_TYPE_INFO_INTERFACE_BASE "ClientSession"
157
158#define PW_VERSION_CLIENT_SESSION 0
159struct pw_client_session;
160
161#define PW_CLIENT_SESSION_EVENT_SET_PARAM 0
162#define PW_CLIENT_SESSION_EVENT_LINK_SET_PARAM 1
163#define PW_CLIENT_SESSION_EVENT_LINK_REQUEST_STATE 2
164#define PW_CLIENT_SESSION_EVENT_NUM 3
165
167#define PW_VERSION_CLIENT_SESSION_EVENTS 0
168 uint32_t version;
191 int (*set_param) (void *data,
192 uint32_t id, uint32_t flags,
193 const struct spa_pod *param);
215 int (*link_set_param) (void *data, uint32_t link_id,
216 uint32_t id, uint32_t flags,
217 const struct spa_pod *param);
218
219 int (*link_request_state) (void *data, uint32_t link_id, uint32_t state);
220};
221
222#define PW_CLIENT_SESSION_METHOD_ADD_LISTENER 0
223#define PW_CLIENT_SESSION_METHOD_UPDATE 1
224#define PW_CLIENT_SESSION_METHOD_LINK_UPDATE 2
225#define PW_CLIENT_SESSION_METHOD_NUM 3
226
228#define PW_VERSION_CLIENT_SESSION_METHODS 0
229 uint32_t version;
231 int (*add_listener) (void *object,
232 struct spa_hook *listener,
233 const struct pw_client_session_events *events,
234 void *data);
235
237 int (*update) (void *object,
238#define PW_CLIENT_SESSION_UPDATE_PARAMS (1 << 0)
239#define PW_CLIENT_SESSION_UPDATE_INFO (1 << 1)
240 uint32_t change_mask,
241 uint32_t n_params,
242 const struct spa_pod **params,
243 const struct pw_session_info *info);
244
246 int (*link_update) (void *object,
247 uint32_t link_id,
248#define PW_CLIENT_SESSION_LINK_UPDATE_PARAMS (1 << 0)
249#define PW_CLIENT_SESSION_LINK_UPDATE_INFO (1 << 1)
250#define PW_CLIENT_SESSION_LINK_UPDATE_DESTROYED (1 << 2)
251 uint32_t change_mask,
252 uint32_t n_params,
253 const struct spa_pod **params,
254 const struct pw_endpoint_link_info *info);
255};
257#define pw_client_session_method(o,method,version,...) \
258({ \
259 int _res = -ENOTSUP; \
260 spa_interface_call_res((struct spa_interface*)o, \
261 struct pw_client_session_methods, _res, \
262 method, version, ##__VA_ARGS__); \
263 _res; \
265
266#define pw_client_session_add_listener(o,...) pw_client_session_method(o,add_listener,0,__VA_ARGS__)
267#define pw_client_session_update(o,...) pw_client_session_method(o,update,0,__VA_ARGS__)
268#define pw_client_session_link_update(o,...) pw_client_session_method(o,link_update,0,__VA_ARGS__)
269
274#ifdef __cplusplus
275} /* extern "C" */
276#endif
277
278#endif /* PIPEWIRE_EXT_SESSION_MANAGER_IMPL_INTERFACES_H */
spa/utils/defs.h
int(* update)(void *object, #define PW_CLIENT_ENDPOINT_UPDATE_PARAMS #define PW_CLIENT_ENDPOINT_UPDATE_INFO uint32_t change_mask, uint32_t n_params, const struct spa_pod **params, const struct pw_endpoint_info *info)
Update endpoint information.
Definition impl-interfaces.h:141
int(* update)(void *object, #define PW_CLIENT_SESSION_UPDATE_PARAMS #define PW_CLIENT_SESSION_UPDATE_INFO uint32_t change_mask, uint32_t n_params, const struct spa_pod **params, const struct pw_session_info *info)
Update session information.
Definition impl-interfaces.h:279
int(* link_update)(void *object, uint32_t link_id, #define PW_CLIENT_SESSION_LINK_UPDATE_PARAMS #define PW_CLIENT_SESSION_LINK_UPDATE_INFO #define PW_CLIENT_SESSION_LINK_UPDATE_DESTROYED uint32_t change_mask, uint32_t n_params, const struct spa_pod **params, const struct pw_endpoint_link_info *info)
Update link information.
Definition impl-interfaces.h:290
int(* stream_update)(void *object, uint32_t stream_id, #define PW_CLIENT_ENDPOINT_STREAM_UPDATE_PARAMS #define PW_CLIENT_ENDPOINT_STREAM_UPDATE_INFO #define PW_CLIENT_ENDPOINT_STREAM_UPDATE_DESTROYED uint32_t change_mask, uint32_t n_params, const struct spa_pod **params, const struct pw_endpoint_stream_info *info)
Update stream information.
Definition impl-interfaces.h:152
spa/utils/hook.h
pipewire/extensions/session-manager/introspect.h
Definition impl-interfaces.h:47
int(* create_link)(void *data, const struct spa_dict *props)
Definition impl-interfaces.h:118
int(* set_session_id)(void *data, uint32_t session_id)
Sets the session id of the endpoint.
Definition impl-interfaces.h:67
int(* stream_set_param)(void *data, uint32_t stream_id, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on stream_id of endpoint.
Definition impl-interfaces.h:114
int(* set_param)(void *data, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set the configurable parameter in endpoint.
Definition impl-interfaces.h:90
uint32_t version
version of this structure
Definition impl-interfaces.h:50
Definition impl-interfaces.h:130
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_client_endpoint_events *events, void *data)
Definition impl-interfaces.h:135
uint32_t version
version of this structure
Definition impl-interfaces.h:133
Definition impl-interfaces.h:202
uint32_t version
version of this structure
Definition impl-interfaces.h:205
int(* set_param)(void *data, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set the configurable parameter in session.
Definition impl-interfaces.h:228
int(* link_request_state)(void *data, uint32_t link_id, uint32_t state)
Definition impl-interfaces.h:256
int(* link_set_param)(void *data, uint32_t link_id, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on link_id of session.
Definition impl-interfaces.h:252
Definition impl-interfaces.h:268
uint32_t version
version of this structure
Definition impl-interfaces.h:271
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_client_session_events *events, void *data)
Definition impl-interfaces.h:273
Definition introspect.h:50
Definition introspect.h:79
Definition introspect.h:33
Definition dict.h:39
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350
Definition pod.h:43