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
7b222ebc
Commit
7b222ebc
authored
5 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
endpoint: export name, media class & direction + finetune the global properties
parent
a71d433a
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/endpoint.c
+47
-0
47 additions, 0 deletions
lib/wp/endpoint.c
lib/wp/endpoint.h
+7
-0
7 additions, 0 deletions
lib/wp/endpoint.h
with
54 additions
and
0 deletions
lib/wp/endpoint.c
+
47
−
0
View file @
7b222ebc
...
...
@@ -462,6 +462,8 @@ wp_exported_endpoint_finalize (GObject * object)
g_clear_pointer
(
&
priv
->
properties
,
wp_properties_unref
);
wp_spa_props_clear
(
&
priv
->
spa_props
);
g_free
(
priv
->
info
.
name
);
g_free
(
priv
->
info
.
media_class
);
G_OBJECT_CLASS
(
wp_exported_endpoint_parent_class
)
->
finalize
(
object
);
}
...
...
@@ -574,6 +576,15 @@ wp_exported_endpoint_export (WpExported * self)
g_autoptr
(
WpCore
)
core
=
wp_exported_get_core
(
self
);
struct
pw_client_endpoint_proxy
*
pw_proxy
=
NULL
;
/* make sure these props are not present; they are added by the server */
wp_properties_set
(
priv
->
properties
,
PW_KEY_OBJECT_ID
,
NULL
);
wp_properties_set
(
priv
->
properties
,
PW_KEY_CLIENT_ID
,
NULL
);
wp_properties_set
(
priv
->
properties
,
PW_KEY_FACTORY_ID
,
NULL
);
/* add must-have global properties */
wp_properties_set
(
priv
->
properties
,
PW_KEY_ENDPOINT_NAME
,
priv
->
info
.
name
);
wp_properties_set
(
priv
->
properties
,
PW_KEY_MEDIA_CLASS
,
priv
->
info
.
media_class
);
priv
->
client_ep
=
wp_core_create_remote_object
(
core
,
"client-endpoint"
,
PW_TYPE_INTERFACE_ClientEndpoint
,
PW_VERSION_CLIENT_ENDPOINT_PROXY
,
priv
->
properties
);
...
...
@@ -747,6 +758,42 @@ wp_exported_endpoint_update_properties (WpExportedEndpoint * self,
}
}
void
wp_exported_endpoint_set_name
(
WpExportedEndpoint
*
self
,
const
gchar
*
name
)
{
WpExportedEndpointPrivate
*
priv
;
g_return_if_fail
(
WP_IS_EXPORTED_ENDPOINT
(
self
));
priv
=
wp_exported_endpoint_get_instance_private
(
WP_EXPORTED_ENDPOINT
(
self
));
g_free
(
priv
->
info
.
name
);
priv
->
info
.
name
=
g_strdup
(
name
);
}
void
wp_exported_endpoint_set_media_class
(
WpExportedEndpoint
*
self
,
const
gchar
*
media_class
)
{
WpExportedEndpointPrivate
*
priv
;
g_return_if_fail
(
WP_IS_EXPORTED_ENDPOINT
(
self
));
priv
=
wp_exported_endpoint_get_instance_private
(
WP_EXPORTED_ENDPOINT
(
self
));
g_free
(
priv
->
info
.
media_class
);
priv
->
info
.
media_class
=
g_strdup
(
media_class
);
}
void
wp_exported_endpoint_set_direction
(
WpExportedEndpoint
*
self
,
WpDirection
dir
)
{
WpExportedEndpointPrivate
*
priv
;
g_return_if_fail
(
WP_IS_EXPORTED_ENDPOINT
(
self
));
priv
=
wp_exported_endpoint_get_instance_private
(
WP_EXPORTED_ENDPOINT
(
self
));
priv
->
info
.
direction
=
(
enum
pw_direction
)
dir
;
}
void
wp_exported_endpoint_register_control
(
WpExportedEndpoint
*
self
,
WpEndpointControl
control
)
...
...
This diff is collapsed.
Click to expand it.
lib/wp/endpoint.h
+
7
−
0
View file @
7b222ebc
...
...
@@ -111,6 +111,13 @@ void wp_exported_endpoint_set_property (WpExportedEndpoint * self,
void
wp_exported_endpoint_update_properties
(
WpExportedEndpoint
*
self
,
WpProperties
*
updates
);
void
wp_exported_endpoint_set_name
(
WpExportedEndpoint
*
self
,
const
gchar
*
name
);
void
wp_exported_endpoint_set_media_class
(
WpExportedEndpoint
*
self
,
const
gchar
*
media_class
);
void
wp_exported_endpoint_set_direction
(
WpExportedEndpoint
*
self
,
WpDirection
dir
);
void
wp_exported_endpoint_register_control
(
WpExportedEndpoint
*
self
,
WpEndpointControl
control
);
...
...
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