From e984c19f6cb45d18e44ec7f42b9ed9b5e7f6b400 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 17 Dec 2018 13:26:04 +0100 Subject: [PATCH] core: load and add cpu detection support --- src/pipewire/core.c | 4 +++- src/pipewire/pipewire.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pipewire/core.c b/src/pipewire/core.c index 1c52345e6..60e4a20b7 100644 --- a/src/pipewire/core.c +++ b/src/pipewire/core.c @@ -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); diff --git a/src/pipewire/pipewire.c b/src/pipewire/pipewire.c index d981dc5f3..bb967afc2 100644 --- a/src/pipewire/pipewire.c +++ b/src/pipewire/pipewire.c @@ -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()); }