mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	improve debug
This commit is contained in:
		
							parent
							
								
									c658574c01
								
							
						
					
					
						commit
						7febf7ea25
					
				
					 6 changed files with 16 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -840,6 +840,7 @@ static void on_success(pa_operation *o, void *userdata)
 | 
			
		|||
{
 | 
			
		||||
	struct success_data *d = userdata;
 | 
			
		||||
	pa_context *c = o->context;
 | 
			
		||||
	pw_log_debug("context %p: error %d", c, d->error);
 | 
			
		||||
	if (d->error != 0)
 | 
			
		||||
		pa_context_set_error(c, d->error);
 | 
			
		||||
	if (d->cb)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -152,11 +152,15 @@ do {									\
 | 
			
		|||
 | 
			
		||||
#define PA_FAIL(context, error)                                 \
 | 
			
		||||
    do {                                                        \
 | 
			
		||||
	pw_log_debug("fail at %s:%u %s()",			\
 | 
			
		||||
			, __FILE__, __LINE__, __func__);	\
 | 
			
		||||
        return -pa_context_set_error((context), (error));	\
 | 
			
		||||
    } while(false)
 | 
			
		||||
 | 
			
		||||
#define PA_FAIL_RETURN_ANY(context, error, value)      \
 | 
			
		||||
    do {                                               \
 | 
			
		||||
	pw_log_debug("fail at %s:%u %s()",			\
 | 
			
		||||
			, __FILE__, __LINE__, __func__);	\
 | 
			
		||||
        pa_context_set_error((context), (error));         \
 | 
			
		||||
        return value;                                  \
 | 
			
		||||
    } while(false)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,6 +37,7 @@ static void on_success(pa_operation *o, void *userdata)
 | 
			
		|||
{
 | 
			
		||||
	struct success_ack *d = userdata;
 | 
			
		||||
	pa_context *c = o->context;
 | 
			
		||||
	pw_log_debug("error:%d", d->error);
 | 
			
		||||
	if (d->error != 0)
 | 
			
		||||
		pa_context_set_error(c, d->error);
 | 
			
		||||
	if (d->cb)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -449,7 +449,7 @@ static void update_timing_info(pa_stream *s)
 | 
			
		|||
	pw_stream_get_time(s->stream, &pwt);
 | 
			
		||||
	s->timing_info_valid = false;
 | 
			
		||||
	s->queued = pwt.queued;
 | 
			
		||||
	pw_log_trace("stream %p: %"PRIu64, s, s->queued);
 | 
			
		||||
	pw_log_debug("stream %p: %"PRIu64" rate:%d", s, s->queued, pwt.rate.denom);
 | 
			
		||||
 | 
			
		||||
	if (pwt.rate.denom == 0)
 | 
			
		||||
		return;
 | 
			
		||||
| 
						 | 
				
			
			@ -1334,6 +1334,7 @@ pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *use
 | 
			
		|||
 | 
			
		||||
	pw_log_debug("stream %p", s);
 | 
			
		||||
	pw_stream_flush(s->stream, true);
 | 
			
		||||
	update_timing_info(s);
 | 
			
		||||
	o = pa_operation_new(s->context, s, on_success, sizeof(struct success_ack));
 | 
			
		||||
	d = o->userdata;
 | 
			
		||||
	d->cb = cb;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -903,6 +903,9 @@ static int impl_node_process(void *object)
 | 
			
		|||
			db->datas[i].chunk->size = n_samples * outport->stride;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		spa_log_trace_fp(this->log, NAME " %p: n_src:%d n_dst:%d n_samples:%d p:%d",
 | 
			
		||||
				this, n_src_datas, n_dst_datas, n_samples, is_passthrough);
 | 
			
		||||
 | 
			
		||||
		if (!is_passthrough)
 | 
			
		||||
			channelmix_process(&this->mix, n_dst_datas, dst_datas,
 | 
			
		||||
				    n_src_datas, src_datas, n_samples);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1006,9 +1006,11 @@ static int impl_node_process(void *object)
 | 
			
		|||
		dbuf->buf->datas[i].data = dst_datas[i];
 | 
			
		||||
		dbuf->buf->datas[i].chunk->offset = 0;
 | 
			
		||||
		dbuf->buf->datas[i].chunk->size = n_samples * outport->stride;
 | 
			
		||||
		spa_log_trace_fp(this->log, NAME " %p %p %d", this, dst_datas[i],
 | 
			
		||||
				n_samples * outport->stride);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	spa_log_trace_fp(this->log, NAME " %p: n_src:%d n_dst:%d n_samples:%d max:%d p:%d", this,
 | 
			
		||||
			n_src_datas, n_dst_datas, n_samples, maxsize, this->is_passthrough);
 | 
			
		||||
 | 
			
		||||
	if (!this->is_passthrough)
 | 
			
		||||
		convert_process(&this->conv, dst_datas, src_datas, n_samples);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue