node: Introduce pa_node

This commit adds very basic node objects to the core. This is just
a starting point, the nodes don't do anything useful yet.

A node represents a "routing endpoint" - the purpose is to make
routing easier. There are input nodes and output nodes, which can be
connected together. Generally speaking, sources and sink inputs map to
input nodes and sinks and source outputs map to output nodes. The
nodes form a new logical routing layer, which is an addition, not
replacement, to the current "low level" layer of sinks, sink inputs
and so on.

One goal is to be able to easily route any input to any output. For
example, with the node interface it should be easy to route a source
to a sink, without needing to care about the details, such as setting
up module-loopback. Routing sink inputs to source outputs should be
possible too, perhaps causing a null sink to be created between the
streams.

Another goal is to support new kinds of routing endpoints
that are not well suited to be implemented as sinks, sources or
streams. One example would be audio paths that exist in hardware only
(like cellular audio in many phone designs) that still have some
routing options. Another example would be a "gateway node" that makes
streams go to a remote PulseAudio as separate streams. The gateway
node implementation could dynamically create private tunnel sinks for
each stream.

In this first version the nodes have very few attributes, but the
intention is to add as much attributes as necessary for routing policy
modules to make good automatic routing decisions.

This patch is based on work by Janos Kovacs.
This commit is contained in:
Tanu Kaskinen 2013-07-03 14:09:04 +03:00
parent 4d638b5ffd
commit 3f2eb1e09f
7 changed files with 259 additions and 3 deletions

View file

@ -99,6 +99,7 @@ pa_core* pa_core_new(pa_mainloop_api *m, bool shared, size_t shm_size) {
c->source_outputs = pa_idxset_new(NULL, NULL);
c->modules = pa_idxset_new(NULL, NULL);
c->scache = pa_idxset_new(NULL, NULL);
c->nodes = pa_idxset_new(NULL, NULL);
c->namereg = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
c->shared = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);