mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-02-05 13:40:28 +01:00
port: add wp_port_get_direction()
This commit is contained in:
parent
72ff4577c5
commit
33e67f2189
3 changed files with 26 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue