keys: add and use some loop keys

This commit is contained in:
Wim Taymans 2024-04-23 11:49:12 +02:00
parent 0e13d088e7
commit 20b52d2082
5 changed files with 17 additions and 8 deletions

View file

@ -3906,7 +3906,7 @@ jack_client_t * jack_client_open (const char *client_name,
client->server_name = NULL;
client->props = pw_properties_new(
"loop.cancel", "true",
PW_KEY_LOOP_CANCEL, "true",
PW_KEY_REMOTE_NAME, client->server_name,
PW_KEY_CLIENT_NAME, client_name,
PW_KEY_CLIENT_API, "jack",

View file

@ -112,11 +112,11 @@ static struct pw_data_loop *loop_new(struct pw_loop *loop, const struct spa_dict
this->rt_prio = -1;
if (props != NULL) {
if ((str = spa_dict_lookup(props, "loop.cancel")) != NULL)
if ((str = spa_dict_lookup(props, PW_KEY_LOOP_CANCEL)) != NULL)
this->cancel = pw_properties_parse_bool(str);
if ((str = spa_dict_lookup(props, "loop.class")) != NULL)
if ((str = spa_dict_lookup(props, PW_KEY_LOOP_CLASS)) != NULL)
class = str;
if ((str = spa_dict_lookup(props, "loop.rt-prio")) != NULL)
if ((str = spa_dict_lookup(props, PW_KEY_LOOP_RT_PRIO)) != NULL)
this->rt_prio = atoi(str);
if ((str = spa_dict_lookup(props, SPA_KEY_THREAD_NAME)) != NULL)
name = str;

View file

@ -69,6 +69,15 @@ extern "C" {
#define PW_KEY_CONFIG_OVERRIDE_PREFIX "config.override.prefix" /**< a config override prefix directory */
#define PW_KEY_CONFIG_OVERRIDE_NAME "config.override.name" /**< a config override file name */
/* loop */
#define PW_KEY_LOOP_NAME "loop.name" /**< the name of a loop */
#define PW_KEY_LOOP_CLASS "loop.class" /**< the classes this loop handles, array of strings */
#define PW_KEY_LOOP_RT_PRIO "loop.rt-prio" /**< realtime priority of the loop */
#define PW_KEY_LOOP_CANCEL "loop.cancel" /**< if the loop can be canceled */
#define PW_KEY_LOOP_RETRY_TIMEOUT "loop.retry-timeout" /**< when the loop invoke queue is full, the timeout
* in microseconds before retrying.
* default = 1 second, 0 = disable */
/* context */
#define PW_KEY_CONTEXT_PROFILE_MODULES "context.profile.modules" /**< a context profile for modules, deprecated */
#define PW_KEY_USER_NAME "context.user-name" /**< The user name that runs pipewire */
@ -183,8 +192,8 @@ extern "C" {
#define PW_KEY_NODE_TRANSPORT_SYNC "node.transport.sync" /**< the node handles transport sync */
#define PW_KEY_NODE_DRIVER "node.driver" /**< node can drive the graph */
#define PW_KEY_NODE_ASYNC "node.async" /**< the node wants async scheduling */
#define PW_KEY_NODE_LOOP_NAME "node.loop.name" /**< the loop name to run in */
#define PW_KEY_NODE_LOOP_CLASS "node.loop.class" /**< the loop class to run in */
#define PW_KEY_NODE_LOOP_NAME "node.loop.name" /**< the loop name fnmatch pattern to run in */
#define PW_KEY_NODE_LOOP_CLASS "node.loop.class" /**< the loop class fnmatch pattern to run in */
#define PW_KEY_NODE_STREAM "node.stream" /**< node is a stream, the server side should
* add a converter */
#define PW_KEY_NODE_VIRTUAL "node.virtual" /**< the node is some sort of virtual

View file

@ -128,7 +128,7 @@ struct pw_loop *pw_loop_new(const struct spa_dict *props)
this->utils = iface;
if (props != NULL) {
if ((str = spa_dict_lookup(props, "loop.name")) != NULL)
if ((str = spa_dict_lookup(props, PW_KEY_LOOP_NAME)) != NULL)
name = str;
}
if (name)

View file

@ -387,7 +387,7 @@ static int ctwd_add_source(struct spa_loop *loop, bool async, uint32_t seq,
PWTEST(cancel_thread_while_dispatching)
{
static const struct spa_dict_item data_loop_props_items[] = {
{ "loop.cancel", "true" },
{ PW_KEY_LOOP_CANCEL, "true" },
};
static const struct spa_dict data_loop_props = SPA_DICT_INIT_ARRAY(data_loop_props_items);