Skip to content
Snippets Groups Projects
Commit b97540a1 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

endpoint: add wp_endpoint_create_link method

parent 23ae8c0d
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@
#include <spa/pod/builder.h>
#include <spa/pod/parser.h>
#include <spa/pod/filter.h>
#include <spa/utils/result.h>
/* WpEndpoint */
......@@ -422,6 +423,44 @@ wp_endpoint_iterate_streams (WpEndpoint * self)
return wp_object_manager_iterate (priv->streams_om);
}
/**
* wp_endpoint_create_link:
* @self: the endpoint
* @props: the link properties
*
* Creates a #WpEndpointLink between @self and another endpoint, which
* must be specified in @props.
* @props may contain:
* - `endpoint-link.output.endpoint`: the bound id of the endpoint
* that is in the %WP_DIRECTION_OUTPUT direction
* - `endpoint-link.output.stream`: the bound id of the endpoint stream
* that is in the %WP_DIRECTION_OUTPUT direction
* - `endpoint-link.input.endpoint`: the bound id of the endpoint
* that is in the %WP_DIRECTION_INPUT direction
* - `endpoint-link.input.stream`: the bound id of the endpoint stream
* that is in the %WP_DIRECTION_INPUT direction
*
* If either stream id are not specified (or set to -1), then the first
* available stream of this endpoint is used for the link.
*
* The id of @self is not necessary to be specified, so only one of
* `endpoint-link.output.endpoint`, `endpoint-link.input.endpoint`
* is actually required.
*/
void
wp_endpoint_create_link (WpEndpoint * self, WpProperties * props)
{
WpEndpointPrivate *priv =
wp_endpoint_get_instance_private (WP_ENDPOINT (self));
int res;
res = pw_endpoint_create_link (priv->iface, wp_properties_peek_dict (props));
if (res < 0) {
wp_warning_object (self, "pw_endpoint_create_link: %d: %s", res,
spa_strerror (res));
}
}
/* WpImplEndpoint */
enum {
......
......@@ -76,6 +76,9 @@ WpEndpointStream * wp_endpoint_find_stream (WpEndpoint * self, guint32 bound_id)
WP_API
WpIterator * wp_endpoint_iterate_streams (WpEndpoint * self);
WP_API
void wp_endpoint_create_link (WpEndpoint * self, WpProperties * props);
G_END_DECLS
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment