Commit 3f60716f authored by Julian Bouzas's avatar Julian Bouzas
Browse files

modules: remove 'monitor' port context from si-audio-adapter and si-node

parent ecef960b
......@@ -391,18 +391,13 @@ si_audio_adapter_get_ports (WpSiPortInfo * item, const gchar * context)
g_autoptr (WpIterator) it = NULL;
g_auto (GValue) val = G_VALUE_INIT;
WpDirection direction = self->direction;
gboolean monitor_context = FALSE;
guint32 node_id;
/* context can only be NULL, "reverse" or "monitor" */
/* context can only be NULL or "reverse" */
if (!g_strcmp0 (context, "reverse")) {
direction = (self->direction == WP_DIRECTION_INPUT) ?
WP_DIRECTION_OUTPUT : WP_DIRECTION_INPUT;
}
else if (!g_strcmp0 (context, "monitor")) {
direction = WP_DIRECTION_OUTPUT;
monitor_context = TRUE;
}
else if (context != NULL) {
/* on any other context, return an empty list of ports */
return g_variant_new_array (G_VARIANT_TYPE ("(uuu)"), NULL, 0);
......@@ -417,23 +412,14 @@ si_audio_adapter_get_ports (WpSiPortInfo * item, const gchar * context)
{
WpPort *port = g_value_get_object (&val);
g_autoptr (WpProperties) props = NULL;
const gchar *str;
const gchar *channel;
guint32 port_id, channel_id = 0;
gboolean is_monitor = FALSE;
if (wp_port_get_direction (port) != direction)
continue;
/* skip monitor ports if not monitor context, or skip non-monitor ports if
* monitor context */
props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port));
str = wp_properties_get (props, PW_KEY_PORT_MONITOR);
is_monitor = str && pw_properties_parse_bool (str);
if (is_monitor != monitor_context)
continue;
port_id = wp_proxy_get_bound_id (WP_PROXY (port));
props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port));
/* try to find the audio channel; if channel is NULL, this will silently
leave the channel_id to its default value, 0 */
......
......@@ -211,18 +211,13 @@ si_node_get_ports (WpSiPortInfo * item, const gchar * context)
g_autoptr (WpIterator) it = NULL;
g_auto (GValue) val = G_VALUE_INIT;
WpDirection direction = self->direction;
gboolean monitor_context = FALSE;
guint32 node_id;
/* context can only be NULL, "reverse" or "monitor" */
/* context can only be NULL, "reverse" */
if (!g_strcmp0 (context, "reverse")) {
direction = (self->direction == WP_DIRECTION_INPUT) ?
WP_DIRECTION_OUTPUT : WP_DIRECTION_INPUT;
}
else if (!g_strcmp0 (context, "monitor")) {
direction = WP_DIRECTION_OUTPUT;
monitor_context = TRUE;
}
else if (context != NULL) {
/* on any other context, return an empty list of ports */
return g_variant_new_array (G_VARIANT_TYPE ("(uuu)"), NULL, 0);
......@@ -237,23 +232,14 @@ si_node_get_ports (WpSiPortInfo * item, const gchar * context)
{
WpPort *port = g_value_get_object (&val);
g_autoptr (WpProperties) props = NULL;
const gchar *str;
const gchar *channel;
guint32 port_id, channel_id = 0;
gboolean is_monitor = FALSE;
if (wp_port_get_direction (port) != direction)
continue;
/* skip monitor ports if not monitor context, or skip non-monitor ports if
* monitor context */
props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port));
str = wp_properties_get (props, PW_KEY_PORT_MONITOR);
is_monitor = str && pw_properties_parse_bool (str);
if (is_monitor != monitor_context)
continue;
port_id = wp_proxy_get_bound_id (WP_PROXY (port));
props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port));
/* try to find the audio channel; if channel is NULL, this will silently
leave the channel_id to its default value, 0 */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment