]> git.alsa-project.org Git - alsa-lib.git/commit
topology: Look up references for an object based on its index
authorFuwei Tang <fuweix.tang@intel.com>
Thu, 13 Apr 2017 06:52:46 +0000 (14:52 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 21 Apr 2017 10:57:48 +0000 (12:57 +0200)
commita3b4bd2c8c42a187258ad1bd48f77e67b9bae41f
treeb8f8de17ee0d066e079662ca75c31e9fa9318075
parentaf231ea1db393da5bab07f609d1a8be8936791fd
topology: Look up references for an object based on its index

We can distinguish different use cases by the object index value, the default
value is 0, meaning applicable for all use cases, defined by macro "SND_TOLG_INDEX_ALL".
An element can only refer to other elements for "all" use cases or the same use
cases, i.e. it can only refer to elements with index value "SND_TOLG_INDEX_ALL"
or the same index value as itself.
The object list has been sorted in ascending order of index, so when we look up
a reference for an object, we traverse the object list it depends on, if we have
not found the reference until index of the object list is greater than index of
the object, we give up and return an error.

Signed-off-by: Fuwei Tang <fuweix.tang@intel.com>
Reviewed-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/topology.h
src/topology/ctl.c
src/topology/dapm.c
src/topology/data.c
src/topology/elem.c
src/topology/pcm.c
src/topology/tplg_local.h