mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	stream: add pw_stream_get_time_n()
Deprecate pw_stream_get_time() in favour of _get_time_n() that contains the size of the pw_time structure. Make the old one fill in the fields up to the buffered field. Make the new one use the size to decide how much info to fill in. Add a new buffered field in pw_time that contains the buffered data inside the converter/resampler. This leaves the queued field with purely the user provided size in the buffers. Use get_time_n() in places.
This commit is contained in:
		
							parent
							
								
									421b3b6ece
								
							
						
					
					
						commit
						5a9d2679ca
					
				
					 6 changed files with 81 additions and 35 deletions
				
			
		| 
						 | 
				
			
			@ -1007,11 +1007,13 @@ static void do_print_delay(void *userdata, uint64_t expirations)
 | 
			
		|||
{
 | 
			
		||||
	struct data *data = userdata;
 | 
			
		||||
	struct pw_time time;
 | 
			
		||||
	pw_stream_get_time(data->stream, &time);
 | 
			
		||||
	printf("stream time: now:%"PRIi64" rate:%u/%u ticks:%"PRIu64" delay:%"PRIi64" queued:%"PRIu64"\n",
 | 
			
		||||
	pw_stream_get_time_n(data->stream, &time, sizeof(time));
 | 
			
		||||
	printf("stream time: now:%"PRIi64" rate:%u/%u ticks:%"PRIu64
 | 
			
		||||
			" delay:%"PRIi64" queued:%"PRIu64
 | 
			
		||||
			" buffered:%"PRIi64" \n",
 | 
			
		||||
		time.now,
 | 
			
		||||
		time.rate.num, time.rate.denom,
 | 
			
		||||
		time.ticks, time.delay, time.queued);
 | 
			
		||||
		time.ticks, time.delay, time.queued, time.buffered);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue