2019-05-17 13:08:45 +03:00
|
|
|
/* WirePlumber
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2019 Collabora Ltd.
|
|
|
|
|
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
|
|
|
|
|
*
|
2019-05-31 12:13:01 +03:00
|
|
|
* SPDX-License-Identifier: MIT
|
2019-05-17 13:08:45 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* module-pipewire provides basic integration between wireplumber and pipewire.
|
|
|
|
|
* It provides the pipewire core and remote, connects to pipewire and provides
|
|
|
|
|
* the most primitive implementations of WpEndpoint and WpEndpointLink
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <wp/wp.h>
|
|
|
|
|
#include <pipewire/pipewire.h>
|
|
|
|
|
|
2019-06-24 10:52:27 -04:00
|
|
|
void simple_endpoint_factory (WpFactory * factory, GType type,
|
|
|
|
|
GVariant * properties, GAsyncReadyCallback ready, gpointer user_data);
|
2019-06-28 12:33:00 -04:00
|
|
|
void simple_endpoint_link_factory (WpFactory * factory, GType type,
|
|
|
|
|
GVariant * properties, GAsyncReadyCallback ready, gpointer user_data);
|
2019-05-17 13:08:45 +03:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
wireplumber__module_init (WpModule * module, WpCore * core, GVariant * args)
|
|
|
|
|
{
|
2019-08-09 08:39:12 -04:00
|
|
|
WpRemotePipewire *rp;
|
|
|
|
|
|
|
|
|
|
/* Get the remote pipewire */
|
|
|
|
|
rp = wp_core_get_global (core, WP_GLOBAL_REMOTE_PIPEWIRE);
|
|
|
|
|
if (!rp) {
|
|
|
|
|
g_critical ("module-pipewire cannot be loaded without a registered "
|
|
|
|
|
"WpRemotePipewire object");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Load the client-device and adapter modules */
|
|
|
|
|
wp_remote_pipewire_module_load(rp, "libpipewire-module-client-device", NULL,
|
|
|
|
|
NULL, NULL, NULL);
|
|
|
|
|
wp_remote_pipewire_module_load(rp, "libpipewire-module-adapter", NULL, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
2019-06-20 12:55:46 -04:00
|
|
|
/* Register simple-endpoint and simple-endpoint-link */
|
2019-06-28 12:33:00 -04:00
|
|
|
wp_factory_new (core, "pipewire-simple-endpoint",
|
2019-06-24 10:52:27 -04:00
|
|
|
simple_endpoint_factory);
|
2019-05-22 13:03:24 +03:00
|
|
|
wp_factory_new (core, "pipewire-simple-endpoint-link",
|
|
|
|
|
simple_endpoint_link_factory);
|
2019-05-17 13:08:45 +03:00
|
|
|
}
|