mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
link: emit info_changed event
Small cleanups
This commit is contained in:
parent
f902a34290
commit
d7c26c4b59
6 changed files with 23 additions and 11 deletions
|
|
@ -524,6 +524,9 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", t->param_io.propType, "dr", p->volume, 2, 0.0, 10.0);
|
||||
break;
|
||||
case 3:
|
||||
if (direction == SPA_DIRECTION_OUTPUT)
|
||||
return 0;
|
||||
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, t->param_io.IO,
|
||||
":", t->param_io.id, "I", t->io_prop_mute,
|
||||
|
|
|
|||
|
|
@ -272,7 +272,8 @@ void pw_client_update_properties(struct pw_client *client, const struct spa_dict
|
|||
client->info.change_mask |= PW_CLIENT_CHANGE_MASK_PROPS;
|
||||
client->info.props = client->properties ? &client->properties->dict : NULL;
|
||||
|
||||
spa_hook_list_call(&client->listener_list, struct pw_client_events, info_changed, &client->info);
|
||||
spa_hook_list_call(&client->listener_list, struct pw_client_events,
|
||||
info_changed, &client->info);
|
||||
|
||||
spa_list_for_each(resource, &client->resource_list, link)
|
||||
pw_client_resource_info(resource, &client->info);
|
||||
|
|
|
|||
|
|
@ -583,7 +583,8 @@ void pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict
|
|||
core->info.change_mask = PW_CORE_CHANGE_MASK_PROPS;
|
||||
core->info.props = &core->properties->dict;
|
||||
|
||||
spa_hook_list_call(&core->listener_list, struct pw_core_events, info_changed, &core->info);
|
||||
spa_hook_list_call(&core->listener_list, struct pw_core_events,
|
||||
info_changed, &core->info);
|
||||
|
||||
spa_list_for_each(resource, &core->resource_list, link)
|
||||
pw_core_resource_info(resource, &core->info);
|
||||
|
|
|
|||
|
|
@ -220,6 +220,9 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
if (changed) {
|
||||
this->info.change_mask |= PW_LINK_CHANGE_MASK_FORMAT;
|
||||
|
||||
spa_hook_list_call(&this->listener_list, struct pw_link_events,
|
||||
info_changed, &this->info);
|
||||
|
||||
spa_list_for_each(resource, &this->resource_list, link)
|
||||
pw_link_resource_info(resource, &this->info);
|
||||
|
||||
|
|
@ -335,6 +338,7 @@ static struct spa_buffer **alloc_buffers(struct pw_link *this,
|
|||
void *ddp;
|
||||
uint32_t n_metas;
|
||||
struct spa_meta *metas;
|
||||
struct pw_type *t = &this->core->type;
|
||||
|
||||
n_metas = data_size = meta_size = 0;
|
||||
|
||||
|
|
@ -348,18 +352,18 @@ static struct spa_buffer **alloc_buffers(struct pw_link *this,
|
|||
/* add shared metadata this should not go into shared
|
||||
* memory or else a client can damage it so we inline it after
|
||||
* the array of spa_meta. */
|
||||
metas[n_metas].type = this->core->type.meta.Shared;
|
||||
metas[n_metas].type = t->meta.Shared;
|
||||
metas[n_metas].size = sizeof(struct spa_meta_shared);
|
||||
n_metas++;
|
||||
|
||||
/* collect metadata */
|
||||
for (i = 0; i < n_params; i++) {
|
||||
if (spa_pod_is_object_type (params[i], this->core->type.param_meta.Meta)) {
|
||||
if (spa_pod_is_object_type (params[i], t->param_meta.Meta)) {
|
||||
uint32_t type, size;
|
||||
|
||||
if (spa_pod_object_parse(params[i],
|
||||
":", this->core->type.param_meta.type, "I", &type,
|
||||
":", this->core->type.param_meta.size, "i", &size, NULL) < 0)
|
||||
":", t->param_meta.type, "I", &type,
|
||||
":", t->param_meta.size, "i", &size, NULL) < 0)
|
||||
continue;
|
||||
|
||||
pw_log_debug("link %p: enable meta %d %d", this, type, size);
|
||||
|
|
@ -413,7 +417,7 @@ static struct spa_buffer **alloc_buffers(struct pw_link *this,
|
|||
m->type = metas[j].type;
|
||||
m->size = metas[j].size;
|
||||
|
||||
if (m->type == this->core->type.meta.Shared) {
|
||||
if (m->type == t->meta.Shared) {
|
||||
m->data = msh;
|
||||
}
|
||||
else {
|
||||
|
|
@ -433,7 +437,7 @@ static struct spa_buffer **alloc_buffers(struct pw_link *this,
|
|||
|
||||
d->chunk = &cdp[j];
|
||||
if (data_sizes[j] > 0) {
|
||||
d->type = this->core->type.data.MemFd;
|
||||
d->type = t->data.MemFd;
|
||||
d->flags = 0;
|
||||
d->fd = mem->fd;
|
||||
d->mapoffset = SPA_PTRDIFF(ddp, mem->ptr);
|
||||
|
|
|
|||
|
|
@ -456,7 +456,8 @@ void pw_node_update_properties(struct pw_node *node, const struct spa_dict *dict
|
|||
node->info.props = &node->properties->dict;
|
||||
|
||||
node->info.change_mask = PW_NODE_CHANGE_MASK_PROPS;
|
||||
spa_hook_list_call(&node->listener_list, struct pw_node_events, info_changed, &node->info);
|
||||
spa_hook_list_call(&node->listener_list, struct pw_node_events,
|
||||
info_changed, &node->info);
|
||||
|
||||
spa_list_for_each(resource, &node->resource_list, link)
|
||||
pw_node_resource_info(resource, &node->info);
|
||||
|
|
@ -856,7 +857,8 @@ void pw_node_update_state(struct pw_node *node, enum pw_node_state state, char *
|
|||
old, state, error);
|
||||
|
||||
node->info.change_mask |= PW_NODE_CHANGE_MASK_STATE;
|
||||
spa_hook_list_call(&node->listener_list, struct pw_node_events, info_changed, &node->info);
|
||||
spa_hook_list_call(&node->listener_list, struct pw_node_events,
|
||||
info_changed, &node->info);
|
||||
|
||||
spa_list_for_each(resource, &node->resource_list, link)
|
||||
pw_node_resource_info(resource, &node->info);
|
||||
|
|
|
|||
|
|
@ -152,7 +152,8 @@ static void core_event_info(void *data, struct pw_core_info *info)
|
|||
|
||||
pw_log_debug("remote %p: got core info", this);
|
||||
this->info = pw_core_info_update(this->info, info);
|
||||
spa_hook_list_call(&this->listener_list, struct pw_remote_events, info_changed, this->info);
|
||||
spa_hook_list_call(&this->listener_list, struct pw_remote_events,
|
||||
info_changed, this->info);
|
||||
}
|
||||
|
||||
static void core_event_done(void *data, uint32_t seq)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue