mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	impl-node: add compat with old nodes
This commit is contained in:
		
							parent
							
								
									c89a68b0b4
								
							
						
					
					
						commit
						e045ef0e4c
					
				
					 4 changed files with 14 additions and 6 deletions
				
			
		| 
						 | 
					@ -1802,6 +1802,10 @@ struct pw_impl_client_node *pw_impl_client_node_new(struct pw_resource *resource
 | 
				
			||||||
	if (resource->version < 5) {
 | 
						if (resource->version < 5) {
 | 
				
			||||||
		pw_log_warn("using server side driver for old client version %d", resource->version);
 | 
							pw_log_warn("using server side driver for old client version %d", resource->version);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (resource->version < 6) {
 | 
				
			||||||
 | 
							pw_log_warn("using server side status for old client version %d", resource->version);
 | 
				
			||||||
 | 
							this->node->server_status = true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_resource_add_listener(this->resource,
 | 
						pw_resource_add_listener(this->resource,
 | 
				
			||||||
				&impl->resource_listener,
 | 
									&impl->resource_listener,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,8 +25,9 @@ extern "C" {
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * version 4: new port_set_mix_info event added
 | 
					 * version 4: new port_set_mix_info event added
 | 
				
			||||||
 * version 5: driver nodes are scheduled on the client
 | 
					 * version 5: driver nodes are scheduled on the client
 | 
				
			||||||
 | 
					 * version 6: client needs to set activation INACTIVE -> FINISHED
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#define PW_VERSION_CLIENT_NODE			5
 | 
					#define PW_VERSION_CLIENT_NODE			6
 | 
				
			||||||
struct pw_client_node;
 | 
					struct pw_client_node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PW_EXTENSION_MODULE_CLIENT_NODE		PIPEWIRE_MODULE_PREFIX "module-client-node"
 | 
					#define PW_EXTENSION_MODULE_CLIENT_NODE		PIPEWIRE_MODULE_PREFIX "module-client-node"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -147,9 +147,10 @@ do_node_prepare(struct spa_loop *loop, bool async, uint32_t seq,
 | 
				
			||||||
			pw_log_warn("%p: read failed %m", this);
 | 
								pw_log_warn("%p: read failed %m", this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spa_loop_add_source(loop, &this->source);
 | 
							spa_loop_add_source(loop, &this->source);
 | 
				
			||||||
 | 
					 | 
				
			||||||
		SPA_ATOMIC_STORE(this->rt.target.activation->status, PW_NODE_ACTIVATION_FINISHED);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (!this->remote || this->server_status)
 | 
				
			||||||
 | 
							SPA_ATOMIC_STORE(this->rt.target.activation->status, PW_NODE_ACTIVATION_FINISHED);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_list_for_each(t, &this->rt.target_list, link)
 | 
						spa_list_for_each(t, &this->rt.target_list, link)
 | 
				
			||||||
		activate_target(this, t);
 | 
							activate_target(this, t);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -178,7 +179,7 @@ do_node_unprepare(struct spa_loop *loop, bool async, uint32_t seq,
 | 
				
			||||||
	if (!this->rt.prepared)
 | 
						if (!this->rt.prepared)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!this->remote) {
 | 
						if (!this->remote || this->server_status) {
 | 
				
			||||||
		/* We mark ourself as finished now, this will avoid going further into the process loop
 | 
							/* We mark ourself as finished now, this will avoid going further into the process loop
 | 
				
			||||||
		 * in case our fd was ready (removing ourselfs from the loop should avoid that as well).
 | 
							 * in case our fd was ready (removing ourselfs from the loop should avoid that as well).
 | 
				
			||||||
		 * If we were supposed to be scheduled make sure we continue the graph for the peers we
 | 
							 * If we were supposed to be scheduled make sure we continue the graph for the peers we
 | 
				
			||||||
| 
						 | 
					@ -186,9 +187,10 @@ do_node_unprepare(struct spa_loop *loop, bool async, uint32_t seq,
 | 
				
			||||||
		old_state = SPA_ATOMIC_XCHG(this->rt.target.activation->status, PW_NODE_ACTIVATION_INACTIVE);
 | 
							old_state = SPA_ATOMIC_XCHG(this->rt.target.activation->status, PW_NODE_ACTIVATION_INACTIVE);
 | 
				
			||||||
		if (old_state != PW_NODE_ACTIVATION_FINISHED)
 | 
							if (old_state != PW_NODE_ACTIVATION_FINISHED)
 | 
				
			||||||
			trigger = get_time_ns(this->rt.target.system);
 | 
								trigger = get_time_ns(this->rt.target.system);
 | 
				
			||||||
 | 
					 | 
				
			||||||
		spa_loop_remove_source(loop, &this->source);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (!this->remote)
 | 
				
			||||||
 | 
							spa_loop_remove_source(loop, &this->source);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_list_for_each(t, &this->rt.target_list, link)
 | 
						spa_list_for_each(t, &this->rt.target_list, link)
 | 
				
			||||||
		deactivate_target(this, t, trigger);
 | 
							deactivate_target(this, t, trigger);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -748,6 +748,7 @@ struct pw_impl_node {
 | 
				
			||||||
	unsigned int sync:1;		/**< the sync-groups are active */
 | 
						unsigned int sync:1;		/**< the sync-groups are active */
 | 
				
			||||||
	unsigned int transport:1;	/**< the transport is active */
 | 
						unsigned int transport:1;	/**< the transport is active */
 | 
				
			||||||
	unsigned int async:1;		/**< async processing, one cycle latency */
 | 
						unsigned int async:1;		/**< async processing, one cycle latency */
 | 
				
			||||||
 | 
						unsigned int server_status:1;	/**< old client, do status on server */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint32_t port_user_data_size;	/**< extra size for port user data */
 | 
						uint32_t port_user_data_size;	/**< extra size for port user data */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue