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
ea3b58c2
Commit
ea3b58c2
authored
5 years ago
by
Julian Bouzas
Browse files
Options
Downloads
Patches
Plain Diff
properties: add wp_properties_matches API
parent
58f321f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/wp/properties.c
+21
-0
21 additions, 0 deletions
lib/wp/properties.c
lib/wp/properties.h
+1
-0
1 addition, 0 deletions
lib/wp/properties.h
with
22 additions
and
0 deletions
lib/wp/properties.c
+
21
−
0
View file @
ea3b58c2
...
...
@@ -262,3 +262,24 @@ wp_properties_to_pw_properties (WpProperties * self)
return
pw_properties_new_dict
(
wp_properties_peek_dict
(
self
));
}
gboolean
wp_properties_matches
(
WpProperties
*
self
,
WpProperties
*
other
)
{
const
struct
spa_dict
*
dict
;
const
struct
spa_dict_item
*
item
;
const
gchar
*
value
;
g_return_val_if_fail
(
self
!=
NULL
,
FALSE
);
/* Check if the property vakues matches the ones from 'other' */
dict
=
wp_properties_peek_dict
(
self
);
spa_dict_for_each
(
item
,
dict
)
{
value
=
wp_properties_get
(
other
,
item
->
key
);
if
(
value
&&
g_strcmp0
(
item
->
value
,
value
)
!=
0
)
return
FALSE
;
}
return
TRUE
;
}
This diff is collapsed.
Click to expand it.
lib/wp/properties.h
+
1
−
0
View file @
ea3b58c2
...
...
@@ -57,6 +57,7 @@ gint wp_properties_setf_valist (WpProperties * self, const gchar * key,
const
struct
spa_dict
*
wp_properties_peek_dict
(
WpProperties
*
self
);
struct
pw_properties
*
wp_properties_to_pw_properties
(
WpProperties
*
self
);
gboolean
wp_properties_matches
(
WpProperties
*
self
,
WpProperties
*
other
);
G_DEFINE_AUTOPTR_CLEANUP_FUNC
(
WpProperties
,
wp_properties_unref
)
...
...
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