mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	link: don't allocate shared meta in shared mem
We can't allocate the shared meta in shared mem because then clients can damage it for other clients. Place it instead right after the buffer metadata array. Filter out the shared metadata for a client, we send it as part of the client_buffer structure. Remove pointer metadata, it's not so useful. Document the layout of the allocated buffers and the shared memory. Work on metadata to define control parameters
This commit is contained in:
		
							parent
							
								
									e774339ffe
								
							
						
					
					
						commit
						4d0bab799c
					
				
					 5 changed files with 158 additions and 69 deletions
				
			
		| 
						 | 
				
			
			@ -540,7 +540,7 @@ spa_proxy_node_port_use_buffers(struct spa_node *node,
 | 
			
		|||
	struct proxy *this;
 | 
			
		||||
	struct impl *impl;
 | 
			
		||||
	struct proxy_port *port;
 | 
			
		||||
	uint32_t i, j;
 | 
			
		||||
	uint32_t i, j, k;
 | 
			
		||||
	size_t n_mem;
 | 
			
		||||
	struct pw_client_node_buffer *mb;
 | 
			
		||||
	struct spa_meta_shared *msh;
 | 
			
		||||
| 
						 | 
				
			
			@ -600,9 +600,11 @@ spa_proxy_node_port_use_buffers(struct spa_node *node,
 | 
			
		|||
						     t->data.MemFd,
 | 
			
		||||
						     msh->fd, msh->flags, msh->offset, msh->size);
 | 
			
		||||
 | 
			
		||||
		for (j = 0; j < buffers[i]->n_metas; j++) {
 | 
			
		||||
			memcpy(&b->buffer.metas[j], &buffers[i]->metas[j], sizeof(struct spa_meta));
 | 
			
		||||
		for (j = 0, k = 0; j < buffers[i]->n_metas; j++) {
 | 
			
		||||
			if (buffers[i]->metas[j].type != t->meta.Shared)
 | 
			
		||||
				memcpy(&b->buffer.metas[k++], &buffers[i]->metas[j], sizeof(struct spa_meta));
 | 
			
		||||
		}
 | 
			
		||||
		b->buffer.n_metas = k;
 | 
			
		||||
 | 
			
		||||
		for (j = 0; j < buffers[i]->n_datas; j++) {
 | 
			
		||||
			struct spa_data *d = &buffers[i]->datas[j];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue