mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 11:18:10 +02:00
endpoint: add get_role API
This commit is contained in:
parent
d6ed17472a
commit
c8417f8826
3 changed files with 22 additions and 0 deletions
|
|
@ -462,6 +462,17 @@ wp_endpoint_get_properties (WpEndpoint * self)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
wp_endpoint_get_role (WpEndpoint * self)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_ENDPOINT (self), NULL);
|
||||
|
||||
if (WP_ENDPOINT_GET_CLASS (self)->get_role)
|
||||
return WP_ENDPOINT_GET_CLASS (self)->get_role (self);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_endpoint_register_stream:
|
||||
* @self: the endpoint
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ struct _WpEndpointClass
|
|||
GObjectClass parent_class;
|
||||
|
||||
WpProperties * (*get_properties) (WpEndpoint * self);
|
||||
const char * (*get_role) (WpEndpoint * self);
|
||||
|
||||
GVariant * (*get_control_value) (WpEndpoint * self, guint32 control_id);
|
||||
gboolean (*set_control_value) (WpEndpoint * self, guint32 control_id,
|
||||
|
|
@ -52,6 +53,7 @@ const gchar * wp_endpoint_get_media_class (WpEndpoint * self);
|
|||
guint wp_endpoint_get_direction (WpEndpoint * self);
|
||||
guint64 wp_endpoint_get_creation_time (WpEndpoint * self);
|
||||
WpProperties * wp_endpoint_get_properties (WpEndpoint * self);
|
||||
const char * wp_endpoint_get_role (WpEndpoint * self);
|
||||
|
||||
void wp_endpoint_register_stream (WpEndpoint * self, GVariant * stream);
|
||||
GVariant * wp_endpoint_get_stream (WpEndpoint * self, guint32 stream_id);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,14 @@ endpoint_get_properties (WpEndpoint * ep)
|
|||
return wp_proxy_node_get_properties (self->proxy_node);
|
||||
}
|
||||
|
||||
static const char *
|
||||
endpoint_get_role (WpEndpoint *ep)
|
||||
{
|
||||
WpPwAudioSoftdspEndpoint *self = WP_PW_AUDIO_SOFTDSP_ENDPOINT (ep);
|
||||
|
||||
return self->role;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
endpoint_prepare_link (WpEndpoint * ep, guint32 stream_id,
|
||||
WpEndpointLink * link, GVariant ** properties, GError ** error)
|
||||
|
|
@ -399,6 +407,7 @@ endpoint_class_init (WpPwAudioSoftdspEndpointClass * klass)
|
|||
object_class->get_property = endpoint_get_property;
|
||||
|
||||
endpoint_class->get_properties = endpoint_get_properties;
|
||||
endpoint_class->get_role = endpoint_get_role;
|
||||
endpoint_class->prepare_link = endpoint_prepare_link;
|
||||
endpoint_class->get_control_value = endpoint_get_control_value;
|
||||
endpoint_class->set_control_value = endpoint_set_control_value;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue