mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-03-24 05:40:37 +01:00
core: add wp_core_idle_add API
This commit is contained in:
parent
59ab08ff0c
commit
936a9f4d8b
2 changed files with 15 additions and 3 deletions
|
|
@ -440,6 +440,19 @@ wp_core_get_context (WpCore * self)
|
|||
return self->context;
|
||||
}
|
||||
|
||||
GSource *
|
||||
wp_core_idle_add (WpCore * self, GSourceFunc function, gpointer data)
|
||||
{
|
||||
GSource *source = NULL;
|
||||
|
||||
g_return_val_if_fail (WP_IS_CORE (self), NULL);
|
||||
|
||||
source = g_idle_source_new ();
|
||||
g_source_set_callback (source, function, data, NULL);
|
||||
g_source_attach (source, self->context);
|
||||
return source;
|
||||
}
|
||||
|
||||
struct pw_core *
|
||||
wp_core_get_pw_core (WpCore * self)
|
||||
{
|
||||
|
|
@ -468,9 +481,7 @@ wp_core_connect (WpCore *self)
|
|||
|
||||
g_return_val_if_fail (WP_IS_CORE (self), FALSE);
|
||||
|
||||
source = g_idle_source_new ();
|
||||
g_source_set_callback (source, (GSourceFunc) connect_in_idle, self, NULL);
|
||||
g_source_attach (source, self->context);
|
||||
source = wp_core_idle_add (self, (GSourceFunc) connect_in_idle, self);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ G_DECLARE_FINAL_TYPE (WpCore, wp_core, WP, CORE, GObject)
|
|||
WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
|
||||
|
||||
GMainContext * wp_core_get_context (WpCore * self);
|
||||
GSource * wp_core_idle_add (WpCore * self, GSourceFunc function, gpointer data);
|
||||
struct pw_core * wp_core_get_pw_core (WpCore * self);
|
||||
struct pw_remote * wp_core_get_pw_remote (WpCore * self);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue