interfaces.h
Go to the documentation of this file.
/* PipeWire
*
* Copyright © 2019 Collabora Ltd.
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#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_VERSION_SESSION 0
struct pw_session;
#define PW_TYPE_INTERFACE_Endpoint PW_TYPE_INFO_INTERFACE_BASE "Endpoint"
#define PW_VERSION_ENDPOINT 0
struct pw_endpoint;
#define PW_TYPE_INTERFACE_EndpointStream PW_TYPE_INFO_INTERFACE_BASE "EndpointStream"
#define PW_VERSION_ENDPOINT_STREAM 0
struct pw_endpoint_stream;
#define PW_TYPE_INTERFACE_EndpointLink PW_TYPE_INFO_INTERFACE_BASE "EndpointLink"
#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 *object, const struct pw_session_info *info);
void (*param) (void *object, 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);
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 *object, const struct pw_endpoint_info *info);
void (*param) (void *object, 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 *object, const struct pw_endpoint_stream_info *info);
void (*param) (void *object, 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);
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 *object, const struct pw_endpoint_link_info *info);
void (*param) (void *object, 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);
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 (*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
pw_endpoint_link_state
pw_endpoint_link_state
Definition: introspect.h:46
hook.h
spa/utils/hook.h
introspect.h
pipewire/extensions/session-manager/introspect.h
pw_endpoint_events
Definition: interfaces.h:205
pw_endpoint_events::info
void(* info)(void *object, const struct pw_endpoint_info *info)
Notify endpoint info.
Definition: interfaces.h:215
pw_endpoint_events::param
void(* param)(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a endpoint param.
Definition: interfaces.h:228
pw_endpoint_events::version
uint32_t version
version of this structure
Definition: interfaces.h:208
pw_endpoint_info
Definition: introspect.h:70
pw_endpoint_info::id
uint32_t id
the endpoint id (global)
Definition: introspect.h:74
pw_endpoint_link_events
Definition: interfaces.h:448
pw_endpoint_link_events::param
void(* param)(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a endpoint link param.
Definition: interfaces.h:471
pw_endpoint_link_events::version
uint32_t version
version of this structure
Definition: interfaces.h:451
pw_endpoint_link_events::info
void(* info)(void *object, const struct pw_endpoint_link_info *info)
Notify endpoint link info.
Definition: interfaces.h:458
pw_endpoint_link_info
Definition: introspect.h:121
pw_endpoint_link_info::id
uint32_t id
the link id (global)
Definition: introspect.h:125
pw_endpoint_link_methods
Definition: interfaces.h:491
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:535
pw_endpoint_link_methods::request_state
int(* request_state)(void *object, enum pw_endpoint_link_state state)
Definition: interfaces.h:538
pw_endpoint_link_methods::version
uint32_t version
version of this structure
Definition: interfaces.h:494
pw_endpoint_link_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_endpoint_link_events *events, void *data)
Definition: interfaces.h:496
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:510
pw_endpoint_link_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 link parameters.
Definition: interfaces.h:524
pw_endpoint_link
pw_endpoint_methods
Definition: interfaces.h:246
pw_endpoint_methods::version
uint32_t version
version of this structure
Definition: interfaces.h:249
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:251
pw_endpoint_methods::subscribe_params
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition: interfaces.h:265
pw_endpoint_methods::create_link
int(* create_link)(void *object, const struct spa_dict *props)
Definition: interfaces.h:293
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_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 endpoint parameters.
Definition: interfaces.h:279
pw_endpoint_stream_events
Definition: interfaces.h:330
pw_endpoint_stream_events::version
uint32_t version
version of this structure
Definition: interfaces.h:333
pw_endpoint_stream_events::param
void(* param)(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a endpoint stream param.
Definition: interfaces.h:353
pw_endpoint_stream_events::info
void(* info)(void *object, const struct pw_endpoint_stream_info *info)
Notify endpoint stream info.
Definition: interfaces.h:340
pw_endpoint_stream_info
Definition: introspect.h:99
pw_endpoint_stream_info::id
uint32_t id
the stream id (local or global)
Definition: introspect.h:103
pw_endpoint_stream_methods
Definition: interfaces.h:369
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:374
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:413
pw_endpoint_stream_methods::version
uint32_t version
version of this structure
Definition: interfaces.h:372
pw_endpoint_stream_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 stream parameters.
Definition: interfaces.h:402
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:388
pw_endpoint_stream
pw_endpoint
pw_session_events
Definition: interfaces.h:84
pw_session_events::param
void(* param)(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a session param.
Definition: interfaces.h:107
pw_session_events::info
void(* info)(void *object, const struct pw_session_info *info)
Notify session info.
Definition: interfaces.h:94
pw_session_events::version
uint32_t version
version of this structure
Definition: interfaces.h:87
pw_session_info
Definition: introspect.h:53
pw_session_info::id
uint32_t id
the session id (global)
Definition: introspect.h:57
pw_session_methods
Definition: interfaces.h:125
pw_session_methods::version
uint32_t version
version of this structure
Definition: interfaces.h:128
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:169
pw_session_methods::subscribe_params
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition: interfaces.h:144
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:158
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:130
pw_session
spa_dict
Definition: dict.h:59
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342
spa_pod
Definition: pod.h:63