mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	protocol-native: pass a message around
Pass a message around to make things more extensible later. Keep fds per message if we ever want to write individual messages. Pass number of fds in the message header. We might need this to close the fds when the proxy is gone.
This commit is contained in:
		
							parent
							
								
									30747942ac
								
							
						
					
					
						commit
						70e62aacd7
					
				
					 7 changed files with 316 additions and 304 deletions
				
			
		| 
						 | 
				
			
			@ -35,8 +35,18 @@ extern "C" {
 | 
			
		|||
 | 
			
		||||
#define PW_TYPE_INFO_PROTOCOL_Native		PW_TYPE_INFO_PROTOCOL_BASE "Native"
 | 
			
		||||
 | 
			
		||||
struct pw_protocol_native_message {
 | 
			
		||||
	uint32_t id;
 | 
			
		||||
	uint32_t opcode;
 | 
			
		||||
	void *data;
 | 
			
		||||
	uint32_t size;
 | 
			
		||||
	uint32_t n_fds;
 | 
			
		||||
	int *fds;
 | 
			
		||||
	int seq;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct pw_protocol_native_demarshal {
 | 
			
		||||
	int (*func) (void *object, void *data, size_t size);
 | 
			
		||||
	int (*func) (void *object, const struct pw_protocol_native_message *msg);
 | 
			
		||||
	uint32_t permissions;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +56,7 @@ struct pw_protocol_native_ext {
 | 
			
		|||
	uint32_t version;
 | 
			
		||||
 | 
			
		||||
	struct spa_pod_builder * (*begin_proxy) (struct pw_proxy *proxy,
 | 
			
		||||
						 uint8_t opcode, int *res);
 | 
			
		||||
			uint8_t opcode, struct pw_protocol_native_message **msg);
 | 
			
		||||
 | 
			
		||||
	uint32_t (*add_proxy_fd) (struct pw_proxy *proxy, int fd);
 | 
			
		||||
	int (*get_proxy_fd) (struct pw_proxy *proxy, uint32_t index);
 | 
			
		||||
| 
						 | 
				
			
			@ -55,7 +65,7 @@ struct pw_protocol_native_ext {
 | 
			
		|||
			  struct spa_pod_builder *builder);
 | 
			
		||||
 | 
			
		||||
	struct spa_pod_builder * (*begin_resource) (struct pw_resource *resource,
 | 
			
		||||
						    uint8_t opcode, int *res);
 | 
			
		||||
			uint8_t opcode, struct pw_protocol_native_message **msg);
 | 
			
		||||
 | 
			
		||||
	uint32_t (*add_resource_fd) (struct pw_resource *resource, int fd);
 | 
			
		||||
	int (*get_resource_fd) (struct pw_resource *resource, uint32_t index);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue