mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	client-stream: send node_id to client
Send the node_id of the client-stream node to the client.
This commit is contained in:
		
							parent
							
								
									ca61fd1405
								
							
						
					
					
						commit
						bbd5c941d2
					
				
					 3 changed files with 17 additions and 11 deletions
				
			
		| 
						 | 
					@ -1160,6 +1160,16 @@ static void client_node_resource_destroy(void *data)
 | 
				
			||||||
	pw_node_destroy(this->node);
 | 
						pw_node_destroy(this->node);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void pw_client_node_registered(struct pw_client_node *this, uint32_t node_id)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_client_node_resource_transport(this->resource,
 | 
				
			||||||
 | 
										  node_id,
 | 
				
			||||||
 | 
										  impl->other_fds[0],
 | 
				
			||||||
 | 
										  impl->other_fds[1]);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void node_initialized(void *data)
 | 
					static void node_initialized(void *data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct impl *impl = data;
 | 
						struct impl *impl = data;
 | 
				
			||||||
| 
						 | 
					@ -1167,7 +1177,6 @@ static void node_initialized(void *data)
 | 
				
			||||||
	struct pw_node *node = this->node;
 | 
						struct pw_node *node = this->node;
 | 
				
			||||||
	struct pw_type *t = impl->t;
 | 
						struct pw_type *t = impl->t;
 | 
				
			||||||
	struct pw_global *global;
 | 
						struct pw_global *global;
 | 
				
			||||||
	uint32_t node_id;
 | 
					 | 
				
			||||||
	uint32_t area_size, size;
 | 
						uint32_t area_size, size;
 | 
				
			||||||
	struct mem *m;
 | 
						struct mem *m;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1200,20 +1209,13 @@ static void node_initialized(void *data)
 | 
				
			||||||
	m = ensure_mem(impl, impl->io_areas->fd, t->data.MemFd, impl->io_areas->flags);
 | 
						m = ensure_mem(impl, impl->io_areas->fd, t->data.MemFd, impl->io_areas->flags);
 | 
				
			||||||
	pw_log_debug("client-node %p: io areas %p", node, impl->io_areas->ptr);
 | 
						pw_log_debug("client-node %p: io areas %p", node, impl->io_areas->ptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((global = pw_node_get_global(node)) != NULL)
 | 
					 | 
				
			||||||
		node_id = pw_global_get_id(global);
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		node_id = SPA_ID_INVALID;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_client_node_resource_transport(this->resource,
 | 
					 | 
				
			||||||
					  node_id,
 | 
					 | 
				
			||||||
					  impl->other_fds[0],
 | 
					 | 
				
			||||||
					  impl->other_fds[1]);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_client_node_resource_set_position(this->resource,
 | 
						pw_client_node_resource_set_position(this->resource,
 | 
				
			||||||
					     m->id,
 | 
										     m->id,
 | 
				
			||||||
					     area_size,
 | 
										     area_size,
 | 
				
			||||||
					     sizeof(struct pw_client_node_position));
 | 
										     sizeof(struct pw_client_node_position));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if ((global = pw_node_get_global(node)) != NULL)
 | 
				
			||||||
 | 
							pw_client_node_registered(this, pw_global_get_id(global));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void node_free(void *data)
 | 
					static void node_free(void *data)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,6 +47,8 @@ pw_client_node_new(struct pw_resource *resource,
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
pw_client_node_destroy(struct pw_client_node *node);
 | 
					pw_client_node_destroy(struct pw_client_node *node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void pw_client_node_registered(struct pw_client_node *node, uint32_t node_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __cplusplus
 | 
					#ifdef __cplusplus
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -938,6 +938,8 @@ static void client_node_initialized(void *data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_node_register(impl->this.node, NULL, NULL, NULL);
 | 
						pw_node_register(impl->this.node, NULL, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_client_node_registered(impl->client_node, impl->this.node->global->id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug("client-stream %p: activating", &impl->this);
 | 
						pw_log_debug("client-stream %p: activating", &impl->this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_node_set_active(impl->this.node, true);
 | 
						pw_node_set_active(impl->this.node, true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue