From 9612d35ca4a256e740681ef5470356c3cb263e74 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Mon, 4 May 2020 09:35:22 +0300 Subject: [PATCH] si-interfaces: drop the multi-endpoint interface It's not well-defined; we'll come back to that later --- lib/wp/si-interfaces.c | 55 ------------------------------------- lib/wp/si-interfaces.h | 25 ----------------- modules/module-si-adapter.c | 22 --------------- 3 files changed, 102 deletions(-) diff --git a/lib/wp/si-interfaces.c b/lib/wp/si-interfaces.c index aa8c8046..30b97a62 100644 --- a/lib/wp/si-interfaces.c +++ b/lib/wp/si-interfaces.c @@ -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: * diff --git a/lib/wp/si-interfaces.h b/lib/wp/si-interfaces.h index 44b115de..3130db0a 100644 --- a/lib/wp/si-interfaces.h +++ b/lib/wp/si-interfaces.h @@ -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: * diff --git a/modules/module-si-adapter.c b/modules/module-si-adapter.c index aaa7725d..4278b864 100644 --- a/modules/module-si-adapter.c +++ b/modules/module-si-adapter.c @@ -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) { -- GitLab