Make interface types a string

This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
This commit is contained in:
Wim Taymans 2019-12-19 13:15:10 +01:00
parent 9657486a81
commit f391353c7f
123 changed files with 791 additions and 1251 deletions

View file

@ -1090,21 +1090,10 @@ node_init(struct node *this,
const struct spa_support *support,
uint32_t n_support)
{
uint32_t i;
this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
this->data_loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DataLoop);
this->data_system = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DataSystem);
for (i = 0; i < n_support; i++) {
switch (support[i].type) {
case SPA_TYPE_INTERFACE_Log:
this->log = support[i].data;
break;
case SPA_TYPE_INTERFACE_DataLoop:
this->data_loop = support[i].data;
break;
case SPA_TYPE_INTERFACE_DataSystem:
this->data_system = support[i].data;
break;
}
}
if (this->data_loop == NULL) {
spa_log_error(this->log, "a data-loop is needed");
return -EINVAL;