stream: connect to source and sink

Stream: also connect to the right source, try to convert the name to
index when lookup fails, just like what pulseaudio does.
Implement more proplist functions, add some more info to the stream.
stream: handle NULL format
Improve introspection of the sink_input and source_output name, this
should be the media.name when possible.
This commit is contained in:
Wim Taymans 2018-12-04 11:48:15 +01:00
parent ad723e3793
commit 84a7bf671c
4 changed files with 89 additions and 27 deletions

View file

@ -97,6 +97,25 @@ struct global *pa_context_find_global(pa_context *c, uint32_t id)
return NULL;
}
struct global *pa_context_find_global_by_name(pa_context *c, uint32_t mask, const char *name)
{
struct global *g;
const char *str;
uint32_t id = atoi(name);
spa_list_for_each(g, &c->globals, link) {
if (!(g->mask & mask))
continue;
if (g->props != NULL &&
(str = pw_properties_get(g->props, "node.name")) != NULL &&
strcmp(str, name) == 0)
return g;
if (g->id == id)
return g;
}
return NULL;
}
struct global *pa_context_find_linked(pa_context *c, uint32_t idx)
{
struct global *g, *f;