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:
Wim Taymans 2021-04-20 21:05:59 +02:00
parent 0e91233569
commit 7031471807
4 changed files with 17 additions and 2 deletions

View file

@ -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);