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
230c103f
Commit
230c103f
authored
4 years ago
by
Julian Bouzas
Committed by
George Kiagiadakis
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
session-item: add _get_parent API
parent
e810d327
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/wp/private.h
+4
-0
4 additions, 0 deletions
lib/wp/private.h
lib/wp/session-bin.c
+2
-0
2 additions, 0 deletions
lib/wp/session-bin.c
lib/wp/session-item.c
+42
-0
42 additions, 0 deletions
lib/wp/session-item.c
lib/wp/session-item.h
+3
-0
3 additions, 0 deletions
lib/wp/session-item.h
with
51 additions
and
0 deletions
lib/wp/private.h
+
4
−
0
View file @
230c103f
...
...
@@ -179,6 +179,10 @@ WpSpaPod * wp_spa_props_build_props (WpSpaProps * self);
GPtrArray
*
wp_spa_props_build_propinfo
(
WpSpaProps
*
self
);
GPtrArray
*
wp_spa_props_build_all_pods
(
WpSpaProps
*
self
);
/* session item */
void
wp_session_item_set_parent
(
WpSessionItem
*
self
,
WpSessionItem
*
parent
);
/* impl endpoint */
#define WP_TYPE_IMPL_ENDPOINT (wp_impl_endpoint_get_type ())
...
...
This diff is collapsed.
Click to expand it.
lib/wp/session-bin.c
+
2
−
0
View file @
230c103f
...
...
@@ -96,6 +96,7 @@ wp_session_bin_add (WpSessionBin *self, WpSessionItem *item)
return
FALSE
;
g_ptr_array_add
(
priv
->
items
,
item
);
wp_session_item_set_parent
(
item
,
WP_SESSION_ITEM
(
self
));
return
TRUE
;
}
...
...
@@ -112,6 +113,7 @@ gboolean
wp_session_bin_remove
(
WpSessionBin
*
self
,
WpSessionItem
*
item
)
{
WpSessionBinPrivate
*
priv
=
wp_session_bin_get_instance_private
(
self
);
wp_session_item_set_parent
(
item
,
NULL
);
return
g_ptr_array_remove_fast
(
priv
->
items
,
item
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/wp/session-item.c
+
42
−
0
View file @
230c103f
...
...
@@ -78,6 +78,7 @@ struct _WpSessionItemPrivate
{
GWeakRef
session
;
guint32
flags
;
GWeakRef
parent
;
union
{
WpProxy
*
impl_proxy
;
...
...
@@ -106,6 +107,7 @@ wp_session_item_init (WpSessionItem * self)
wp_session_item_get_instance_private
(
self
);
g_weak_ref_init
(
&
priv
->
session
,
NULL
);
g_weak_ref_init
(
&
priv
->
parent
,
NULL
);
}
static
void
...
...
@@ -125,6 +127,7 @@ wp_session_item_finalize (GObject * object)
WpSessionItemPrivate
*
priv
=
wp_session_item_get_instance_private
(
self
);
g_weak_ref_clear
(
&
priv
->
session
);
g_weak_ref_clear
(
&
priv
->
parent
);
G_OBJECT_CLASS
(
wp_session_item_parent_class
)
->
finalize
(
object
);
}
...
...
@@ -359,6 +362,45 @@ wp_session_item_reset (WpSessionItem * self)
WP_SESSION_ITEM_GET_CLASS
(
self
)
->
reset
(
self
);
}
/**
* wp_session_item_get_parent:
* @self: the session item
*
* Gets the item's parent, which is the #WpSessionBin this item has been added
* to, or NULL if the item does not belong to a session bin.
*
* Returns: (nullable) (transfer full): the item's parent.
*/
WpSessionItem
*
wp_session_item_get_parent
(
WpSessionItem
*
self
)
{
g_return_val_if_fail
(
WP_IS_SESSION_ITEM
(
self
),
NULL
);
WpSessionItemPrivate
*
priv
=
wp_session_item_get_instance_private
(
self
);
return
g_weak_ref_get
(
&
priv
->
parent
);
}
/**
* wp_session_item_set_parent:
* @self: the session item
*
* Gets the item's parent, which is the #WpSessionBin this item has been added
* to, or NULL if the item does not belong to a session bin.
*
* Returns: (nullable) (transfer full): the item's parent.
*/
void
wp_session_item_set_parent
(
WpSessionItem
*
self
,
WpSessionItem
*
parent
)
{
g_return_if_fail
(
WP_IS_SESSION_ITEM
(
self
));
WpSessionItemPrivate
*
priv
=
wp_session_item_get_instance_private
(
self
);
g_weak_ref_set
(
&
priv
->
parent
,
parent
);
}
/**
* wp_session_item_get_flags:
* @self: the session item
...
...
This diff is collapsed.
Click to expand it.
lib/wp/session-item.h
+
3
−
0
View file @
230c103f
...
...
@@ -120,6 +120,9 @@ struct _WpSessionItemClass
WP_API
void
wp_session_item_reset
(
WpSessionItem
*
self
);
WP_API
WpSessionItem
*
wp_session_item_get_parent
(
WpSessionItem
*
self
);
/* flags */
WP_API
...
...
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