mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
audiomixer: debug port id
This commit is contained in:
parent
b6239fb1ab
commit
1fec67086d
1 changed files with 17 additions and 13 deletions
|
|
@ -65,6 +65,7 @@ struct buffer {
|
||||||
|
|
||||||
struct port {
|
struct port {
|
||||||
bool valid;
|
bool valid;
|
||||||
|
uint32_t id;
|
||||||
|
|
||||||
struct port_props props;
|
struct port_props props;
|
||||||
|
|
||||||
|
|
@ -282,6 +283,7 @@ static int impl_node_add_port(struct spa_node *node, enum spa_direction directio
|
||||||
|
|
||||||
port = GET_IN_PORT (this, port_id);
|
port = GET_IN_PORT (this, port_id);
|
||||||
port->valid = true;
|
port->valid = true;
|
||||||
|
port->id = port_id;
|
||||||
|
|
||||||
port_props_reset(&port->props);
|
port_props_reset(&port->props);
|
||||||
port->io_volume = &port->props.volume;
|
port->io_volume = &port->props.volume;
|
||||||
|
|
@ -868,14 +870,14 @@ add_port_data(struct impl *this, void *out, size_t outsize, struct port *port, i
|
||||||
port->queued_bytes -= outsize;
|
port->queued_bytes -= outsize;
|
||||||
|
|
||||||
if (port->queued_bytes == 0) {
|
if (port->queued_bytes == 0) {
|
||||||
spa_log_trace(this->log, NAME " %p: return buffer %d on port %p %zd",
|
spa_log_trace(this->log, NAME " %p: return buffer %d on port %d %zd",
|
||||||
this, b->outbuf->id, port, outsize);
|
this, b->outbuf->id, port->id, outsize);
|
||||||
port->io->buffer_id = b->outbuf->id;
|
port->io->buffer_id = b->outbuf->id;
|
||||||
spa_list_remove(&b->link);
|
spa_list_remove(&b->link);
|
||||||
b->outstanding = true;
|
b->outstanding = true;
|
||||||
} else {
|
} else {
|
||||||
spa_log_trace(this->log, NAME " %p: keeping buffer %d on port %p %zd %zd",
|
spa_log_trace(this->log, NAME " %p: keeping buffer %d on port %d %zd %zd",
|
||||||
this, b->outbuf->id, port, port->queued_bytes, outsize);
|
this, b->outbuf->id, port->id, port->queued_bytes, outsize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -957,6 +959,8 @@ static int impl_node_process_input(struct spa_node *node)
|
||||||
outio = outport->io;
|
outio = outport->io;
|
||||||
spa_return_val_if_fail(outio != NULL, -EIO);
|
spa_return_val_if_fail(outio != NULL, -EIO);
|
||||||
|
|
||||||
|
spa_log_trace(this->log, NAME " %p: status %d", this, outio->status);
|
||||||
|
|
||||||
if (outio->status == SPA_STATUS_HAVE_BUFFER)
|
if (outio->status == SPA_STATUS_HAVE_BUFFER)
|
||||||
return SPA_STATUS_HAVE_BUFFER;
|
return SPA_STATUS_HAVE_BUFFER;
|
||||||
|
|
||||||
|
|
@ -1007,7 +1011,7 @@ static int impl_node_process_output(struct spa_node *node)
|
||||||
struct impl *this;
|
struct impl *this;
|
||||||
struct port *outport;
|
struct port *outport;
|
||||||
struct spa_io_buffers *outio;
|
struct spa_io_buffers *outio;
|
||||||
int i, res;
|
int i;
|
||||||
size_t min_queued = SIZE_MAX;
|
size_t min_queued = SIZE_MAX;
|
||||||
|
|
||||||
spa_return_val_if_fail(node != NULL, -EINVAL);
|
spa_return_val_if_fail(node != NULL, -EINVAL);
|
||||||
|
|
@ -1018,10 +1022,10 @@ static int impl_node_process_output(struct spa_node *node)
|
||||||
outio = outport->io;
|
outio = outport->io;
|
||||||
spa_return_val_if_fail(outio != NULL, -EIO);
|
spa_return_val_if_fail(outio != NULL, -EIO);
|
||||||
|
|
||||||
if (outio->status == SPA_STATUS_HAVE_BUFFER) {
|
spa_log_trace(this->log, NAME " %p: status %d", this, outio->status);
|
||||||
res = SPA_STATUS_HAVE_BUFFER;
|
|
||||||
|
if (outio->status == SPA_STATUS_HAVE_BUFFER)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
|
||||||
|
|
||||||
/* recycle */
|
/* recycle */
|
||||||
if (outio->buffer_id < outport->n_buffers) {
|
if (outio->buffer_id < outport->n_buffers) {
|
||||||
|
|
@ -1039,7 +1043,7 @@ static int impl_node_process_output(struct spa_node *node)
|
||||||
min_queued = inport->queued_bytes;
|
min_queued = inport->queued_bytes;
|
||||||
}
|
}
|
||||||
if (min_queued != SIZE_MAX && min_queued > 0) {
|
if (min_queued != SIZE_MAX && min_queued > 0) {
|
||||||
res = outio->status = mix_output(this, min_queued);
|
outio->status = mix_output(this, min_queued);
|
||||||
} else {
|
} else {
|
||||||
/* take requested output range and apply to input */
|
/* take requested output range and apply to input */
|
||||||
for (i = 0; i < this->last_port; i++) {
|
for (i = 0; i < this->last_port; i++) {
|
||||||
|
|
@ -1052,17 +1056,16 @@ static int impl_node_process_output(struct spa_node *node)
|
||||||
spa_log_trace(this->log, NAME " %p: port %d queued %zd, res %d", this,
|
spa_log_trace(this->log, NAME " %p: port %d queued %zd, res %d", this,
|
||||||
i, inport->queued_bytes, inio->status);
|
i, inport->queued_bytes, inio->status);
|
||||||
|
|
||||||
if (inport->queued_bytes == 0 && inio->status == SPA_STATUS_OK) {
|
if (inport->queued_bytes == 0) {
|
||||||
if (inport->io_range && outport->io_range)
|
if (inport->io_range && outport->io_range)
|
||||||
*inport->io_range = *outport->io_range;
|
*inport->io_range = *outport->io_range;
|
||||||
inio->status = SPA_STATUS_NEED_BUFFER;
|
inio->status = SPA_STATUS_NEED_BUFFER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outio->status = SPA_STATUS_OK;
|
outio->status = SPA_STATUS_NEED_BUFFER;
|
||||||
res = SPA_STATUS_NEED_BUFFER;
|
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
return res;
|
return outio->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct spa_node impl_node = {
|
static const struct spa_node impl_node = {
|
||||||
|
|
@ -1145,6 +1148,7 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
|
|
||||||
port = GET_OUT_PORT(this, 0);
|
port = GET_OUT_PORT(this, 0);
|
||||||
port->valid = true;
|
port->valid = true;
|
||||||
|
port->id = 0;
|
||||||
port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS |
|
port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS |
|
||||||
SPA_PORT_INFO_FLAG_NO_REF;
|
SPA_PORT_INFO_FLAG_NO_REF;
|
||||||
spa_list_init(&port->queue);
|
spa_list_init(&port->queue);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue