mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
Improve debug and small cleanups
This commit is contained in:
parent
170c3e4d6c
commit
0726a608df
7 changed files with 31 additions and 14 deletions
|
|
@ -587,6 +587,8 @@ impl_node_port_set_io(void *object,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
spa_log_debug(this->log, NAME " %p: io %d %p %zd", this, id, data, size);
|
||||
|
||||
switch (id) {
|
||||
case SPA_IO_Buffers:
|
||||
this->io = data;
|
||||
|
|
|
|||
|
|
@ -310,8 +310,8 @@ static int negotiate_link_buffers(struct impl *this, struct link *link)
|
|||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(&align)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
spa_log_debug(this->log, "%p: buffers %d, blocks %d, size %d, align %d",
|
||||
this, buffers, blocks, size, align);
|
||||
spa_log_debug(this->log, "%p: buffers %d, blocks %d, size %d, align %d %d:%d",
|
||||
this, buffers, blocks, size, align, out_alloc, in_alloc);
|
||||
|
||||
datas = alloca(sizeof(struct spa_data) * blocks);
|
||||
memset(datas, 0, sizeof(struct spa_data) * blocks);
|
||||
|
|
@ -329,7 +329,7 @@ static int negotiate_link_buffers(struct impl *this, struct link *link)
|
|||
free(link->buffers);
|
||||
link->buffers = spa_buffer_alloc_array(buffers, flags, 0, NULL, blocks, datas, aligns);
|
||||
if (link->buffers == NULL)
|
||||
return -ENOMEM;
|
||||
return -errno;
|
||||
|
||||
link->n_buffers = buffers;
|
||||
|
||||
|
|
@ -896,8 +896,8 @@ static int impl_node_process(void *object)
|
|||
ready = 0;
|
||||
for (i = 0; i < this->n_nodes; i++) {
|
||||
r = spa_node_process(this->nodes[i]);
|
||||
spa_log_trace_fp(this->log, NAME " %p: process %d %d", this, i, r);
|
||||
|
||||
spa_log_trace_fp(this->log, NAME " %p: process %d %d: %s",
|
||||
this, i, r, r < 0 ? spa_strerror(r) : "ok");
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
|
|
|||
|
|
@ -809,8 +809,11 @@ static int impl_node_process(void *object)
|
|||
inport = GET_IN_PORT(this, 0);
|
||||
|
||||
outio = outport->io;
|
||||
spa_return_val_if_fail(outio != NULL, -EIO);
|
||||
inio = inport->io;
|
||||
|
||||
spa_log_trace_fp(this->log, NAME " %p: io %p %p", this, inio, outio);
|
||||
|
||||
spa_return_val_if_fail(outio != NULL, -EIO);
|
||||
spa_return_val_if_fail(inio != NULL, -EIO);
|
||||
|
||||
spa_log_trace_fp(this->log, NAME " %p: status %p %d %d -> %p %d %d", this,
|
||||
|
|
|
|||
|
|
@ -820,6 +820,9 @@ impl_node_port_set_io(void *object,
|
|||
|
||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||
|
||||
spa_log_debug(this->log, NAME " %p: set io %d on port %d:%d",
|
||||
this, id, direction, port_id);
|
||||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
|
@ -853,8 +856,12 @@ static inline int get_in_buffer(struct impl *this, struct port *port, struct buf
|
|||
{
|
||||
struct spa_io_buffers *io;
|
||||
|
||||
if ((io = port->io) == NULL ||
|
||||
io->status != SPA_STATUS_HAVE_BUFFER ||
|
||||
if ((io = port->io) == NULL) {
|
||||
spa_log_trace_fp(this->log, NAME " %p: no io on port %d",
|
||||
this, port->id);
|
||||
return -EIO;
|
||||
}
|
||||
if (io->status != SPA_STATUS_HAVE_BUFFER ||
|
||||
io->buffer_id >= port->n_buffers) {
|
||||
spa_log_trace_fp(this->log, NAME " %p: empty port %d %p %d %d %d",
|
||||
this, port->id, io, io->status, io->buffer_id,
|
||||
|
|
@ -926,7 +933,8 @@ static int impl_node_process(void *object)
|
|||
spa_return_val_if_fail(outio != NULL, -EIO);
|
||||
spa_return_val_if_fail(this->conv.process != NULL, -EIO);
|
||||
|
||||
spa_log_trace_fp(this->log, NAME " %p: status %d %d", this, outio->status, outio->buffer_id);
|
||||
spa_log_trace_fp(this->log, NAME " %p: status %p %d %d", this,
|
||||
outio, outio->status, outio->buffer_id);
|
||||
|
||||
if ((res = get_out_buffer(this, outport, &dbuf)) != 0)
|
||||
return res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue