mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
add some more useful defines
Add define to match all ids for nodes and params. Add define for invalid permissions
This commit is contained in:
parent
cf53ededd0
commit
043e7f24fe
25 changed files with 50 additions and 50 deletions
|
|
@ -174,7 +174,7 @@ context_check_access(void *data, struct pw_impl_client *client)
|
|||
|
||||
granted:
|
||||
pw_log_debug("module %p: client %p access granted", impl, client);
|
||||
permissions[0] = PW_PERMISSION_INIT(-1, PW_PERM_RWX);
|
||||
permissions[0] = PW_PERMISSION_INIT(PW_ID_ANY, PW_PERM_RWX);
|
||||
pw_impl_client_update_permissions(client, 1, permissions);
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ static struct pw_impl_port *get_port(struct pw_impl_node *node, enum spa_directi
|
|||
struct pw_context *context = pw_impl_node_get_context(node);
|
||||
int res;
|
||||
|
||||
p = pw_impl_node_find_port(node, direction, SPA_ID_INVALID);
|
||||
p = pw_impl_node_find_port(node, direction, PW_ID_ANY);
|
||||
|
||||
if (p == NULL || pw_impl_port_is_linked(p)) {
|
||||
uint32_t port_id;
|
||||
|
|
@ -227,7 +227,7 @@ static void *create_object(void *_data,
|
|||
|
||||
input_node = pw_global_get_object(global);
|
||||
|
||||
if (output_port_id == SPA_ID_INVALID) {
|
||||
if (output_port_id == PW_ID_ANY) {
|
||||
outport = get_port(output_node, SPA_DIRECTION_OUTPUT);
|
||||
}
|
||||
else {
|
||||
|
|
@ -240,7 +240,7 @@ static void *create_object(void *_data,
|
|||
if (outport == NULL)
|
||||
goto error_output_port;
|
||||
|
||||
if (input_port_id == SPA_ID_INVALID)
|
||||
if (input_port_id == PW_ID_ANY)
|
||||
inport = get_port(input_node, SPA_DIRECTION_INPUT);
|
||||
else {
|
||||
global = pw_context_find_global(context, input_port_id);
|
||||
|
|
|
|||
|
|
@ -824,8 +824,7 @@ static int pw_protocol_native_connect_internal(struct pw_protocol_client *client
|
|||
pw_log_error("server %p: failed to create client: %m", s);
|
||||
goto error_close;
|
||||
}
|
||||
permissions[0].id = SPA_ID_INVALID;
|
||||
permissions[0].permissions = PW_PERM_RWX;
|
||||
permissions[0] = PW_PERMISSION_INIT(PW_ID_ANY, PW_PERM_RWX);
|
||||
pw_impl_client_update_permissions(c->client, 1, permissions);
|
||||
|
||||
res = pw_protocol_client_connect_fd(client, sv[1], true);
|
||||
|
|
|
|||
|
|
@ -1548,7 +1548,7 @@ static void client_marshal_permissions(void *object, uint32_t index, uint32_t n_
|
|||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_EVENT_PERMISSIONS, NULL);
|
||||
|
||||
for (i = 0; i < n_permissions; i++) {
|
||||
if (permissions[i].permissions != SPA_ID_INVALID)
|
||||
if (permissions[i].permissions != PW_PERM_INVALID)
|
||||
n++;
|
||||
}
|
||||
|
||||
|
|
@ -1558,7 +1558,7 @@ static void client_marshal_permissions(void *object, uint32_t index, uint32_t n_
|
|||
spa_pod_builder_int(b, n);
|
||||
|
||||
for (i = 0; i < n_permissions; i++) {
|
||||
if (permissions[i].permissions == SPA_ID_INVALID)
|
||||
if (permissions[i].permissions == PW_PERM_INVALID)
|
||||
continue;
|
||||
spa_pod_builder_int(b, permissions[i].id);
|
||||
spa_pod_builder_int(b, permissions[i].permissions);
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ struct pw_node_v0_methods {
|
|||
* Start enumeration of node parameters. For each param, a
|
||||
* param event will be emited.
|
||||
*
|
||||
* \param id the parameter id to enum or SPA_ID_INVALID for all
|
||||
* \param id the parameter id to enum or PW_ID_ANY for all
|
||||
* \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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue