mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
pipewire: switch to new property helpers
This commit is contained in:
parent
56bc3508c4
commit
c59ede837d
5 changed files with 12 additions and 32 deletions
|
|
@ -253,7 +253,6 @@ int pw_buffers_negotiate(struct pw_context *context, uint32_t flags,
|
|||
uint32_t types, *data_types;
|
||||
struct port output = { outnode, SPA_DIRECTION_OUTPUT, out_port_id };
|
||||
struct port input = { innode, SPA_DIRECTION_INPUT, in_port_id };
|
||||
const char *str;
|
||||
int res;
|
||||
|
||||
res = param_filter(result, &input, &output, SPA_PARAM_Buffers, &b);
|
||||
|
|
@ -281,10 +280,7 @@ int pw_buffers_negotiate(struct pw_context *context, uint32_t flags,
|
|||
|
||||
max_buffers = context->settings.link_max_buffers;
|
||||
|
||||
if ((str = pw_properties_get(context->properties, PW_KEY_CPU_MAX_ALIGN)) != NULL)
|
||||
align = pw_properties_parse_int(str);
|
||||
else
|
||||
align = MAX_ALIGN;
|
||||
align = pw_properties_get_uint32(context->properties, PW_KEY_CPU_MAX_ALIGN, MAX_ALIGN);
|
||||
|
||||
minsize = stride = 0;
|
||||
types = SPA_ID_INVALID; /* bitmask of allowed types */
|
||||
|
|
|
|||
|
|
@ -408,8 +408,7 @@ struct pw_context *pw_context_new(struct pw_loop *main_loop,
|
|||
(str = pw_properties_get(properties, "log.level")) != NULL)
|
||||
pw_log_set_level(atoi(str));
|
||||
|
||||
if ((str = pw_properties_get(properties, "mem.mlock-all")) != NULL &&
|
||||
pw_properties_parse_bool(str)) {
|
||||
if (pw_properties_get_bool(properties, "mem.mlock-all", false)) {
|
||||
if (mlockall(MCL_CURRENT | MCL_FUTURE) < 0)
|
||||
pw_log_warn("%p: could not mlockall; %m", impl);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1455,7 +1455,6 @@ pw_filter_connect(struct pw_filter *filter,
|
|||
uint32_t n_params)
|
||||
{
|
||||
struct filter *impl = SPA_CONTAINER_OF(filter, struct filter, this);
|
||||
const char *str;
|
||||
int res;
|
||||
uint32_t i;
|
||||
struct spa_dict_item items[1];
|
||||
|
|
@ -1465,8 +1464,7 @@ pw_filter_connect(struct pw_filter *filter,
|
|||
|
||||
impl->process_rt = SPA_FLAG_IS_SET(flags, PW_FILTER_FLAG_RT_PROCESS);
|
||||
|
||||
if ((str = pw_properties_get(filter->properties, "mem.warn-mlock")) != NULL)
|
||||
impl->warn_mlock = pw_properties_parse_bool(str);
|
||||
impl->warn_mlock = pw_properties_get_bool(filter->properties, "mem.warn-mlock", impl->warn_mlock);
|
||||
|
||||
impl->impl_node.iface = SPA_INTERFACE_INIT(
|
||||
SPA_TYPE_INTERFACE_Node,
|
||||
|
|
|
|||
|
|
@ -1166,7 +1166,6 @@ struct pw_impl_link *pw_context_create_link(struct pw_context *context,
|
|||
struct impl *impl;
|
||||
struct pw_impl_link *this;
|
||||
struct pw_impl_node *input_node, *output_node;
|
||||
const char *str;
|
||||
int res;
|
||||
|
||||
if (output == input)
|
||||
|
|
@ -1218,8 +1217,7 @@ struct pw_impl_link *pw_context_create_link(struct pw_context *context,
|
|||
this->input = input;
|
||||
|
||||
/* passive means that this link does not make the nodes active */
|
||||
if ((str = pw_properties_get(properties, PW_KEY_LINK_PASSIVE)) != NULL)
|
||||
this->passive = pw_properties_parse_bool(str);
|
||||
this->passive = pw_properties_get_bool(properties, PW_KEY_LINK_PASSIVE, false);
|
||||
|
||||
spa_hook_list_init(&this->listener_list);
|
||||
|
||||
|
|
|
|||
|
|
@ -837,17 +837,10 @@ static void check_properties(struct pw_impl_node *node)
|
|||
pw_log_debug("%p: name '%s'", node, node->name);
|
||||
}
|
||||
|
||||
str = pw_properties_get(node->properties, PW_KEY_NODE_PAUSE_ON_IDLE);
|
||||
impl->pause_on_idle = str ? pw_properties_parse_bool(str) : true;
|
||||
|
||||
str = pw_properties_get(node->properties, PW_KEY_NODE_CACHE_PARAMS);
|
||||
impl->cache_params = str ? pw_properties_parse_bool(str) : true;
|
||||
|
||||
str = pw_properties_get(node->properties, "node.transport.sync");
|
||||
node->transport_sync = str ? pw_properties_parse_bool(str) : false;
|
||||
|
||||
str = pw_properties_get(node->properties, PW_KEY_NODE_DRIVER);
|
||||
driver = str ? pw_properties_parse_bool(str) : false;
|
||||
impl->pause_on_idle = pw_properties_get_bool(node->properties, PW_KEY_NODE_PAUSE_ON_IDLE, true);
|
||||
impl->cache_params = pw_properties_get_bool(node->properties, PW_KEY_NODE_CACHE_PARAMS, true);
|
||||
node->transport_sync = pw_properties_get_bool(node->properties, "node.transport.sync", false);
|
||||
driver = pw_properties_get_bool(node->properties, PW_KEY_NODE_DRIVER, false);
|
||||
|
||||
if (node->driver != driver) {
|
||||
pw_log_debug("%p: driver %d -> %d", node, node->driver, driver);
|
||||
|
|
@ -872,11 +865,9 @@ static void check_properties(struct pw_impl_node *node)
|
|||
recalc_reason = "group changed";
|
||||
}
|
||||
|
||||
str = pw_properties_get(node->properties, PW_KEY_NODE_WANT_DRIVER);
|
||||
node->want_driver = str ? pw_properties_parse_bool(str) : false;
|
||||
|
||||
str = pw_properties_get(node->properties, PW_KEY_NODE_ALWAYS_PROCESS);
|
||||
node->always_process = str ? pw_properties_parse_bool(str) : false;
|
||||
node->want_driver = pw_properties_get_bool(node->properties, PW_KEY_NODE_WANT_DRIVER, false);
|
||||
node->always_process = pw_properties_get_bool(node->properties, PW_KEY_NODE_ALWAYS_PROCESS, false);
|
||||
|
||||
if (node->always_process)
|
||||
node->want_driver = true;
|
||||
|
|
@ -903,8 +894,7 @@ static void check_properties(struct pw_impl_node *node)
|
|||
}
|
||||
}
|
||||
}
|
||||
str = pw_properties_get(node->properties, PW_KEY_NODE_LOCK_QUANTUM);
|
||||
node->lock_quantum = str ? pw_properties_parse_bool(str) : false;
|
||||
node->lock_quantum = pw_properties_get_bool(node->properties, PW_KEY_NODE_LOCK_QUANTUM, false);
|
||||
|
||||
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_RATE))) {
|
||||
if (sscanf(str, "%u/%u", &frac.num, &frac.denom) == 2 && frac.denom != 0) {
|
||||
|
|
@ -917,8 +907,7 @@ static void check_properties(struct pw_impl_node *node)
|
|||
}
|
||||
}
|
||||
}
|
||||
str = pw_properties_get(node->properties, PW_KEY_NODE_LOCK_RATE);
|
||||
node->lock_rate = str ? pw_properties_parse_bool(str) : false;
|
||||
node->lock_rate = pw_properties_get_bool(node->properties, PW_KEY_NODE_LOCK_RATE, false);
|
||||
|
||||
pw_log_debug("%p: driver:%d recalc:%s active:%d", node, node->driver,
|
||||
recalc_reason, node->active);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue