Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julian Bouzas
WirePlumber
Commits
3f60716f
Commit
3f60716f
authored
Apr 19, 2021
by
Julian Bouzas
Browse files
modules: remove 'monitor' port context from si-audio-adapter and si-node
parent
ecef960b
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/module-si-audio-adapter.c
View file @
3f60716f
...
...
@@ -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 */
...
...
modules/module-si-node.c
View file @
3f60716f
...
...
@@ -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 */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment