mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-01-23 17:40:23 +01:00
si-convert: improve node properties for convert nodes
* do not copy the full alsa node properties set * use a node description that makes the nodes look better in JACK * use . instead of / as a separator for the node.name, like elsewhere * add audio.convert spa lib association in the tests that use si-convert; previously it used to work because library.name was present in the properties copied from the adapter (and it so happens that the adapter lives in the audioconvert spa plugin as well ...)
This commit is contained in:
parent
3bd1a199ed
commit
b59ff48156
4 changed files with 20 additions and 6 deletions
|
|
@ -269,16 +269,24 @@ si_convert_activate_execute_step (WpSessionItem * item,
|
|||
|
||||
/* Create the convert properties based on the adapter properties */
|
||||
node_props = wp_proxy_get_properties (WP_PROXY (node));
|
||||
props = wp_properties_copy (node_props);
|
||||
props = wp_properties_new (
|
||||
PW_KEY_MEDIA_CLASS, "Audio/Convert",
|
||||
PW_KEY_FACTORY_NAME, SPA_NAME_AUDIO_CONVERT,
|
||||
/* make it a driver, so that it activates when linked */
|
||||
PW_KEY_NODE_DRIVER, "true",
|
||||
/* the default mode is 'split', which breaks audio in this case */
|
||||
"factory.mode", "convert",
|
||||
NULL);
|
||||
wp_properties_setf (props, PW_KEY_OBJECT_PATH, "%s:%s",
|
||||
wp_properties_get(props, PW_KEY_OBJECT_PATH),
|
||||
wp_properties_get (node_props, PW_KEY_OBJECT_PATH),
|
||||
self->name);
|
||||
wp_properties_setf (props, PW_KEY_NODE_NAME, "%s/%s/%s",
|
||||
wp_properties_setf (props, PW_KEY_NODE_NAME, "%s.%s.%s",
|
||||
SPA_NAME_AUDIO_CONVERT,
|
||||
wp_properties_get(props, PW_KEY_NODE_NAME),
|
||||
wp_properties_get (node_props, PW_KEY_NODE_NAME),
|
||||
self->name);
|
||||
wp_properties_set (props, PW_KEY_MEDIA_CLASS, "Audio/Convert");
|
||||
wp_properties_set (props, PW_KEY_FACTORY_NAME, SPA_NAME_AUDIO_CONVERT);
|
||||
wp_properties_setf (props, PW_KEY_NODE_DESCRIPTION,
|
||||
"Stream volume for %s: %s",
|
||||
wp_properties_get (node_props, PW_KEY_NODE_DESCRIPTION), self->name);
|
||||
|
||||
/* Create the node */
|
||||
self->node = wp_node_new_from_factory (core, "spa-node-factory",
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ config_endpoint_setup (TestConfigEndpointFixture *f, gconstpointer data)
|
|||
|
||||
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
|
||||
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
|
||||
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
|
||||
"audio.convert", "audioconvert/libspa-audioconvert"), ==, 0);
|
||||
g_assert_nonnull (pw_context_load_module (f->base.server.context,
|
||||
"libpipewire-module-spa-node-factory", NULL, NULL));
|
||||
g_assert_nonnull (pw_context_load_module (f->base.server.context,
|
||||
|
|
|
|||
|
|
@ -165,6 +165,8 @@ config_policy_setup (TestFixture *f, gconstpointer user_data)
|
|||
"fake*", "test/libspa-test"), ==, 0);
|
||||
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
|
||||
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
|
||||
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
|
||||
"audio.convert", "audioconvert/libspa-audioconvert"), ==, 0);
|
||||
g_assert_nonnull (pw_context_load_module (f->base.server.context,
|
||||
"libpipewire-module-spa-node-factory", NULL, NULL));
|
||||
g_assert_nonnull (pw_context_load_module (f->base.server.context,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ test_si_audio_softdsp_endpoint_setup (TestFixture * f, gconstpointer user_data)
|
|||
"fake*", "test/libspa-test"), ==, 0);
|
||||
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
|
||||
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
|
||||
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
|
||||
"audio.convert", "audioconvert/libspa-audioconvert"), ==, 0);
|
||||
g_assert_nonnull (pw_context_load_module (f->base.server.context,
|
||||
"libpipewire-module-spa-node-factory", NULL, NULL));
|
||||
g_assert_nonnull (pw_context_load_module (f->base.server.context,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue