core: load and add cpu detection support

This commit is contained in:
Wim Taymans 2018-12-17 13:26:04 +01:00
parent 9ca9fda253
commit e984c19f6c
2 changed files with 9 additions and 1 deletions

View file

@ -433,7 +433,9 @@ struct pw_core *pw_core_new(struct pw_loop *main_loop, struct pw_properties *pro
this->support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, this->main_loop->utils);
this->support[3] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, pw_log_get());
this->support[4] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DBus, impl->dbus_iface);
this->n_support = 5;
this->support[5] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_CPU,
pw_get_support_interface(SPA_TYPE_INTERFACE_CPU));
this->n_support = 6;
pw_data_loop_start(this->data_loop_impl);

View file

@ -442,6 +442,12 @@ void pw_init(int *argc, char **argv[])
SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, iface->iface);
pw_log_set(iface->iface);
}
iface = load_interface(plugin, "cpu", SPA_TYPE_INTERFACE_CPU, &info,
support->n_support, support->support);
if (iface != NULL) {
support->support[support->n_support++] =
SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_CPU, iface->iface);
}
pw_log_info("version %s", pw_get_library_version());
}