use spa_pod for control values

Pass a spa_pod as the control io area. The pod is not supposed to
change in structure, only the values do so we can achieve the same
kind of performance as passing a single value but still allow for
more complex io area layouts to be passed later.
This commit is contained in:
Wim Taymans 2017-11-23 12:39:53 +01:00
parent 2f66e17180
commit 4b84e34744
2 changed files with 20 additions and 9 deletions

View file

@ -890,12 +890,22 @@ impl_node_port_set_io(struct spa_node *node,
this->io = data;
else if (id == t->io.ControlRange)
this->io_range = data;
else if (id == t->io_prop_wave)
this->io_wave = data;
else if (id == t->io_prop_wave) {
if (SPA_POD_TYPE(data) == SPA_POD_TYPE_ID)
this->io_wave = &SPA_POD_VALUE(struct spa_pod_id, data);
else
return -EINVAL;
}
else if (id == t->io_prop_freq)
this->io_freq = data;
if (SPA_POD_TYPE(data) == SPA_POD_TYPE_DOUBLE)
this->io_freq = &SPA_POD_VALUE(struct spa_pod_double, data);
else
return -EINVAL;
else if (id == t->io_prop_volume)
this->io_volume = data;
if (SPA_POD_TYPE(data) == SPA_POD_TYPE_DOUBLE)
this->io_volume = &SPA_POD_VALUE(struct spa_pod_double, data);
else
return -EINVAL;
else
return -ENOENT;