mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: add property to make virtual nodes
Make a property to mark virtual nodes and use it to hide the client id from the sink-input/source-output info in pulse-server.
This commit is contained in:
parent
0e91233569
commit
7031471807
4 changed files with 17 additions and 2 deletions
|
|
@ -856,6 +856,16 @@ bool pw_manager_object_is_monitor(struct pw_manager_object *o)
|
|||
(strcmp(str, "Audio/Sink") == 0);
|
||||
}
|
||||
|
||||
bool pw_manager_object_is_virtual(struct pw_manager_object *o)
|
||||
{
|
||||
const char *str;
|
||||
struct pw_node_info *info;
|
||||
return strcmp(o->type, PW_TYPE_INTERFACE_Node) == 0 &&
|
||||
(info = o->info) != NULL && info->props != NULL &&
|
||||
(str = spa_dict_lookup(info->props, PW_KEY_NODE_VIRTUAL)) != NULL &&
|
||||
pw_properties_parse_bool(str);
|
||||
}
|
||||
|
||||
bool pw_manager_object_is_source_or_monitor(struct pw_manager_object *o)
|
||||
{
|
||||
return pw_manager_object_is_source(o) || pw_manager_object_is_monitor(o);
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ bool pw_manager_object_is_card(struct pw_manager_object *o);
|
|||
bool pw_manager_object_is_sink(struct pw_manager_object *o);
|
||||
bool pw_manager_object_is_source(struct pw_manager_object *o);
|
||||
bool pw_manager_object_is_monitor(struct pw_manager_object *o);
|
||||
bool pw_manager_object_is_virtual(struct pw_manager_object *o);
|
||||
bool pw_manager_object_is_source_or_monitor(struct pw_manager_object *o);
|
||||
bool pw_manager_object_is_sink_input(struct pw_manager_object *o);
|
||||
bool pw_manager_object_is_source_output(struct pw_manager_object *o);
|
||||
|
|
|
|||
|
|
@ -4166,7 +4166,8 @@ static int fill_sink_input_info(struct client *client, struct message *m,
|
|||
|
||||
if ((str = spa_dict_lookup(info->props, PW_KEY_MODULE_ID)) != NULL)
|
||||
module_id = (uint32_t)atoi(str);
|
||||
if ((str = spa_dict_lookup(info->props, PW_KEY_CLIENT_ID)) != NULL)
|
||||
if (!pw_manager_object_is_virtual(o) &&
|
||||
(str = spa_dict_lookup(info->props, PW_KEY_CLIENT_ID)) != NULL)
|
||||
client_id = (uint32_t)atoi(str);
|
||||
|
||||
collect_device_info(o, NULL, &dev_info);
|
||||
|
|
@ -4236,7 +4237,8 @@ static int fill_source_output_info(struct client *client, struct message *m,
|
|||
|
||||
if ((str = spa_dict_lookup(info->props, PW_KEY_MODULE_ID)) != NULL)
|
||||
module_id = (uint32_t)atoi(str);
|
||||
if ((str = spa_dict_lookup(info->props, PW_KEY_CLIENT_ID)) != NULL)
|
||||
if (!pw_manager_object_is_virtual(o) &&
|
||||
(str = spa_dict_lookup(info->props, PW_KEY_CLIENT_ID)) != NULL)
|
||||
client_id = (uint32_t)atoi(str);
|
||||
|
||||
collect_device_info(o, NULL, &dev_info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue