Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
58f321f8
Commit
58f321f8
authored
5 years ago
by
Julian Bouzas
Browse files
Options
Downloads
Patches
Plain Diff
object-manager: sync object-changed with pipewire's core
parent
61227c9d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/wp/object-manager.c
+14
-16
14 additions, 16 deletions
lib/wp/object-manager.c
with
14 additions
and
16 deletions
lib/wp/object-manager.c
+
14
−
16
View file @
58f321f8
...
...
@@ -31,7 +31,7 @@ struct _WpObjectManager
/* objects that we are interested in, with a strong ref */
GPtrArray
*
objects
;
GSource
*
idle
_objchanged
_source
;
gboolean
pending
_objchanged
;
};
enum
{
...
...
@@ -56,6 +56,7 @@ wp_object_manager_init (WpObjectManager * self)
g_weak_ref_init
(
&
self
->
core
,
NULL
);
pw_array_init
(
&
self
->
interests
,
sizeof
(
struct
interest
));
self
->
objects
=
g_ptr_array_new_with_free_func
(
g_object_unref
);
self
->
pending_objchanged
=
FALSE
;
}
static
void
...
...
@@ -64,10 +65,6 @@ wp_object_manager_finalize (GObject * object)
WpObjectManager
*
self
=
WP_OBJECT_MANAGER
(
object
);
struct
interest
*
i
;
if
(
self
->
idle_objchanged_source
)
g_source_destroy
(
self
->
idle_objchanged_source
);
g_clear_pointer
(
&
self
->
idle_objchanged_source
,
g_source_unref
);
g_clear_pointer
(
&
self
->
objects
,
g_ptr_array_unref
);
pw_array_for_each
(
i
,
&
self
->
interests
)
...
...
@@ -362,25 +359,26 @@ wp_object_manager_is_interested_in_global (WpObjectManager * self,
return
FALSE
;
}
static
gboolean
idle
_emit_objects_changed
(
gpointer
data
)
static
void
sync
_emit_objects_changed
(
WpCore
*
core
,
GAsyncResult
*
res
,
gpointer
data
)
{
WpObjectManager
*
self
=
WP_OBJECT_MANAGER
(
data
)
;
WpObjectManager
*
self
=
data
;
g_signal_emit
(
self
,
signals
[
SIGNAL_OBJECTS_CHANGED
],
0
);
g_clear_pointer
(
&
self
->
idle_objchanged_source
,
g_source_unref
);
return
G_SOURCE_REMOVE
;
self
->
pending_objchanged
=
FALSE
;
}
static
inline
void
schedule_emit_objects_changed
(
WpObjectManager
*
self
)
{
if
(
!
self
->
idle_objchanged_source
)
{
g_autoptr
(
WpCore
)
core
=
g_weak_ref_get
(
&
self
->
core
);
if
(
core
)
self
->
idle_objchanged_source
=
wp_core_idle_add
(
core
,
idle_emit_objects_changed
,
self
);
if
(
self
->
pending_objchanged
)
return
;
g_autoptr
(
WpCore
)
core
=
g_weak_ref_get
(
&
self
->
core
);
if
(
core
)
{
wp_core_sync
(
core
,
NULL
,
(
GAsyncReadyCallback
)
sync_emit_objects_changed
,
self
);
self
->
pending_objchanged
=
TRUE
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment