mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	remote: add _get_fd method
Add a method to get the fd of the connection.
This commit is contained in:
		
							parent
							
								
									a79e8923b5
								
							
						
					
					
						commit
						bc35d30407
					
				
					 5 changed files with 22 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -527,6 +527,15 @@ static int impl_connect(struct pw_protocol_client *client)
 | 
			
		|||
        return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int impl_get_fd(struct pw_protocol_client *client)
 | 
			
		||||
{
 | 
			
		||||
	struct client *impl = SPA_CONTAINER_OF(client, struct client, this);
 | 
			
		||||
 | 
			
		||||
	if (impl->source == NULL)
 | 
			
		||||
		return -EIO;
 | 
			
		||||
 | 
			
		||||
	return impl->source->fd;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_remote_data(void *data, int fd, enum spa_io mask)
 | 
			
		||||
| 
						 | 
				
			
			@ -698,6 +707,7 @@ impl_new_client(struct pw_protocol *protocol,
 | 
			
		|||
	impl->properties = properties ? pw_properties_copy(properties) : NULL;
 | 
			
		||||
 | 
			
		||||
	this->connect = impl_connect;
 | 
			
		||||
	this->get_fd = impl_get_fd;
 | 
			
		||||
	this->connect_fd = impl_connect_fd;
 | 
			
		||||
	this->disconnect = impl_disconnect;
 | 
			
		||||
	this->destroy = impl_destroy;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue