params: make method on node and port to enum params

Do not pass the params of the node in the node_info, instead,
make a method to enumerate the params. This makes it possible for
clients to only enumerate what they need and when they need it.
Improve introspection of a port, add the name and properties.
Add an enum_param method on the port that can be used to enumerate
port formats.
Change -monitor and -cli and add support for enum_params on the node
and port.
This commit is contained in:
Wim Taymans 2018-02-20 10:31:55 +01:00
parent a9a95a4205
commit 58667d6ced
14 changed files with 977 additions and 259 deletions

View file

@ -740,7 +740,16 @@ static struct pw_node *make_node(struct impl *impl, const struct pw_properties *
char node_name[128];
int i;
snprintf(node_name, sizeof(node_name), "system%d", impl->node_count++);
if ((alias = pw_properties_get(props, "alsa.device")) == NULL)
goto error;
snprintf(node_name, sizeof(node_name), "system_%s", alias);
for (i = 0; node_name[i]; i++) {
if (node_name[i] == ':')
node_name[i] = '_';
}
if ((alias = pw_properties_get(props, "alsa.card")) == NULL)
goto error;
node = pw_node_new(impl->core, node_name, NULL, sizeof(struct node));
if (node == NULL)
@ -755,9 +764,6 @@ static struct pw_node *make_node(struct impl *impl, const struct pw_properties *
n->buffer_size = 1024 / sizeof(float);
pw_node_set_implementation(node, &n->node_impl);
if ((alias = pw_properties_get(props, "alsa.card")) == NULL)
goto error;
p = make_port(n, direction, 0, 0, NULL);
if (p == NULL)
goto error_free_node;