
* introduces API to export session items * introduces small changes in the WpSiEndpoint & WpSiStream interfaces to make it nicer to work with * ports WpImplEndpoint to use PW_TYPE_INTERFACE_Endpoint to export. Depends on: https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/246 (was merged after 0.3.2)
118 lines
2.9 KiB
C
118 lines
2.9 KiB
C
/* WirePlumber
|
|
*
|
|
* Copyright © 2019 Collabora Ltd.
|
|
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef __WIREPLUMBER_ENDPOINT_H__
|
|
#define __WIREPLUMBER_ENDPOINT_H__
|
|
|
|
#include "proxy.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;
|
|
|
|
/**
|
|
* WpEndpointControl:
|
|
* @WP_ENDPOINT_CONTROL_VOLUME: a volume control (type: float)
|
|
* @WP_ENDPOINT_CONTROL_MUTE: a mute control (type: boolean)
|
|
* @WP_ENDPOINT_CONTROL_CHANNEL_VOLUMES:
|
|
*/
|
|
typedef enum {
|
|
WP_ENDPOINT_CONTROL_VOLUME = 0x10003 /* SPA_PROP_volume */,
|
|
WP_ENDPOINT_CONTROL_MUTE = 0x10004 /* SPA_PROP_mute */,
|
|
WP_ENDPOINT_CONTROL_CHANNEL_VOLUMES = 0x10008 /* SPA_PROP_channelVolumes */,
|
|
} WpEndpointControl;
|
|
|
|
/**
|
|
* WpEndpointFeatures:
|
|
* @WP_ENDPOINT_FEATURE_CONTROLS: enables the use of the
|
|
* wp_endpoint_get_control() and wp_endpoint_set_control() families of
|
|
* functions to be able to work with endpoint-specific controls
|
|
*
|
|
* An extension of #WpProxyFeatures
|
|
*/
|
|
typedef enum { /*< flags >*/
|
|
WP_ENDPOINT_FEATURE_CONTROLS = WP_PROXY_FEATURE_LAST,
|
|
} WpEndpointFeatures;
|
|
|
|
/**
|
|
* WP_TYPE_ENDPOINT:
|
|
*
|
|
* The #WpEndpoint #GType
|
|
*/
|
|
#define WP_TYPE_ENDPOINT (wp_endpoint_get_type ())
|
|
WP_API
|
|
G_DECLARE_DERIVABLE_TYPE (WpEndpoint, wp_endpoint, WP, ENDPOINT, WpProxy)
|
|
|
|
struct _WpEndpointClass
|
|
{
|
|
WpProxyClass parent_class;
|
|
|
|
const gchar * (*get_name) (WpEndpoint * self);
|
|
const gchar * (*get_media_class) (WpEndpoint * self);
|
|
WpDirection (*get_direction) (WpEndpoint * self);
|
|
|
|
const struct spa_pod * (*get_control) (WpEndpoint * self, guint32 control_id);
|
|
gboolean (*set_control) (WpEndpoint * self, guint32 control_id,
|
|
const struct spa_pod * value);
|
|
};
|
|
|
|
WP_API
|
|
const gchar * wp_endpoint_get_name (WpEndpoint * self);
|
|
|
|
WP_API
|
|
const gchar * wp_endpoint_get_media_class (WpEndpoint * self);
|
|
|
|
WP_API
|
|
WpDirection wp_endpoint_get_direction (WpEndpoint * self);
|
|
|
|
WP_API
|
|
const struct spa_pod * wp_endpoint_get_control (WpEndpoint * self,
|
|
guint32 control_id);
|
|
|
|
WP_API
|
|
gboolean wp_endpoint_get_control_boolean (WpEndpoint * self, guint32 control_id,
|
|
gboolean * value);
|
|
|
|
WP_API
|
|
gboolean wp_endpoint_get_control_int (WpEndpoint * self, guint32 control_id,
|
|
gint * value);
|
|
|
|
WP_API
|
|
gboolean wp_endpoint_get_control_float (WpEndpoint * self, guint32 control_id,
|
|
gfloat * value);
|
|
|
|
WP_API
|
|
gboolean wp_endpoint_set_control (WpEndpoint * self, guint32 control_id,
|
|
const struct spa_pod * value);
|
|
|
|
WP_API
|
|
gboolean wp_endpoint_set_control_boolean (WpEndpoint * self, guint32 control_id,
|
|
gboolean value);
|
|
|
|
WP_API
|
|
gboolean wp_endpoint_set_control_int (WpEndpoint * self, guint32 control_id,
|
|
gint value);
|
|
|
|
WP_API
|
|
gboolean wp_endpoint_set_control_float (WpEndpoint * self, guint32 control_id,
|
|
gfloat value);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif
|