impl-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_IMPL_INTERFACES_H
#define PIPEWIRE_EXT_SESSION_MANAGER_IMPL_INTERFACES_H
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#include <errno.h>
#include "introspect.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PW_TYPE_INTERFACE_ClientEndpoint PW_TYPE_INFO_INTERFACE_BASE "ClientEndpoint"
#define PW_VERSION_CLIENT_ENDPOINT 0
struct pw_client_endpoint;
#define PW_CLIENT_ENDPOINT_EVENT_SET_SESSION_ID 0
#define PW_CLIENT_ENDPOINT_EVENT_SET_PARAM 1
#define PW_CLIENT_ENDPOINT_EVENT_STREAM_SET_PARAM 2
#define PW_CLIENT_ENDPOINT_EVENT_CREATE_LINK 3
#define PW_CLIENT_ENDPOINT_EVENT_NUM 4
struct pw_client_endpoint_events {
#define PW_VERSION_CLIENT_ENDPOINT_EVENTS 0
uint32_t version;
int (*set_session_id) (void *object, uint32_t session_id);
int (*set_param) (void *object,
uint32_t id, uint32_t flags,
const struct spa_pod *param);
int (*stream_set_param) (void *object, uint32_t stream_id,
uint32_t id, uint32_t flags,
const struct spa_pod *param);
int (*create_link) (void *object, const struct spa_dict *props);
};
#define PW_CLIENT_ENDPOINT_METHOD_ADD_LISTENER 0
#define PW_CLIENT_ENDPOINT_METHOD_UPDATE 1
#define PW_CLIENT_ENDPOINT_METHOD_STREAM_UPDATE 2
#define PW_CLIENT_ENDPOINT_METHOD_NUM 3
struct pw_client_endpoint_methods {
#define PW_VERSION_CLIENT_ENDPOINT_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_client_endpoint_events *events,
void *data);
int (*update) (void *object,
#define PW_CLIENT_ENDPOINT_UPDATE_PARAMS (1 << 0)
#define PW_CLIENT_ENDPOINT_UPDATE_INFO (1 << 1)
uint32_t change_mask,
uint32_t n_params,
const struct spa_pod **params,
const struct pw_endpoint_info *info);
int (*stream_update) (void *object,
uint32_t stream_id,
#define PW_CLIENT_ENDPOINT_STREAM_UPDATE_PARAMS (1 << 0)
#define PW_CLIENT_ENDPOINT_STREAM_UPDATE_INFO (1 << 1)
#define PW_CLIENT_ENDPOINT_STREAM_UPDATE_DESTROYED (1 << 2)
uint32_t change_mask,
uint32_t n_params,
const struct spa_pod **params,
const struct pw_endpoint_stream_info *info);
};
#define pw_client_endpoint_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_client_endpoint_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_client_endpoint_add_listener(o,...) pw_client_endpoint_method(o,add_listener,0,__VA_ARGS__)
#define pw_client_endpoint_update(o,...) pw_client_endpoint_method(o,update,0,__VA_ARGS__)
#define pw_client_endpoint_stream_update(o,...) pw_client_endpoint_method(o,stream_update,0,__VA_ARGS__)
#define PW_TYPE_INTERFACE_ClientSession PW_TYPE_INFO_INTERFACE_BASE "ClientSession"
#define PW_VERSION_CLIENT_SESSION 0
struct pw_client_session;
#define PW_CLIENT_SESSION_EVENT_SET_PARAM 0
#define PW_CLIENT_SESSION_EVENT_LINK_SET_PARAM 1
#define PW_CLIENT_SESSION_EVENT_LINK_REQUEST_STATE 2
#define PW_CLIENT_SESSION_EVENT_NUM 3
struct pw_client_session_events {
#define PW_VERSION_CLIENT_SESSION_EVENTS 0
uint32_t version;
int (*set_param) (void *object,
uint32_t id, uint32_t flags,
const struct spa_pod *param);
int (*link_set_param) (void *object, uint32_t link_id,
uint32_t id, uint32_t flags,
const struct spa_pod *param);
int (*link_request_state) (void *object, uint32_t link_id, uint32_t state);
};
#define PW_CLIENT_SESSION_METHOD_ADD_LISTENER 0
#define PW_CLIENT_SESSION_METHOD_UPDATE 1
#define PW_CLIENT_SESSION_METHOD_LINK_UPDATE 2
#define PW_CLIENT_SESSION_METHOD_NUM 3
struct pw_client_session_methods {
#define PW_VERSION_CLIENT_SESSION_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_client_session_events *events,
void *data);
int (*update) (void *object,
#define PW_CLIENT_SESSION_UPDATE_PARAMS (1 << 0)
#define PW_CLIENT_SESSION_UPDATE_INFO (1 << 1)
uint32_t change_mask,
uint32_t n_params,
const struct spa_pod **params,
const struct pw_session_info *info);
int (*link_update) (void *object,
uint32_t link_id,
#define PW_CLIENT_SESSION_LINK_UPDATE_PARAMS (1 << 0)
#define PW_CLIENT_SESSION_LINK_UPDATE_INFO (1 << 1)
#define PW_CLIENT_SESSION_LINK_UPDATE_DESTROYED (1 << 2)
uint32_t change_mask,
uint32_t n_params,
const struct spa_pod **params,
const struct pw_endpoint_link_info *info);
};
#define pw_client_session_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_client_session_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_client_session_add_listener(o,...) pw_client_session_method(o,add_listener,0,__VA_ARGS__)
#define pw_client_session_update(o,...) pw_client_session_method(o,update,0,__VA_ARGS__)
#define pw_client_session_link_update(o,...) pw_client_session_method(o,link_update,0,__VA_ARGS__)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* PIPEWIRE_EXT_SESSION_MANAGER_IMPL_INTERFACES_H */
defs.h
spa/utils/defs.h
pw_client_endpoint_methods::update
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:161
pw_client_session_methods::update
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:299
pw_client_session_methods::link_update
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:310
pw_client_endpoint_methods::stream_update
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:172
hook.h
spa/utils/hook.h
introspect.h
pipewire/extensions/session-manager/introspect.h
pw_client_endpoint_events
Definition: impl-interfaces.h:67
pw_client_endpoint_events::stream_set_param
int(* stream_set_param)(void *object, 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:134
pw_client_endpoint_events::create_link
int(* create_link)(void *object, const struct spa_dict *props)
Definition: impl-interfaces.h:138
pw_client_endpoint_events::set_param
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set the configurable parameter in endpoint.
Definition: impl-interfaces.h:110
pw_client_endpoint_events::version
uint32_t version
version of this structure
Definition: impl-interfaces.h:70
pw_client_endpoint_events::set_session_id
int(* set_session_id)(void *object, uint32_t session_id)
Sets the session id of the endpoint.
Definition: impl-interfaces.h:87
pw_client_endpoint_methods
Definition: impl-interfaces.h:150
pw_client_endpoint_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_client_endpoint_events *events, void *data)
Definition: impl-interfaces.h:155
pw_client_endpoint_methods::version
uint32_t version
version of this structure
Definition: impl-interfaces.h:153
pw_client_endpoint
pw_client_session_events
Definition: impl-interfaces.h:222
pw_client_session_events::link_set_param
int(* link_set_param)(void *object, 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:272
pw_client_session_events::version
uint32_t version
version of this structure
Definition: impl-interfaces.h:225
pw_client_session_events::set_param
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set the configurable parameter in session.
Definition: impl-interfaces.h:248
pw_client_session_events::link_request_state
int(* link_request_state)(void *object, uint32_t link_id, uint32_t state)
Definition: impl-interfaces.h:276
pw_client_session_methods
Definition: impl-interfaces.h:288
pw_client_session_methods::version
uint32_t version
version of this structure
Definition: impl-interfaces.h:291
pw_client_session_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_client_session_events *events, void *data)
Definition: impl-interfaces.h:293
pw_client_session
pw_endpoint_info
Definition: introspect.h:70
pw_endpoint_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:91
pw_endpoint_info::n_params
uint32_t n_params
number of items in params
Definition: introspect.h:96
pw_endpoint_link_info
Definition: introspect.h:121
pw_endpoint_stream_info
Definition: introspect.h:99
pw_session_info
Definition: introspect.h:53
pw_session_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:64
pw_session_info::n_params
uint32_t n_params
number of items in params
Definition: introspect.h:67
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