mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	port: add param_changed event
This commit is contained in:
		
							parent
							
								
									4c8f8671d7
								
							
						
					
					
						commit
						8e366a17ee
					
				
					 3 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
					@ -307,6 +307,8 @@ static void emit_params(struct pw_impl_port *port, uint32_t *changed_ids, uint32
 | 
				
			||||||
		struct pw_resource *resource;
 | 
							struct pw_resource *resource;
 | 
				
			||||||
		int subscribed = 0;
 | 
							int subscribed = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							pw_impl_port_emit_param_changed(port, changed_ids[i]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* first check if anyone is subscribed */
 | 
							/* first check if anyone is subscribed */
 | 
				
			||||||
		spa_list_for_each(resource, &port->global->resource_list, link) {
 | 
							spa_list_for_each(resource, &port->global->resource_list, link) {
 | 
				
			||||||
			if ((subscribed = resource_is_subscribed(resource, changed_ids[i])))
 | 
								if ((subscribed = resource_is_subscribed(resource, changed_ids[i])))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,7 +57,7 @@ enum pw_impl_port_state {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Port events, use \ref pw_impl_port_add_listener */
 | 
					/** Port events, use \ref pw_impl_port_add_listener */
 | 
				
			||||||
struct pw_impl_port_events {
 | 
					struct pw_impl_port_events {
 | 
				
			||||||
#define PW_VERSION_IMPL_PORT_EVENTS 0
 | 
					#define PW_VERSION_IMPL_PORT_EVENTS 1
 | 
				
			||||||
	uint32_t version;
 | 
						uint32_t version;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/** The port is destroyed */
 | 
						/** The port is destroyed */
 | 
				
			||||||
| 
						 | 
					@ -87,6 +87,9 @@ struct pw_impl_port_events {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/** a control was removed from the port */
 | 
						/** a control was removed from the port */
 | 
				
			||||||
	void (*control_removed) (void *data, struct pw_control *control);
 | 
						void (*control_removed) (void *data, struct pw_control *control);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/** a parameter changed, since version 1 */
 | 
				
			||||||
 | 
						void (*param_changed) (void *data, uint32_t id);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Create a new port \memberof pw_impl_port
 | 
					/** Create a new port \memberof pw_impl_port
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -638,6 +638,7 @@ struct pw_impl_port_implementation {
 | 
				
			||||||
#define pw_impl_port_emit_state_changed(p,o,s,e)	pw_impl_port_emit(p, state_changed, 0, o, s, e)
 | 
					#define pw_impl_port_emit_state_changed(p,o,s,e)	pw_impl_port_emit(p, state_changed, 0, o, s, e)
 | 
				
			||||||
#define pw_impl_port_emit_control_added(p,c)		pw_impl_port_emit(p, control_added, 0, c)
 | 
					#define pw_impl_port_emit_control_added(p,c)		pw_impl_port_emit(p, control_added, 0, c)
 | 
				
			||||||
#define pw_impl_port_emit_control_removed(p,c)		pw_impl_port_emit(p, control_removed, 0, c)
 | 
					#define pw_impl_port_emit_control_removed(p,c)		pw_impl_port_emit(p, control_removed, 0, c)
 | 
				
			||||||
 | 
					#define pw_impl_port_emit_param_changed(p,i)		pw_impl_port_emit(p, param_changed, 1, i)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PW_IMPL_PORT_IS_CONTROL(port)	SPA_FLAG_MASK(port->flags, \
 | 
					#define PW_IMPL_PORT_IS_CONTROL(port)	SPA_FLAG_MASK(port->flags, \
 | 
				
			||||||
						PW_IMPL_PORT_FLAG_BUFFERS|PW_IMPL_PORT_FLAG_CONTROL,\
 | 
											PW_IMPL_PORT_FLAG_BUFFERS|PW_IMPL_PORT_FLAG_CONTROL,\
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue