mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pw_endpoint_link_proxy -> pw_endpoint_link
This commit is contained in:
parent
94ed9c8e38
commit
3c737cf39c
4 changed files with 59 additions and 59 deletions
|
|
@ -841,8 +841,8 @@ static void endpoint_link_event_info(void *object, const struct pw_endpoint_link
|
|||
pw_proxy_sync(link->obj.proxy, 1);
|
||||
}
|
||||
|
||||
static const struct pw_endpoint_link_proxy_events endpoint_link_events = {
|
||||
PW_VERSION_ENDPOINT_LINK_PROXY_EVENTS,
|
||||
static const struct pw_endpoint_link_events endpoint_link_events = {
|
||||
PW_VERSION_ENDPOINT_LINK_EVENTS,
|
||||
.info = endpoint_link_event_info,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ struct pw_session_proxy;
|
|||
struct pw_endpoint_proxy;
|
||||
#define PW_VERSION_ENDPOINT_STREAM_PROXY 0
|
||||
struct pw_endpoint_stream_proxy;
|
||||
#define PW_VERSION_ENDPOINT_LINK_PROXY 0
|
||||
struct pw_endpoint_link_proxy;
|
||||
#define PW_VERSION_ENDPOINT_LINK 0
|
||||
struct pw_endpoint_link;
|
||||
|
||||
/* Session */
|
||||
|
||||
|
|
@ -352,12 +352,12 @@ struct pw_endpoint_stream_proxy_methods {
|
|||
|
||||
/* Endpoint Link */
|
||||
|
||||
#define PW_ENDPOINT_LINK_PROXY_EVENT_INFO 0
|
||||
#define PW_ENDPOINT_LINK_PROXY_EVENT_PARAM 1
|
||||
#define PW_ENDPOINT_LINK_PROXY_EVENT_NUM 2
|
||||
#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_proxy_events {
|
||||
#define PW_VERSION_ENDPOINT_LINK_PROXY_EVENTS 0
|
||||
struct pw_endpoint_link_events {
|
||||
#define PW_VERSION_ENDPOINT_LINK_EVENTS 0
|
||||
uint32_t version; /**< version of this structure */
|
||||
|
||||
/**
|
||||
|
|
@ -383,21 +383,21 @@ struct pw_endpoint_link_proxy_events {
|
|||
const struct spa_pod *param);
|
||||
};
|
||||
|
||||
#define PW_ENDPOINT_LINK_PROXY_METHOD_ADD_LISTENER 0
|
||||
#define PW_ENDPOINT_LINK_PROXY_METHOD_SUBSCRIBE_PARAMS 1
|
||||
#define PW_ENDPOINT_LINK_PROXY_METHOD_ENUM_PARAMS 2
|
||||
#define PW_ENDPOINT_LINK_PROXY_METHOD_SET_PARAM 3
|
||||
#define PW_ENDPOINT_LINK_PROXY_METHOD_REQUEST_STATE 4
|
||||
#define PW_ENDPOINT_LINK_PROXY_METHOD_DESTROY 5
|
||||
#define PW_ENDPOINT_LINK_PROXY_METHOD_NUM 6
|
||||
#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_proxy_methods {
|
||||
#define PW_VERSION_ENDPOINT_LINK_PROXY_METHODS 0
|
||||
struct pw_endpoint_link_methods {
|
||||
#define PW_VERSION_ENDPOINT_LINK_METHODS 0
|
||||
uint32_t version; /**< version of this structure */
|
||||
|
||||
int (*add_listener) (void *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_endpoint_link_proxy_events *events,
|
||||
const struct pw_endpoint_link_events *events,
|
||||
void *data);
|
||||
|
||||
/**
|
||||
|
|
@ -440,20 +440,20 @@ struct pw_endpoint_link_proxy_methods {
|
|||
int (*request_state) (void *object, enum pw_endpoint_link_state state);
|
||||
};
|
||||
|
||||
#define pw_endpoint_link_proxy_method(o,method,version,...) \
|
||||
#define pw_endpoint_link_method(o,method,version,...) \
|
||||
({ \
|
||||
int _res = -ENOTSUP; \
|
||||
spa_interface_call_res((struct spa_interface*)o, \
|
||||
struct pw_endpoint_link_proxy_methods, _res, \
|
||||
struct pw_endpoint_link_methods, _res, \
|
||||
method, version, ##__VA_ARGS__); \
|
||||
_res; \
|
||||
})
|
||||
|
||||
#define pw_endpoint_link_proxy_add_listener(c,...) pw_endpoint_link_proxy_method(c,add_listener,0,__VA_ARGS__)
|
||||
#define pw_endpoint_link_proxy_subscribe_params(c,...) pw_endpoint_link_proxy_method(c,subscribe_params,0,__VA_ARGS__)
|
||||
#define pw_endpoint_link_proxy_enum_params(c,...) pw_endpoint_link_proxy_method(c,enum_params,0,__VA_ARGS__)
|
||||
#define pw_endpoint_link_proxy_set_param(c,...) pw_endpoint_link_proxy_method(c,set_param,0,__VA_ARGS__)
|
||||
#define pw_endpoint_link_proxy_request_state(c,...) pw_endpoint_link_proxy_method(c,request_state,0,__VA_ARGS__)
|
||||
#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
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ struct resource_data {
|
|||
};
|
||||
|
||||
#define pw_endpoint_link_resource(r,m,v,...) \
|
||||
pw_resource_call(r,struct pw_endpoint_link_proxy_events,m,v,__VA_ARGS__)
|
||||
pw_resource_call(r,struct pw_endpoint_link_events,m,v,__VA_ARGS__)
|
||||
#define pw_endpoint_link_resource_info(r,...) \
|
||||
pw_endpoint_link_resource(r,info,0,__VA_ARGS__)
|
||||
#define pw_endpoint_link_resource_param(r,...) \
|
||||
|
|
@ -135,8 +135,8 @@ static int endpoint_link_request_state(void *object, enum pw_endpoint_link_state
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct pw_endpoint_link_proxy_methods methods = {
|
||||
PW_VERSION_ENDPOINT_LINK_PROXY_METHODS,
|
||||
static const struct pw_endpoint_link_methods methods = {
|
||||
PW_VERSION_ENDPOINT_LINK_METHODS,
|
||||
.subscribe_params = endpoint_link_subscribe_params,
|
||||
.enum_params = endpoint_link_enum_params,
|
||||
.set_param = endpoint_link_set_param,
|
||||
|
|
@ -311,7 +311,7 @@ int endpoint_link_init(struct endpoint_link *this,
|
|||
|
||||
this->global = pw_global_new(context,
|
||||
PW_TYPE_INTERFACE_EndpointLink,
|
||||
PW_VERSION_ENDPOINT_LINK_PROXY,
|
||||
PW_VERSION_ENDPOINT_LINK,
|
||||
properties, endpoint_link_bind, this);
|
||||
if (!this->global)
|
||||
goto no_mem;
|
||||
|
|
|
|||
|
|
@ -968,7 +968,7 @@ static void endpoint_link_marshal_info (void *object,
|
|||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource,
|
||||
PW_ENDPOINT_LINK_PROXY_EVENT_INFO, NULL);
|
||||
PW_ENDPOINT_LINK_EVENT_INFO, NULL);
|
||||
|
||||
marshal_pw_endpoint_link_info(b, info);
|
||||
|
||||
|
|
@ -983,7 +983,7 @@ static void endpoint_link_marshal_param (void *object, int seq, uint32_t id,
|
|||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource,
|
||||
PW_ENDPOINT_LINK_PROXY_EVENT_PARAM, NULL);
|
||||
PW_ENDPOINT_LINK_EVENT_PARAM, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(seq),
|
||||
|
|
@ -997,7 +997,7 @@ static void endpoint_link_marshal_param (void *object, int seq, uint32_t id,
|
|||
|
||||
static int endpoint_link_marshal_add_listener(void *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_endpoint_link_proxy_events *events,
|
||||
const struct pw_endpoint_link_events *events,
|
||||
void *data)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
|
|
@ -1012,7 +1012,7 @@ static int endpoint_link_marshal_subscribe_params(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy,
|
||||
PW_ENDPOINT_LINK_PROXY_METHOD_SUBSCRIBE_PARAMS, NULL);
|
||||
PW_ENDPOINT_LINK_METHOD_SUBSCRIBE_PARAMS, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id, n_ids, ids));
|
||||
|
|
@ -1030,7 +1030,7 @@ static int endpoint_link_marshal_enum_params(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy,
|
||||
PW_ENDPOINT_LINK_PROXY_METHOD_ENUM_PARAMS, &msg);
|
||||
PW_ENDPOINT_LINK_METHOD_ENUM_PARAMS, &msg);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(SPA_RESULT_RETURN_ASYNC(msg->seq)),
|
||||
|
|
@ -1050,7 +1050,7 @@ static int endpoint_link_marshal_set_param(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy,
|
||||
PW_ENDPOINT_LINK_PROXY_METHOD_SET_PARAM, NULL);
|
||||
PW_ENDPOINT_LINK_METHOD_SET_PARAM, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Id(id),
|
||||
|
|
@ -1067,7 +1067,7 @@ static int endpoint_link_marshal_request_state(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy,
|
||||
PW_ENDPOINT_LINK_PROXY_METHOD_REQUEST_STATE, NULL);
|
||||
PW_ENDPOINT_LINK_METHOD_REQUEST_STATE, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b, SPA_POD_Int(state));
|
||||
|
||||
|
|
@ -1087,7 +1087,7 @@ static int endpoint_link_demarshal_info(void *object,
|
|||
|
||||
demarshal_pw_endpoint_link_info(&prs, &f, &info);
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_endpoint_link_proxy_events,
|
||||
return pw_proxy_notify(proxy, struct pw_endpoint_link_events,
|
||||
info, 0, &info);
|
||||
}
|
||||
|
||||
|
|
@ -1109,7 +1109,7 @@ static int endpoint_link_demarshal_param(void *object,
|
|||
SPA_POD_Pod(¶m)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_endpoint_link_proxy_events,
|
||||
return pw_proxy_notify(proxy, struct pw_endpoint_link_events,
|
||||
param, 0, seq, id, index, next, param);
|
||||
}
|
||||
|
||||
|
|
@ -1129,7 +1129,7 @@ static int endpoint_link_demarshal_subscribe_params(void *object,
|
|||
if (ctype != SPA_TYPE_Id)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_proxy_methods,
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_methods,
|
||||
subscribe_params, 0, ids, n_ids);
|
||||
}
|
||||
|
||||
|
|
@ -1151,7 +1151,7 @@ static int endpoint_link_demarshal_enum_params(void *object,
|
|||
SPA_POD_Pod(&filter)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_proxy_methods,
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_methods,
|
||||
enum_params, 0, seq, id, index, num, filter);
|
||||
}
|
||||
|
||||
|
|
@ -1170,7 +1170,7 @@ static int endpoint_link_demarshal_set_param(void *object,
|
|||
SPA_POD_Pod(¶m)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_proxy_methods,
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_methods,
|
||||
set_param, 0, id, flags, param);
|
||||
}
|
||||
|
||||
|
|
@ -1186,25 +1186,25 @@ static int endpoint_link_demarshal_request_state(void *object,
|
|||
SPA_POD_Int(&state)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_proxy_methods,
|
||||
return pw_resource_notify(resource, struct pw_endpoint_link_methods,
|
||||
request_state, 0, state);
|
||||
}
|
||||
|
||||
static const struct pw_endpoint_link_proxy_events pw_protocol_native_endpoint_link_event_marshal = {
|
||||
PW_VERSION_ENDPOINT_LINK_PROXY_EVENTS,
|
||||
static const struct pw_endpoint_link_events pw_protocol_native_endpoint_link_event_marshal = {
|
||||
PW_VERSION_ENDPOINT_LINK_EVENTS,
|
||||
.info = endpoint_link_marshal_info,
|
||||
.param = endpoint_link_marshal_param,
|
||||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal
|
||||
pw_protocol_native_endpoint_link_event_demarshal[PW_ENDPOINT_LINK_PROXY_EVENT_NUM] =
|
||||
pw_protocol_native_endpoint_link_event_demarshal[PW_ENDPOINT_LINK_EVENT_NUM] =
|
||||
{
|
||||
[PW_ENDPOINT_LINK_PROXY_EVENT_INFO] = { endpoint_link_demarshal_info, 0 },
|
||||
[PW_ENDPOINT_LINK_PROXY_EVENT_PARAM] = { endpoint_link_demarshal_param, 0 },
|
||||
[PW_ENDPOINT_LINK_EVENT_INFO] = { endpoint_link_demarshal_info, 0 },
|
||||
[PW_ENDPOINT_LINK_EVENT_PARAM] = { endpoint_link_demarshal_param, 0 },
|
||||
};
|
||||
|
||||
static const struct pw_endpoint_link_proxy_methods pw_protocol_native_endpoint_link_method_marshal = {
|
||||
PW_VERSION_ENDPOINT_LINK_PROXY_METHODS,
|
||||
static const struct pw_endpoint_link_methods pw_protocol_native_endpoint_link_method_marshal = {
|
||||
PW_VERSION_ENDPOINT_LINK_METHODS,
|
||||
.add_listener = endpoint_link_marshal_add_listener,
|
||||
.subscribe_params = endpoint_link_marshal_subscribe_params,
|
||||
.enum_params = endpoint_link_marshal_enum_params,
|
||||
|
|
@ -1213,21 +1213,21 @@ static const struct pw_endpoint_link_proxy_methods pw_protocol_native_endpoint_l
|
|||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal
|
||||
pw_protocol_native_endpoint_link_method_demarshal[PW_ENDPOINT_LINK_PROXY_METHOD_NUM] =
|
||||
pw_protocol_native_endpoint_link_method_demarshal[PW_ENDPOINT_LINK_METHOD_NUM] =
|
||||
{
|
||||
[PW_ENDPOINT_LINK_PROXY_METHOD_ADD_LISTENER] = { NULL, 0 },
|
||||
[PW_ENDPOINT_LINK_PROXY_METHOD_SUBSCRIBE_PARAMS] = { endpoint_link_demarshal_subscribe_params, 0 },
|
||||
[PW_ENDPOINT_LINK_PROXY_METHOD_ENUM_PARAMS] = { endpoint_link_demarshal_enum_params, 0 },
|
||||
[PW_ENDPOINT_LINK_PROXY_METHOD_SET_PARAM] = { endpoint_link_demarshal_set_param, PW_PERM_W },
|
||||
[PW_ENDPOINT_LINK_PROXY_METHOD_REQUEST_STATE] = { endpoint_link_demarshal_request_state, PW_PERM_W },
|
||||
[PW_ENDPOINT_LINK_METHOD_ADD_LISTENER] = { NULL, 0 },
|
||||
[PW_ENDPOINT_LINK_METHOD_SUBSCRIBE_PARAMS] = { endpoint_link_demarshal_subscribe_params, 0 },
|
||||
[PW_ENDPOINT_LINK_METHOD_ENUM_PARAMS] = { endpoint_link_demarshal_enum_params, 0 },
|
||||
[PW_ENDPOINT_LINK_METHOD_SET_PARAM] = { endpoint_link_demarshal_set_param, PW_PERM_W },
|
||||
[PW_ENDPOINT_LINK_METHOD_REQUEST_STATE] = { endpoint_link_demarshal_request_state, PW_PERM_W },
|
||||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_endpoint_link_marshal = {
|
||||
PW_TYPE_INTERFACE_EndpointLink,
|
||||
PW_VERSION_ENDPOINT_LINK_PROXY,
|
||||
PW_VERSION_ENDPOINT_LINK,
|
||||
0,
|
||||
PW_ENDPOINT_LINK_PROXY_METHOD_NUM,
|
||||
PW_ENDPOINT_LINK_PROXY_EVENT_NUM,
|
||||
PW_ENDPOINT_LINK_METHOD_NUM,
|
||||
PW_ENDPOINT_LINK_EVENT_NUM,
|
||||
&pw_protocol_native_endpoint_link_method_marshal,
|
||||
&pw_protocol_native_endpoint_link_method_demarshal,
|
||||
&pw_protocol_native_endpoint_link_event_marshal,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue