mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-09 03:58:05 +02: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;
|
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 *
|
struct pw_core *
|
||||||
wp_core_get_pw_core (WpCore * self)
|
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);
|
g_return_val_if_fail (WP_IS_CORE (self), FALSE);
|
||||||
|
|
||||||
source = g_idle_source_new ();
|
source = wp_core_idle_add (self, (GSourceFunc) connect_in_idle, self);
|
||||||
g_source_set_callback (source, (GSourceFunc) connect_in_idle, self, NULL);
|
|
||||||
g_source_attach (source, self->context);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ G_DECLARE_FINAL_TYPE (WpCore, wp_core, WP, CORE, GObject)
|
||||||
WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
|
WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
|
||||||
|
|
||||||
GMainContext * wp_core_get_context (WpCore * self);
|
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_core * wp_core_get_pw_core (WpCore * self);
|
||||||
struct pw_remote * wp_core_get_pw_remote (WpCore * self);
|
struct pw_remote * wp_core_get_pw_remote (WpCore * self);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue