mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pw-cat: report delay
This commit is contained in:
		
							parent
							
								
									c81fe38285
								
							
						
					
					
						commit
						7bdcfb6383
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -894,6 +894,17 @@ static void do_quit(void *userdata, int signal_number)
 | 
			
		|||
	pw_main_loop_quit(data->loop);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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("now=%li rate=%u/%u ticks=%lu delay=%li queued=%lu\n",
 | 
			
		||||
		time.now,
 | 
			
		||||
		time.rate.num, time.rate.denom,
 | 
			
		||||
		time.ticks, time.delay, time.queued);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
	OPT_VERSION = 1000,
 | 
			
		||||
	OPT_MEDIA_TYPE,
 | 
			
		||||
| 
						 | 
				
			
			@ -1620,6 +1631,12 @@ int main(int argc, char *argv[])
 | 
			
		|||
					data.mode == mode_playback ? "playback" : "record",
 | 
			
		||||
					data.target_id);
 | 
			
		||||
 | 
			
		||||
		if (data.verbose) {
 | 
			
		||||
			struct timespec timeout = {0, 1}, interval = {1, 0};
 | 
			
		||||
			struct spa_source *timer = pw_loop_add_timer(l, do_print_delay, &data);
 | 
			
		||||
			pw_loop_update_timer(l, timer, &timeout, &interval, false);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		ret = pw_stream_connect(data.stream,
 | 
			
		||||
				  data.mode == mode_playback ? PW_DIRECTION_OUTPUT : PW_DIRECTION_INPUT,
 | 
			
		||||
				  data.target_id,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue