mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Fix change mask names
This commit is contained in:
		
							parent
							
								
									783bbe6c64
								
							
						
					
					
						commit
						ebaaedef75
					
				
					 4 changed files with 30 additions and 26 deletions
				
			
		| 
						 | 
				
			
			@ -299,9 +299,9 @@ struct pw_client_node_methods {
 | 
			
		|||
	 * \param props new properties
 | 
			
		||||
	 */
 | 
			
		||||
	void (*update) (void *object,
 | 
			
		||||
#define PW_MESSAGE_NODE_UPDATE_MAX_INPUTS   (1 << 0)
 | 
			
		||||
#define PW_MESSAGE_NODE_UPDATE_MAX_OUTPUTS  (1 << 1)
 | 
			
		||||
#define PW_MESSAGE_NODE_UPDATE_PROPS        (1 << 2)
 | 
			
		||||
#define PW_CLIENT_NODE_UPDATE_MAX_INPUTS   (1 << 0)
 | 
			
		||||
#define PW_CLIENT_NODE_UPDATE_MAX_OUTPUTS  (1 << 1)
 | 
			
		||||
#define PW_CLIENT_NODE_UPDATE_PROPS        (1 << 2)
 | 
			
		||||
			uint32_t change_mask,
 | 
			
		||||
			uint32_t max_input_ports,
 | 
			
		||||
			uint32_t max_output_ports,
 | 
			
		||||
| 
						 | 
				
			
			@ -321,11 +321,13 @@ struct pw_client_node_methods {
 | 
			
		|||
	 * \param params array of port parameters
 | 
			
		||||
	 * \param info port information
 | 
			
		||||
	 */
 | 
			
		||||
	void (*port_update) (void *object, enum spa_direction direction, uint32_t port_id,
 | 
			
		||||
#define PW_MESSAGE_PORT_UPDATE_POSSIBLE_FORMATS  (1 << 0)
 | 
			
		||||
#define PW_MESSAGE_PORT_UPDATE_FORMAT            (1 << 1)
 | 
			
		||||
#define PW_MESSAGE_PORT_UPDATE_PARAMS            (1 << 2)
 | 
			
		||||
#define PW_MESSAGE_PORT_UPDATE_INFO              (1 << 3)
 | 
			
		||||
	void (*port_update) (void *object,
 | 
			
		||||
			     enum spa_direction direction,
 | 
			
		||||
			     uint32_t port_id,
 | 
			
		||||
#define PW_CLIENT_NODE_PORT_UPDATE_POSSIBLE_FORMATS  (1 << 0)
 | 
			
		||||
#define PW_CLIENT_NODE_PORT_UPDATE_FORMAT            (1 << 1)
 | 
			
		||||
#define PW_CLIENT_NODE_PORT_UPDATE_PARAMS            (1 << 2)
 | 
			
		||||
#define PW_CLIENT_NODE_PORT_UPDATE_INFO              (1 << 3)
 | 
			
		||||
			     uint32_t change_mask,
 | 
			
		||||
			     uint32_t n_possible_formats,
 | 
			
		||||
			     const struct spa_format **possible_formats,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -343,9 +343,9 @@ static void add_node_update(struct pw_stream *stream, uint32_t change_mask)
 | 
			
		|||
	struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
 | 
			
		||||
	uint32_t max_input_ports = 0, max_output_ports = 0;
 | 
			
		||||
 | 
			
		||||
	if (change_mask & PW_MESSAGE_NODE_UPDATE_MAX_INPUTS)
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_UPDATE_MAX_INPUTS)
 | 
			
		||||
		max_input_ports = impl->direction == SPA_DIRECTION_INPUT ? 1 : 0;
 | 
			
		||||
	if (change_mask & PW_MESSAGE_NODE_UPDATE_MAX_OUTPUTS)
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_UPDATE_MAX_OUTPUTS)
 | 
			
		||||
		max_output_ports = impl->direction == SPA_DIRECTION_OUTPUT ? 1 : 0;
 | 
			
		||||
 | 
			
		||||
	pw_client_node_do_update(impl->node_proxy,
 | 
			
		||||
| 
						 | 
				
			
			@ -416,12 +416,12 @@ static void do_node_init(struct pw_stream *stream)
 | 
			
		|||
{
 | 
			
		||||
	struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
 | 
			
		||||
 | 
			
		||||
	add_node_update(stream, PW_MESSAGE_NODE_UPDATE_MAX_INPUTS |
 | 
			
		||||
			PW_MESSAGE_NODE_UPDATE_MAX_OUTPUTS);
 | 
			
		||||
	add_node_update(stream, PW_CLIENT_NODE_UPDATE_MAX_INPUTS |
 | 
			
		||||
			PW_CLIENT_NODE_UPDATE_MAX_OUTPUTS);
 | 
			
		||||
 | 
			
		||||
	impl->port_info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS;
 | 
			
		||||
	add_port_update(stream, PW_MESSAGE_PORT_UPDATE_POSSIBLE_FORMATS |
 | 
			
		||||
			PW_MESSAGE_PORT_UPDATE_INFO);
 | 
			
		||||
	add_port_update(stream, PW_CLIENT_NODE_PORT_UPDATE_POSSIBLE_FORMATS |
 | 
			
		||||
			PW_CLIENT_NODE_PORT_UPDATE_INFO);
 | 
			
		||||
	add_async_complete(stream, 0, SPA_RESULT_OK);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -988,8 +988,8 @@ pw_stream_finish_format(struct pw_stream *stream,
 | 
			
		|||
	set_params(stream, n_params, params);
 | 
			
		||||
 | 
			
		||||
	if (SPA_RESULT_IS_OK(res)) {
 | 
			
		||||
		add_port_update(stream, (n_params ? PW_MESSAGE_PORT_UPDATE_PARAMS : 0) |
 | 
			
		||||
				PW_MESSAGE_PORT_UPDATE_FORMAT);
 | 
			
		||||
		add_port_update(stream, (n_params ? PW_CLIENT_NODE_PORT_UPDATE_PARAMS : 0) |
 | 
			
		||||
				PW_CLIENT_NODE_PORT_UPDATE_FORMAT);
 | 
			
		||||
 | 
			
		||||
		if (!impl->format) {
 | 
			
		||||
			clear_buffers(stream);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -302,7 +302,7 @@ do_update_port(struct proxy *this,
 | 
			
		|||
		port = &this->out_ports[port_id];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (change_mask & PW_MESSAGE_PORT_UPDATE_POSSIBLE_FORMATS) {
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_POSSIBLE_FORMATS) {
 | 
			
		||||
		for (i = 0; i < port->n_formats; i++)
 | 
			
		||||
			free(port->formats[i]);
 | 
			
		||||
		port->n_formats = n_possible_formats;
 | 
			
		||||
| 
						 | 
				
			
			@ -311,13 +311,13 @@ do_update_port(struct proxy *this,
 | 
			
		|||
		for (i = 0; i < port->n_formats; i++)
 | 
			
		||||
			port->formats[i] = spa_format_copy(possible_formats[i]);
 | 
			
		||||
	}
 | 
			
		||||
	if (change_mask & PW_MESSAGE_PORT_UPDATE_FORMAT) {
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_FORMAT) {
 | 
			
		||||
		if (port->format)
 | 
			
		||||
			free(port->format);
 | 
			
		||||
		port->format = spa_format_copy(format);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (change_mask & PW_MESSAGE_PORT_UPDATE_PARAMS) {
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_PARAMS) {
 | 
			
		||||
		for (i = 0; i < port->n_params; i++)
 | 
			
		||||
			free(port->params[i]);
 | 
			
		||||
		port->n_params = n_params;
 | 
			
		||||
| 
						 | 
				
			
			@ -326,7 +326,7 @@ do_update_port(struct proxy *this,
 | 
			
		|||
			port->params[i] = spa_param_copy(params[i]);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (change_mask & PW_MESSAGE_PORT_UPDATE_INFO && info)
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_INFO && info)
 | 
			
		||||
		port->info = *info;
 | 
			
		||||
 | 
			
		||||
	if (!port->valid) {
 | 
			
		||||
| 
						 | 
				
			
			@ -348,10 +348,10 @@ clear_port(struct proxy *this,
 | 
			
		|||
	do_update_port(this,
 | 
			
		||||
		       direction,
 | 
			
		||||
		       port_id,
 | 
			
		||||
		       PW_MESSAGE_PORT_UPDATE_POSSIBLE_FORMATS |
 | 
			
		||||
		       PW_MESSAGE_PORT_UPDATE_FORMAT |
 | 
			
		||||
		       PW_MESSAGE_PORT_UPDATE_PARAMS |
 | 
			
		||||
		       PW_MESSAGE_PORT_UPDATE_INFO, 0, NULL, NULL, 0, NULL, NULL);
 | 
			
		||||
		       PW_CLIENT_NODE_PORT_UPDATE_POSSIBLE_FORMATS |
 | 
			
		||||
		       PW_CLIENT_NODE_PORT_UPDATE_FORMAT |
 | 
			
		||||
		       PW_CLIENT_NODE_PORT_UPDATE_PARAMS |
 | 
			
		||||
		       PW_CLIENT_NODE_PORT_UPDATE_INFO, 0, NULL, NULL, 0, NULL, NULL);
 | 
			
		||||
	clear_buffers(this, port);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -873,9 +873,9 @@ client_node_update(void *object,
 | 
			
		|||
	struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
 | 
			
		||||
	struct proxy *this = &impl->proxy;
 | 
			
		||||
 | 
			
		||||
	if (change_mask & PW_MESSAGE_NODE_UPDATE_MAX_INPUTS)
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_UPDATE_MAX_INPUTS)
 | 
			
		||||
		this->max_inputs = max_input_ports;
 | 
			
		||||
	if (change_mask & PW_MESSAGE_NODE_UPDATE_MAX_OUTPUTS)
 | 
			
		||||
	if (change_mask & PW_CLIENT_NODE_UPDATE_MAX_OUTPUTS)
 | 
			
		||||
		this->max_outputs = max_output_ports;
 | 
			
		||||
 | 
			
		||||
	spa_log_info(this->log, "proxy %p: got node update max_in %u, max_out %u", this,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -133,9 +133,11 @@ struct spa_fraction {
 | 
			
		|||
#ifdef __GNUC__
 | 
			
		||||
#define SPA_PRINTF_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1)))
 | 
			
		||||
#define SPA_ALIGNED(align) __attribute__((aligned(align)))
 | 
			
		||||
#define SPA_DEPRECATED __attribute__ ((deprecated))
 | 
			
		||||
#else
 | 
			
		||||
#define SPA_PRINTF_FUNC(fmt, arg1)
 | 
			
		||||
#define SPA_ALIGNED(align)
 | 
			
		||||
#define SPA_DEPRECATED
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define SPA_ROUND_UP_N(num,align) ((((num) + ((align) - 1)) & ~((align) - 1)))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue