Loading...
Searching...
No Matches
interfaces.h
Go to the documentation of this file.
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2019 Collabora Ltd. */
/* @author George Kiagiadakis <george.kiagiadakis@collabora.com> */
/* SPDX-License-Identifier: MIT */
#ifndef PIPEWIRE_EXT_SESSION_MANAGER_INTERFACES_H
#define PIPEWIRE_EXT_SESSION_MANAGER_INTERFACES_H
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#include "introspect.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PW_TYPE_INTERFACE_Session PW_TYPE_INFO_INTERFACE_BASE "Session"
#define PW_SESSION_PERM_MASK PW_PERM_RWX
#define PW_VERSION_SESSION 0
struct pw_session;
#define PW_TYPE_INTERFACE_Endpoint PW_TYPE_INFO_INTERFACE_BASE "Endpoint"
#define PW_ENDPOINT_PERM_MASK PW_PERM_RWX
#define PW_VERSION_ENDPOINT 0
struct pw_endpoint;
#define PW_TYPE_INTERFACE_EndpointStream PW_TYPE_INFO_INTERFACE_BASE "EndpointStream"
#define PW_ENDPOINT_STREAM_PERM_MASK PW_PERM_RWX
#define PW_VERSION_ENDPOINT_STREAM 0
struct pw_endpoint_stream;
#define PW_TYPE_INTERFACE_EndpointLink PW_TYPE_INFO_INTERFACE_BASE "EndpointLink"
#define PW_ENDPOINT_LINK_PERM_MASK PW_PERM_RWX
#define PW_VERSION_ENDPOINT_LINK 0
struct pw_endpoint_link;
/* Session */
#define PW_SESSION_EVENT_INFO 0
#define PW_SESSION_EVENT_PARAM 1
#define PW_SESSION_EVENT_NUM 2
struct pw_session_events {
#define PW_VERSION_SESSION_EVENTS 0
uint32_t version;
void (*info) (void *data, const struct pw_session_info *info);
void (*param) (void *data, int seq,
uint32_t id, uint32_t index, uint32_t next,
const struct spa_pod *param);
};
#define PW_SESSION_METHOD_ADD_LISTENER 0
#define PW_SESSION_METHOD_SUBSCRIBE_PARAMS 1
#define PW_SESSION_METHOD_ENUM_PARAMS 2
#define PW_SESSION_METHOD_SET_PARAM 3
#define PW_SESSION_METHOD_CREATE_LINK 4
#define PW_SESSION_METHOD_NUM 5
struct pw_session_methods {
#define PW_VERSION_SESSION_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_session_events *events,
void *data);
int (*subscribe_params) (void *object, uint32_t *ids, uint32_t n_ids);
* \param start the start index or 0 for the first param
* \param num the maximum number of params to retrieve
* \param filter a param filter or NULL
*
* This requires X permissions.
*/
int (*enum_params) (void *object, int seq,
uint32_t id, uint32_t start, uint32_t num,
const struct spa_pod *filter);
int (*set_param) (void *object, uint32_t id, uint32_t flags,
const struct spa_pod *param);
};
#define pw_session_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_session_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_session_add_listener(c,...) pw_session_method(c,add_listener,0,__VA_ARGS__)
#define pw_session_subscribe_params(c,...) pw_session_method(c,subscribe_params,0,__VA_ARGS__)
#define pw_session_enum_params(c,...) pw_session_method(c,enum_params,0,__VA_ARGS__)
#define pw_session_set_param(c,...) pw_session_method(c,set_param,0,__VA_ARGS__)
/* Endpoint */
#define PW_ENDPOINT_EVENT_INFO 0
#define PW_ENDPOINT_EVENT_PARAM 1
#define PW_ENDPOINT_EVENT_NUM 2
struct pw_endpoint_events {
#define PW_VERSION_ENDPOINT_EVENTS 0
uint32_t version;
void (*info) (void *data, const struct pw_endpoint_info *info);
void (*param) (void *data, int seq,
uint32_t id, uint32_t index, uint32_t next,
const struct spa_pod *param);
};
#define PW_ENDPOINT_METHOD_ADD_LISTENER 0
#define PW_ENDPOINT_METHOD_SUBSCRIBE_PARAMS 1
#define PW_ENDPOINT_METHOD_ENUM_PARAMS 2
#define PW_ENDPOINT_METHOD_SET_PARAM 3
#define PW_ENDPOINT_METHOD_CREATE_LINK 4
#define PW_ENDPOINT_METHOD_NUM 5
struct pw_endpoint_methods {
#define PW_VERSION_ENDPOINT_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_endpoint_events *events,
void *data);
int (*subscribe_params) (void *object, uint32_t *ids, uint32_t n_ids);
int (*enum_params) (void *object, int seq,
uint32_t id, uint32_t start, uint32_t num,
const struct spa_pod *filter);
int (*set_param) (void *object, uint32_t id, uint32_t flags,
const struct spa_pod *param);
int (*create_link) (void *object, const struct spa_dict *props);
};
#define pw_endpoint_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_endpoint_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_endpoint_add_listener(c,...) pw_endpoint_method(c,add_listener,0,__VA_ARGS__)
#define pw_endpoint_subscribe_params(c,...) pw_endpoint_method(c,subscribe_params,0,__VA_ARGS__)
#define pw_endpoint_enum_params(c,...) pw_endpoint_method(c,enum_params,0,__VA_ARGS__)
#define pw_endpoint_set_param(c,...) pw_endpoint_method(c,set_param,0,__VA_ARGS__)
#define pw_endpoint_create_link(c,...) pw_endpoint_method(c,create_link,0,__VA_ARGS__)
/* Endpoint Stream */
#define PW_ENDPOINT_STREAM_EVENT_INFO 0
#define PW_ENDPOINT_STREAM_EVENT_PARAM 1
#define PW_ENDPOINT_STREAM_EVENT_NUM 2
struct pw_endpoint_stream_events {
#define PW_VERSION_ENDPOINT_STREAM_EVENTS 0
uint32_t version;
void (*info) (void *data, const struct pw_endpoint_stream_info *info);
void (*param) (void *data, int seq,
uint32_t id, uint32_t index, uint32_t next,
const struct spa_pod *param);
};
#define PW_ENDPOINT_STREAM_METHOD_ADD_LISTENER 0
#define PW_ENDPOINT_STREAM_METHOD_SUBSCRIBE_PARAMS 1
#define PW_ENDPOINT_STREAM_METHOD_ENUM_PARAMS 2
#define PW_ENDPOINT_STREAM_METHOD_SET_PARAM 3
#define PW_ENDPOINT_STREAM_METHOD_NUM 4
struct pw_endpoint_stream_methods {
#define PW_VERSION_ENDPOINT_STREAM_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_endpoint_stream_events *events,
void *data);
int (*subscribe_params) (void *object, uint32_t *ids, uint32_t n_ids);
* \param start the start index or 0 for the first param
* \param num the maximum number of params to retrieve
* \param filter a param filter or NULL
*
* This requires X permissions.
*/
int (*enum_params) (void *object, int seq,
uint32_t id, uint32_t start, uint32_t num,
const struct spa_pod *filter);
int (*set_param) (void *object, uint32_t id, uint32_t flags,
const struct spa_pod *param);
};
#define pw_endpoint_stream_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_endpoint_stream_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_endpoint_stream_add_listener(c,...) pw_endpoint_stream_method(c,add_listener,0,__VA_ARGS__)
#define pw_endpoint_stream_subscribe_params(c,...) pw_endpoint_stream_method(c,subscribe_params,0,__VA_ARGS__)
#define pw_endpoint_stream_enum_params(c,...) pw_endpoint_stream_method(c,enum_params,0,__VA_ARGS__)
#define pw_endpoint_stream_set_param(c,...) pw_endpoint_stream_method(c,set_param,0,__VA_ARGS__)
/* Endpoint Link */
#define PW_ENDPOINT_LINK_EVENT_INFO 0
#define PW_ENDPOINT_LINK_EVENT_PARAM 1
#define PW_ENDPOINT_LINK_EVENT_NUM 2
struct pw_endpoint_link_events {
#define PW_VERSION_ENDPOINT_LINK_EVENTS 0
uint32_t version;
void (*info) (void *data, const struct pw_endpoint_link_info *info);
void (*param) (void *data, int seq,
uint32_t id, uint32_t index, uint32_t next,
const struct spa_pod *param);
};
#define PW_ENDPOINT_LINK_METHOD_ADD_LISTENER 0
#define PW_ENDPOINT_LINK_METHOD_SUBSCRIBE_PARAMS 1
#define PW_ENDPOINT_LINK_METHOD_ENUM_PARAMS 2
#define PW_ENDPOINT_LINK_METHOD_SET_PARAM 3
#define PW_ENDPOINT_LINK_METHOD_REQUEST_STATE 4
#define PW_ENDPOINT_LINK_METHOD_DESTROY 5
#define PW_ENDPOINT_LINK_METHOD_NUM 6
struct pw_endpoint_link_methods {
#define PW_VERSION_ENDPOINT_LINK_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_endpoint_link_events *events,
void *data);
* \param ids an array of param ids
* \param n_ids the number of ids in \a ids
*
* This requires X permissions.
*/
int (*subscribe_params) (void *object, uint32_t *ids, uint32_t n_ids);
int (*enum_params) (void *object, int seq,
uint32_t id, uint32_t start, uint32_t num,
const struct spa_pod *filter);
*
* This requires X and W permissions.
*/
int (*set_param) (void *object, uint32_t id, uint32_t flags,
const struct spa_pod *param);
int (*request_state) (void *object, enum pw_endpoint_link_state state);
};
#define pw_endpoint_link_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_endpoint_link_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_endpoint_link_add_listener(c,...) pw_endpoint_link_method(c,add_listener,0,__VA_ARGS__)
#define pw_endpoint_link_subscribe_params(c,...) pw_endpoint_link_method(c,subscribe_params,0,__VA_ARGS__)
#define pw_endpoint_link_enum_params(c,...) pw_endpoint_link_method(c,enum_params,0,__VA_ARGS__)
#define pw_endpoint_link_set_param(c,...) pw_endpoint_link_method(c,set_param,0,__VA_ARGS__)
#define pw_endpoint_link_request_state(c,...) pw_endpoint_link_method(c,request_state,0,__VA_ARGS__)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* PIPEWIRE_EXT_SESSION_MANAGER_INTERFACES_H */
defs.h
spa/utils/defs.h
seq
uint32_t int seq
Definition core.h:432
id
uint32_t id
Definition core.h:432
pw_endpoint_link_state
pw_endpoint_link_state
Definition introspect.h:26
hook.h
spa/utils/hook.h
introspect.h
pipewire/extensions/session-manager/introspect.h
pw_endpoint_events
Definition interfaces.h:199
pw_endpoint_info
Definition introspect.h:50
pw_endpoint_link_events
Definition interfaces.h:459
pw_endpoint_link_events::param
void(* param)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a endpoint link param.
Definition interfaces.h:482
pw_endpoint_link_info
Definition introspect.h:101
pw_endpoint_link_methods
Definition interfaces.h:502
pw_endpoint_link_methods::set_param
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the link.
Definition interfaces.h:552
pw_endpoint_link_methods::request_state
int(* request_state)(void *object, enum pw_endpoint_link_state state)
Request a state on the link.
Definition interfaces.h:560
pw_endpoint_link_methods::subscribe_params
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition interfaces.h:523
pw_endpoint_link
pw_endpoint_methods
Definition interfaces.h:240
pw_endpoint_methods::version
uint32_t version
version of this structure
Definition interfaces.h:243
pw_endpoint_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_endpoint_events *events, void *data)
Definition interfaces.h:245
pw_endpoint_methods::subscribe_params
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition interfaces.h:261
pw_endpoint_methods::create_link
int(* create_link)(void *object, const struct spa_dict *props)
Create a link.
Definition interfaces.h:298
pw_endpoint_methods::set_param
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the endpoint.
Definition interfaces.h:290
pw_endpoint_stream_events
Definition interfaces.h:335
pw_endpoint_stream_events::param
void(* param)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a endpoint stream param.
Definition interfaces.h:358
pw_endpoint_stream_info
Definition introspect.h:79
pw_endpoint_stream_methods
Definition interfaces.h:374
pw_endpoint_stream_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_endpoint_stream_events *events, void *data)
Definition interfaces.h:379
pw_endpoint_stream_methods::set_param
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the stream.
Definition interfaces.h:424
pw_endpoint_stream_methods::version
uint32_t version
version of this structure
Definition interfaces.h:377
pw_endpoint_stream_methods::subscribe_params
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition interfaces.h:395
pw_endpoint_stream
pw_endpoint
pw_session_events
Definition interfaces.h:72
pw_session_events::param
void(* param)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a session param.
Definition interfaces.h:95
pw_session_events::version
uint32_t version
version of this structure
Definition interfaces.h:75
pw_session_info
Definition introspect.h:33
pw_session_methods
Definition interfaces.h:113
pw_session_methods::version
uint32_t version
version of this structure
Definition interfaces.h:116
pw_session_methods::set_param
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the session.
Definition interfaces.h:163
pw_session_methods::subscribe_params
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition interfaces.h:134
pw_session_methods::enum_params
int(* enum_params)(void *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
Enumerate session parameters.
Definition interfaces.h:150
pw_session_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_session_events *events, void *data)
Definition interfaces.h:118
pw_session
spa_dict
Definition dict.h:51
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427
spa_pod
Definition pod.h:57