mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
port: add port subscribe_params
This commit is contained in:
parent
ae7e60d790
commit
ca051282a4
5 changed files with 154 additions and 5 deletions
|
|
@ -1206,6 +1206,38 @@ static int port_demarshal_param(void *object, void *data, size_t size)
|
|||
seq, id, index, next, param);
|
||||
}
|
||||
|
||||
static int port_marshal_subscribe_params(void *object, uint32_t *ids, uint32_t n_ids)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_PORT_PROXY_METHOD_SUBSCRIBE_PARAMS, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id, n_ids, ids));
|
||||
|
||||
return pw_protocol_native_end_proxy(proxy, b);
|
||||
}
|
||||
|
||||
static int port_demarshal_subscribe_params(void *object, void *data, size_t size)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_parser prs;
|
||||
uint32_t csize, ctype, n_ids;
|
||||
uint32_t *ids;
|
||||
|
||||
spa_pod_parser_init(&prs, data, size);
|
||||
if (spa_pod_parser_get_struct(&prs,
|
||||
SPA_POD_Array(&csize, &ctype, &n_ids, &ids)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (ctype != SPA_TYPE_Id)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_do(resource, struct pw_port_proxy_methods, subscribe_params, 0,
|
||||
ids, n_ids);
|
||||
}
|
||||
|
||||
static int port_marshal_enum_params(void *object, int seq, uint32_t id,
|
||||
uint32_t index, uint32_t num, const struct spa_pod *filter)
|
||||
{
|
||||
|
|
@ -1839,10 +1871,12 @@ static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
|
|||
|
||||
static const struct pw_port_proxy_methods pw_protocol_native_port_method_marshal = {
|
||||
PW_VERSION_PORT_PROXY_METHODS,
|
||||
&port_marshal_subscribe_params,
|
||||
&port_marshal_enum_params,
|
||||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_port_method_demarshal[] = {
|
||||
{ &port_demarshal_subscribe_params, 0, },
|
||||
{ &port_demarshal_enum_params, 0, },
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue