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

port: add wp_port_get_direction()

parent 72ff4577
No related branches found
No related tags found
No related merge requests found
......@@ -11,23 +11,12 @@
#include "spa-pod.h"
#include "proxy.h"
#include "port.h"
#include "endpoint-stream.h"
#include "iterator.h"
G_BEGIN_DECLS
/**
* WpDirection:
* @WP_DIRECTION_INPUT: a sink, consuming input
* @WP_DIRECTION_OUTPUT: a source, producing output
*
* The different directions the endpoint can have
*/
typedef enum {
WP_DIRECTION_INPUT,
WP_DIRECTION_OUTPUT,
} WpDirection;
/**
* WpEndpointFeatures:
* @WP_ENDPOINT_FEATURE_STREAMS: caches information about streams, enabling
......
......@@ -138,3 +138,13 @@ wp_port_class_init (WpPortClass * klass)
proxy_class->pw_proxy_created = wp_port_pw_proxy_created;
}
WpDirection
wp_port_get_direction (WpPort * self)
{
g_return_val_if_fail (WP_IS_PORT (self), 0);
g_return_val_if_fail (wp_proxy_get_features (WP_PROXY (self)) &
WP_PROXY_FEATURE_INFO, 0);
return (WpDirection) self->info->direction;
}
......@@ -13,6 +13,18 @@
G_BEGIN_DECLS
/**
* WpDirection:
* @WP_DIRECTION_INPUT: a sink, consuming input
* @WP_DIRECTION_OUTPUT: a source, producing output
*
* The different directions the endpoint can have
*/
typedef enum {
WP_DIRECTION_INPUT,
WP_DIRECTION_OUTPUT,
} WpDirection;
/**
* WP_TYPE_PORT:
*
......@@ -22,6 +34,9 @@ G_BEGIN_DECLS
WP_API
G_DECLARE_FINAL_TYPE (WpPort, wp_port, WP, PORT, WpProxy)
WP_API
WpDirection wp_port_get_direction (WpPort * self);
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