mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	camera: work around target_ mishandling
A driver node should use the target_duration and target_rate to adjust the quantum and rate when the graph starts. The camera nodes don't currently support any of this and simply enforce a specific rate and duration for the graph clock. Mark this with a FIXME. Otherwise, pipewire will complain that the node is ignoring the configured graph rate. We should really look at the graph target rate/quantum and only produce a buffer when it is inside the current graph cycle. This would make it possible to join audio and camera nodes and have them be in sync.
This commit is contained in:
		
							parent
							
								
									6363bbd1b9
								
							
						
					
					
						commit
						a0457a3bdf
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -885,9 +885,12 @@ void impl::requestComplete(libcamera::Request *request)
 | 
			
		|||
	}
 | 
			
		||||
	const FrameMetadata &fmd = buffer->metadata();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if (impl->clock) {
 | 
			
		||||
		/* FIXME, we should follow the driver clock and target_ values.
 | 
			
		||||
		 * for now we ignore and use our own. */
 | 
			
		||||
		impl->clock->target_rate = port->rate;
 | 
			
		||||
		impl->clock->target_duration = 1;
 | 
			
		||||
 | 
			
		||||
		impl->clock->nsec = fmd.timestamp;
 | 
			
		||||
		impl->clock->rate = port->rate;
 | 
			
		||||
		impl->clock->position = fmd.sequence;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1289,6 +1289,11 @@ static int mmap_read(struct impl *this)
 | 
			
		|||
	spa_log_trace(this->log, "v4l2 %p: have output %d", this, buf.index);
 | 
			
		||||
 | 
			
		||||
	if (this->clock) {
 | 
			
		||||
		/* FIXME, we should follow the driver clock and target_ values.
 | 
			
		||||
		 * for now we ignore and use our own. */
 | 
			
		||||
		this->clock->target_rate = port->rate;
 | 
			
		||||
		this->clock->target_duration = 1;
 | 
			
		||||
 | 
			
		||||
		this->clock->nsec = pts;
 | 
			
		||||
		this->clock->rate = port->rate;
 | 
			
		||||
		this->clock->position = buf.sequence;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue