mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
client-stream: trigger client-node manually
Don't let the graph scheduler trigger the client-node, instead do it ourselves when the need a buffer for the next quantum.
This commit is contained in:
parent
ce2e605255
commit
757e2ccc79
1 changed files with 16 additions and 26 deletions
|
|
@ -354,7 +354,7 @@ static int debug_params(struct impl *impl, struct spa_node *node,
|
||||||
if (id == t->param.idEnumFormat)
|
if (id == t->param.idEnumFormat)
|
||||||
flag |= SPA_DEBUG_FLAG_FORMAT;
|
flag |= SPA_DEBUG_FLAG_FORMAT;
|
||||||
|
|
||||||
spa_log_error(this->log, "formats:");
|
spa_log_error(this->log, "params %s:", spa_type_map_get_type(t->map, id));
|
||||||
|
|
||||||
state = 0;
|
state = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
@ -363,8 +363,11 @@ static int debug_params(struct impl *impl, struct spa_node *node,
|
||||||
direction, port_id,
|
direction, port_id,
|
||||||
id, &state,
|
id, &state,
|
||||||
NULL, &format, &b);
|
NULL, &format, &b);
|
||||||
if (res <= 0)
|
if (res <= 0) {
|
||||||
|
if (res < 0)
|
||||||
|
spa_log_error(this->log, " error: %s", spa_strerror(res));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
spa_debug_pod(format, flag);
|
spa_debug_pod(format, flag);
|
||||||
}
|
}
|
||||||
|
|
@ -742,7 +745,7 @@ static int impl_node_process(struct spa_node *node)
|
||||||
{
|
{
|
||||||
struct node *this = SPA_CONTAINER_OF(node, struct node, node);
|
struct node *this = SPA_CONTAINER_OF(node, struct node, node);
|
||||||
struct impl *impl = this->impl;
|
struct impl *impl = this->impl;
|
||||||
int status;
|
int status, trigger = 1;
|
||||||
|
|
||||||
impl->ctrl.min_size = impl->ctrl.max_size =
|
impl->ctrl.min_size = impl->ctrl.max_size =
|
||||||
impl->this.node->driver_node->rt.quantum->size;
|
impl->this.node->driver_node->rt.quantum->size;
|
||||||
|
|
@ -751,9 +754,13 @@ static int impl_node_process(struct spa_node *node)
|
||||||
|
|
||||||
if (impl->use_converter) {
|
if (impl->use_converter) {
|
||||||
status = spa_node_process(impl->adapter);
|
status = spa_node_process(impl->adapter);
|
||||||
|
|
||||||
|
if (impl->direction == SPA_DIRECTION_OUTPUT)
|
||||||
|
trigger = status & SPA_STATUS_NEED_BUFFER;
|
||||||
|
else
|
||||||
|
trigger = status & SPA_STATUS_HAVE_BUFFER;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
status = SPA_STATUS_HAVE_BUFFER | SPA_STATUS_NEED_BUFFER;
|
|
||||||
spa_log_trace(this->log, "%p: process %d/%d %d/%d", this,
|
spa_log_trace(this->log, "%p: process %d/%d %d/%d", this,
|
||||||
impl->io->status, impl->io->buffer_id,
|
impl->io->status, impl->io->buffer_id,
|
||||||
impl->client_port_mix.io->status,
|
impl->client_port_mix.io->status,
|
||||||
|
|
@ -763,13 +770,13 @@ static int impl_node_process(struct spa_node *node)
|
||||||
*impl->client_port_mix.io = *impl->io;
|
*impl->client_port_mix.io = *impl->io;
|
||||||
else
|
else
|
||||||
*impl->io = *impl->client_port_mix.io;
|
*impl->io = *impl->client_port_mix.io;
|
||||||
|
|
||||||
|
status = impl->io->status;
|
||||||
}
|
}
|
||||||
spa_log_trace(this->log, "%p: process %d", this, status);
|
spa_log_trace(this->log, "%p: process %d", this, status);
|
||||||
|
|
||||||
if (status & SPA_STATUS_NEED_BUFFER)
|
if (trigger)
|
||||||
impl->client_node->status = SPA_ID_INVALID;
|
spa_graph_run(impl->client_node->node->rt.root.graph);
|
||||||
else
|
|
||||||
impl->client_node->status = SPA_STATUS_HAVE_BUFFER;
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
@ -858,23 +865,6 @@ static void client_node_initialized(void *data)
|
||||||
else
|
else
|
||||||
exclusive = false;
|
exclusive = false;
|
||||||
|
|
||||||
spa_graph_node_remove(&impl->client_node->node->rt.root);
|
|
||||||
spa_graph_node_add(impl->this.node->rt.node.graph, &impl->client_node->node->rt.root);
|
|
||||||
|
|
||||||
if (impl->direction == SPA_DIRECTION_OUTPUT) {
|
|
||||||
spa_graph_link_add(&impl->client_node->node->rt.root,
|
|
||||||
impl->this.node->rt.node.state,
|
|
||||||
&impl->rt.link);
|
|
||||||
impl->rt.link.signal_data = &impl->this.node->rt.node;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
spa_graph_link_add(&impl->this.node->rt.node,
|
|
||||||
impl->client_node->node->rt.node.state,
|
|
||||||
&impl->rt.link);
|
|
||||||
impl->rt.link.signal_data = &impl->client_node->node->rt.node;
|
|
||||||
}
|
|
||||||
impl->rt.link.signal = spa_graph_link_signal_node;
|
|
||||||
|
|
||||||
impl->client_node->node->rt.driver = impl->this.node->rt.driver;
|
impl->client_node->node->rt.driver = impl->this.node->rt.driver;
|
||||||
|
|
||||||
impl->client_port = pw_node_find_port(impl->client_node->node, impl->direction, 0);
|
impl->client_port = pw_node_find_port(impl->client_node->node, impl->direction, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue