WpModule

A module is a shared library that can be loaded dynamically in the WirePlumber daemon process, adding functionality to the daemon.

For every module that is loaded, WirePlumber constructs a WpModule object that gets registered on the WpCore and can be retrieved through the WpObjectManager API.

Every module has to conform to a certain interface in order for WirePlumber to know how to load it. This interface is called "ABI" in WpModule. Currently there is only one possible ABI, the "C" one.

Writing modules in C

In order to define a module in C, you need to implement a function in your shared library that has this signature:

 WP_PLUGIN_EXPORT void
 wireplumber__module_init (WpModule * module, WpCore * core, GVariant * args)

This function will be called once at the time of loading the module. The args parameter is a dictionary ("a{sv}") GVariant that contains arguments for this module that were specified in WirePlumber's configuration file. The module parameter is useful for registering a destroy callback (using wp_module_set_destroy_callback), which will be called at the time the module is destroyed (when WirePlumber quits) and allows you to free any resources that the module has allocated.

WpModule

GObject
    ╰──WpModule

Class structure

WpModuleClass

Fields
parent_class (GObjectClass) –
No description available

Wp.ModuleClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

Wp.ModuleClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

WpModule

GObject
    ╰──WpModule

WpModule

GObject
    ╰──WpModule

Methods

wp_module_get_core

WpCore *
wp_module_get_core (WpModule * self)

Parameters:

self

the module

Returns ( [transfer: full] ) –

the core on which this module is registered


Wp.Module.get_core

def Wp.Module.get_core (self):
    #python wrapper for 'wp_module_get_core'

Parameters:

self ( Wp.Module ) –

the module

Returns ( Wp.Core ) –

the core on which this module is registered


Wp.Module.prototype.get_core

function Wp.Module.prototype.get_core(): {
    // javascript wrapper for 'wp_module_get_core'
}

Parameters:

self ( Wp.Module ) –

the module

Returns ( Wp.Core ) –

the core on which this module is registered


wp_module_get_properties

GVariant *
wp_module_get_properties (WpModule * self)

Parameters:

self

the module

Returns ( [transfer: none] ) –

the properties of the module ("a{sv}")


Wp.Module.get_properties

def Wp.Module.get_properties (self):
    #python wrapper for 'wp_module_get_properties'

Parameters:

self ( Wp.Module ) –

the module

Returns ( GLib.Variant ) –

the properties of the module ("a{sv}")


Wp.Module.prototype.get_properties

function Wp.Module.prototype.get_properties(): {
    // javascript wrapper for 'wp_module_get_properties'
}

Parameters:

self ( Wp.Module ) –

the module

Returns ( GLib.Variant ) –

the properties of the module ("a{sv}")


wp_module_set_destroy_callback

wp_module_set_destroy_callback (WpModule * self,
                                GDestroyNotify callback,
                                gpointer data)

Registers a callback to call when the module object is destroyed

Parameters:

self

the module

callback ( [scope async] ) –

a function to call when the module is destroyed

data ( [closure] ) –

data to pass to callback


Wp.Module.set_destroy_callback

def Wp.Module.set_destroy_callback (self, callback, data):
    #python wrapper for 'wp_module_set_destroy_callback'

Registers a callback to call when the module object is destroyed

Parameters:

self ( Wp.Module ) –

the module

callback ( GLib.DestroyNotify ) –

a function to call when the module is destroyed

data ( object ) –

data to pass to callback


Wp.Module.prototype.set_destroy_callback

function Wp.Module.prototype.set_destroy_callback(callback: GLib.DestroyNotify, data: Object): {
    // javascript wrapper for 'wp_module_set_destroy_callback'
}

Registers a callback to call when the module object is destroyed

Parameters:

self ( Wp.Module ) –

the module

callback ( GLib.DestroyNotify ) –

a function to call when the module is destroyed

data ( Object ) –

data to pass to callback


Functions

wp_module_load

WpModule *
wp_module_load (WpCore * core,
                const gchar * abi,
                const gchar * module_name,
                GVariant * args,
                GError ** error)

Parameters:

core

the core

abi

the abi name of the module

module_name

the module name

args ( [transfer: floating] [nullable] ) –

additional properties passed to the module ("a{sv}")

error ( [out] [optional] ) –

return location for errors, or NULL to ignore

Returns ( [transfer: none] ) –

the loaded module


Wp.Module.load

@raises(GLib.GError)
def Wp.Module.load (core, abi, module_name, args):
    #python wrapper for 'wp_module_load'

Parameters:

core ( Wp.Core ) –

the core

abi ( str ) –

the abi name of the module

module_name ( str ) –

the module name

args ( GLib.Variant ) –

additional properties passed to the module ("a{sv}")

Returns ( Wp.Module ) –

the loaded module


Wp.Module.prototype.load

function Wp.Module.prototype.load(core: Wp.Core, abi: String, module_name: String, args: GLib.Variant): {
    // javascript wrapper for 'wp_module_load'
}

Parameters:

core ( Wp.Core ) –

the core

abi ( String ) –

the abi name of the module

module_name ( String ) –

the module name

args ( GLib.Variant ) –

additional properties passed to the module ("a{sv}")

Returns ( Wp.Module ) –

the loaded module


Constants

WP_TYPE_MODULE

#define WP_TYPE_MODULE (wp_module_get_type ())

The WpModule GType


The results of the search are