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

si-interfaces: drop the multi-endpoint interface

It's not well-defined; we'll come back to that later
parent c95ee227
No related branches found
No related tags found
No related merge requests found
......@@ -135,61 +135,6 @@ wp_si_endpoint_get_stream_acquisition (WpSiEndpoint * self)
return WP_SI_ENDPOINT_GET_IFACE (self)->get_stream_acquisition (self);
}
/**
* WpSiMultiEndpoint:
*
* An interface for session items that provide multiple PipeWire endpoints.
*
* This is useful for items that need to expose more than one endpoints while
* managing the same nodes underneath. For example, an audio playback device
* may have one input endpoint for sending audio to the device and one output
* endpoint for monitoring (exposing the adapter's monitor ports).
*
* If an item implements both #WpSiMultiEndpoint and #WpSiEndpoint, then the
* managing session will only inspect the #WpSiMultiEndpoint interface in
* order to determine which endpoints to export. Effectively this means that
* such an item should also include itself in the list of endpoints that
* it exposes through #WpSiMultiEndpoint in order to be exported to PipeWire.
*/
G_DEFINE_INTERFACE (WpSiMultiEndpoint, wp_si_multi_endpoint, WP_TYPE_SESSION_ITEM)
static void
wp_si_multi_endpoint_default_init (WpSiMultiEndpointInterface * iface)
{
}
/**
* wp_si_multi_endpoint_get_n_endpoints: (virtual get_n_endpoints)
* @self: the session item
*
* Returns: the number of endpoints exposed by this item
*/
guint
wp_si_multi_endpoint_get_n_endpoints (WpSiMultiEndpoint * self)
{
g_return_val_if_fail (WP_IS_SI_MULTI_ENDPOINT (self), 0);
g_return_val_if_fail (WP_SI_MULTI_ENDPOINT_GET_IFACE (self)->get_n_endpoints, 0);
return WP_SI_MULTI_ENDPOINT_GET_IFACE (self)->get_n_endpoints (self);
}
/**
* wp_si_multi_endpoint_get_endpoint: (virtual get_endpoint)
* @self: the session item
* @index: the endpoint index, from 0 up to and excluding
* wp_si_multi_endpoint_get_n_endpoints()
*
* Returns: (transfer none): the endpoint at @index
*/
WpSiEndpoint *
wp_si_multi_endpoint_get_endpoint (WpSiMultiEndpoint * self, guint index)
{
g_return_val_if_fail (WP_IS_SI_MULTI_ENDPOINT (self), NULL);
g_return_val_if_fail (WP_SI_MULTI_ENDPOINT_GET_IFACE (self)->get_endpoint, NULL);
return WP_SI_MULTI_ENDPOINT_GET_IFACE (self)->get_endpoint (self, index);
}
/**
* WpSiStream:
*
......
......@@ -57,31 +57,6 @@ WpSiStream * wp_si_endpoint_get_stream (WpSiEndpoint * self, guint index);
WP_API
WpSiStreamAcquisition * wp_si_endpoint_get_stream_acquisition (WpSiEndpoint * self);
/**
* WP_TYPE_SI_MULTI_ENDPOINT:
*
* The #WpSiMultiEndpoint #GType
*/
#define WP_TYPE_SI_MULTI_ENDPOINT (wp_si_multi_endpoint_get_type ())
WP_API
G_DECLARE_INTERFACE (WpSiMultiEndpoint, wp_si_multi_endpoint,
WP, SI_MULTI_ENDPOINT, WpSessionItem)
struct _WpSiMultiEndpointInterface
{
GTypeInterface interface;
guint (*get_n_endpoints) (WpSiMultiEndpoint * self);
WpSiEndpoint * (*get_endpoint) (WpSiMultiEndpoint * self, guint index);
};
WP_API
guint wp_si_multi_endpoint_get_n_endpoints (WpSiMultiEndpoint * self);
WP_API
WpSiEndpoint * wp_si_multi_endpoint_get_endpoint (WpSiMultiEndpoint * self,
guint index);
/**
* WP_TYPE_SI_STREAM:
*
......
......@@ -43,13 +43,11 @@ struct _WpSiAdapter
WpObjectManager *ports_om;
};
static void si_adapter_multi_endpoint_init (WpSiMultiEndpointInterface * iface);
static void si_adapter_endpoint_init (WpSiEndpointInterface * iface);
static void si_adapter_stream_init (WpSiStreamInterface * iface);
G_DECLARE_FINAL_TYPE(WpSiAdapter, si_adapter, WP, SI_ADAPTER, WpSessionItem)
G_DEFINE_TYPE_WITH_CODE (WpSiAdapter, si_adapter, WP_TYPE_SESSION_ITEM,
G_IMPLEMENT_INTERFACE (WP_TYPE_SI_MULTI_ENDPOINT, si_adapter_multi_endpoint_init)
G_IMPLEMENT_INTERFACE (WP_TYPE_SI_ENDPOINT, si_adapter_endpoint_init)
G_IMPLEMENT_INTERFACE (WP_TYPE_SI_STREAM, si_adapter_stream_init))
......@@ -394,26 +392,6 @@ si_adapter_class_init (WpSiAdapterClass * klass)
si_class->activate_rollback = si_adapter_activate_rollback;
}
static guint
si_adapter_get_n_endpoints (WpSiMultiEndpoint * item)
{
return 1;
}
static WpSiEndpoint *
si_adapter_get_endpoint (WpSiMultiEndpoint * item, guint index)
{
g_return_val_if_fail (index == 0, NULL);
return WP_SI_ENDPOINT (item);
}
static void
si_adapter_multi_endpoint_init (WpSiMultiEndpointInterface * iface)
{
iface->get_n_endpoints = si_adapter_get_n_endpoints;
iface->get_endpoint = si_adapter_get_endpoint;
}
static GVariant *
si_adapter_get_registration_info (WpSiEndpoint * item)
{
......
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