mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-19 07:00:10 -05:00
Use errno for result errors
Make new enumeration for data transport status and use errno style error numbers for errors.
This commit is contained in:
parent
dda28b1589
commit
6fb0f580ea
86 changed files with 2019 additions and 1988 deletions
|
|
@ -50,7 +50,7 @@ static inline void spa_graph_data_port_check(struct spa_graph_data *data, struct
|
|||
struct spa_graph_node *node = port->node;
|
||||
uint32_t required = node->required[SPA_DIRECTION_INPUT];
|
||||
|
||||
if (port->io->status == SPA_RESULT_HAVE_BUFFER)
|
||||
if (port->io->status == SPA_STATUS_HAVE_BUFFER)
|
||||
node->ready[SPA_DIRECTION_INPUT]++;
|
||||
|
||||
spa_debug("port %p node %p check %d %d %d", port, node,
|
||||
|
|
@ -85,9 +85,9 @@ static inline bool spa_graph_data_iterate(struct spa_graph_data *data)
|
|||
switch (n->state) {
|
||||
case SPA_GRAPH_STATE_IN:
|
||||
state = spa_node_process_input(n->implementation);
|
||||
if (state == SPA_RESULT_NEED_BUFFER)
|
||||
if (state == SPA_STATUS_NEED_BUFFER)
|
||||
n->state = SPA_GRAPH_STATE_CHECK_IN;
|
||||
else if (state == SPA_RESULT_HAVE_BUFFER)
|
||||
else if (state == SPA_STATUS_HAVE_BUFFER)
|
||||
n->state = SPA_GRAPH_STATE_CHECK_OUT;
|
||||
spa_debug("node %p processed input state %d", n, n->state);
|
||||
if (n == data->node)
|
||||
|
|
@ -97,9 +97,9 @@ static inline bool spa_graph_data_iterate(struct spa_graph_data *data)
|
|||
|
||||
case SPA_GRAPH_STATE_OUT:
|
||||
state = spa_node_process_output(n->implementation);
|
||||
if (state == SPA_RESULT_NEED_BUFFER)
|
||||
if (state == SPA_STATUS_NEED_BUFFER)
|
||||
n->state = SPA_GRAPH_STATE_CHECK_IN;
|
||||
else if (state == SPA_RESULT_HAVE_BUFFER)
|
||||
else if (state == SPA_STATUS_HAVE_BUFFER)
|
||||
n->state = SPA_GRAPH_STATE_CHECK_OUT;
|
||||
spa_debug("node %p processed output state %d", n, n->state);
|
||||
spa_list_append(&data->ready, &n->ready_link);
|
||||
|
|
@ -109,14 +109,14 @@ static inline bool spa_graph_data_iterate(struct spa_graph_data *data)
|
|||
n->ready[SPA_DIRECTION_INPUT] = 0;
|
||||
spa_list_for_each(p, &n->ports[SPA_DIRECTION_INPUT], link) {
|
||||
struct spa_graph_node *pn = p->peer->node;
|
||||
if (p->io->status == SPA_RESULT_NEED_BUFFER) {
|
||||
if (p->io->status == SPA_STATUS_NEED_BUFFER) {
|
||||
if (pn != data->node
|
||||
|| pn->flags & SPA_GRAPH_NODE_FLAG_ASYNC) {
|
||||
pn->state = SPA_GRAPH_STATE_OUT;
|
||||
spa_list_append(&data->ready,
|
||||
&pn->ready_link);
|
||||
}
|
||||
} else if (p->io->status == SPA_RESULT_OK)
|
||||
} else if (p->io->status == SPA_STATUS_OK)
|
||||
n->ready[SPA_DIRECTION_INPUT]++;
|
||||
}
|
||||
case SPA_GRAPH_STATE_CHECK_OUT:
|
||||
|
|
@ -143,7 +143,7 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
|
||||
while(spa_graph_data_iterate(data));
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node)
|
||||
|
|
@ -157,7 +157,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
|
||||
while(spa_graph_data_iterate(data));
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct spa_graph_callbacks spa_graph_impl_default = {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ static inline int spa_graph_scheduler_default(struct spa_graph_node *node)
|
|||
else if (node->action == SPA_GRAPH_ACTION_OUT)
|
||||
res = spa_node_process_output(n);
|
||||
else
|
||||
res = SPA_RESULT_ERROR;
|
||||
res = -EBADF;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ static inline void spa_graph_port_check(struct spa_graph *graph, struct spa_grap
|
|||
{
|
||||
struct spa_graph_node *node = port->node;
|
||||
|
||||
if (port->io->status == SPA_RESULT_HAVE_BUFFER)
|
||||
if (port->io->status == SPA_STATUS_HAVE_BUFFER)
|
||||
node->ready++;
|
||||
|
||||
spa_debug("port %p node %p check %d %d %d", port, node, port->io->status, node->ready, node->required);
|
||||
|
|
@ -65,7 +65,7 @@ static inline void spa_graph_node_update(struct spa_graph *graph, struct spa_gra
|
|||
|
||||
node->ready = 0;
|
||||
spa_list_for_each(p, &node->ports[SPA_DIRECTION_INPUT], link) {
|
||||
if (p->io->status == SPA_RESULT_OK && !(node->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
|
||||
if (p->io->status == SPA_STATUS_OK && !(node->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
|
||||
node->ready++;
|
||||
}
|
||||
spa_debug("node %p update %d ready", node, node->ready);
|
||||
|
|
@ -111,11 +111,11 @@ next:
|
|||
|
||||
if (n->state != SPA_GRAPH_STATE_END) {
|
||||
spa_debug("node %p add ready for CHECK", n);
|
||||
if (state == SPA_RESULT_NEED_BUFFER)
|
||||
if (state == SPA_STATUS_NEED_BUFFER)
|
||||
n->state = SPA_GRAPH_STATE_CHECK_IN;
|
||||
else if (state == SPA_RESULT_HAVE_BUFFER)
|
||||
else if (state == SPA_STATUS_HAVE_BUFFER)
|
||||
n->state = SPA_GRAPH_STATE_CHECK_OUT;
|
||||
else if (state == SPA_RESULT_OK)
|
||||
else if (state == SPA_STATUS_OK)
|
||||
n->state = SPA_GRAPH_STATE_CHECK_OK;
|
||||
spa_list_append(&graph->ready, &n->ready_link);
|
||||
}
|
||||
|
|
@ -128,14 +128,14 @@ next:
|
|||
n->ready = 0;
|
||||
spa_list_for_each(p, &n->ports[SPA_DIRECTION_INPUT], link) {
|
||||
struct spa_graph_node *pn = p->peer->node;
|
||||
if (p->io->status == SPA_RESULT_NEED_BUFFER) {
|
||||
if (p->io->status == SPA_STATUS_NEED_BUFFER) {
|
||||
if (pn != graph->node
|
||||
|| pn->flags & SPA_GRAPH_NODE_FLAG_ASYNC) {
|
||||
pn->state = SPA_GRAPH_STATE_OUT;
|
||||
spa_debug("node %p add ready OUT", n);
|
||||
spa_list_append(&graph->ready, &pn->ready_link);
|
||||
}
|
||||
} else if (p->io->status == SPA_RESULT_OK)
|
||||
} else if (p->io->status == SPA_STATUS_OK)
|
||||
n->ready++;
|
||||
}
|
||||
break;
|
||||
|
|
@ -162,7 +162,7 @@ next:
|
|||
static inline void spa_graph_scheduler_pull(struct spa_graph *graph, struct spa_graph_node *node)
|
||||
{
|
||||
node->action = SPA_GRAPH_ACTION_CHECK;
|
||||
node->state = SPA_RESULT_NEED_BUFFER;
|
||||
node->state = SPA_STATUS_NEED_BUFFER;
|
||||
graph->node = node;
|
||||
spa_debug("node %p start pull", node);
|
||||
if (node->ready_link.next == NULL)
|
||||
|
|
|
|||
|
|
@ -44,11 +44,11 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
continue;
|
||||
pnode = pport->node;
|
||||
spa_debug("node %p peer %p io %d %d", node, pnode, pport->io->status, pport->io->buffer_id);
|
||||
if (pport->io->status == SPA_RESULT_NEED_BUFFER) {
|
||||
if (pport->io->status == SPA_STATUS_NEED_BUFFER) {
|
||||
if (pnode->ready_link.next == NULL)
|
||||
spa_list_append(&ready, &pnode->ready_link);
|
||||
}
|
||||
else if (pport->io->status == SPA_RESULT_OK &&
|
||||
else if (pport->io->status == SPA_STATUS_OK &&
|
||||
!(pnode->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
|
||||
node->ready[SPA_DIRECTION_INPUT]++;
|
||||
}
|
||||
|
|
@ -56,11 +56,11 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
spa_list_for_each_safe(n, t, &ready, ready_link) {
|
||||
n->state = spa_node_process_output(n->implementation);
|
||||
spa_debug("peer %p processed out %d", n, n->state);
|
||||
if (n->state == SPA_RESULT_NEED_BUFFER)
|
||||
if (n->state == SPA_STATUS_NEED_BUFFER)
|
||||
spa_graph_need_input(n->graph, n);
|
||||
else {
|
||||
spa_list_for_each(p, &n->ports[SPA_DIRECTION_OUTPUT], link) {
|
||||
if (p->io->status == SPA_RESULT_HAVE_BUFFER)
|
||||
if (p->io->status == SPA_STATUS_HAVE_BUFFER)
|
||||
node->ready[SPA_DIRECTION_INPUT]++;
|
||||
}
|
||||
}
|
||||
|
|
@ -74,15 +74,15 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
node->ready[SPA_DIRECTION_INPUT] == node->required[SPA_DIRECTION_INPUT]) {
|
||||
node->state = spa_node_process_input(node->implementation);
|
||||
spa_debug("node %p processed in %d", node, node->state);
|
||||
if (node->state == SPA_RESULT_HAVE_BUFFER) {
|
||||
if (node->state == SPA_STATUS_HAVE_BUFFER) {
|
||||
spa_list_for_each(p, &node->ports[SPA_DIRECTION_OUTPUT], link) {
|
||||
if (p->io->status == SPA_RESULT_HAVE_BUFFER)
|
||||
if (p->io->status == SPA_STATUS_HAVE_BUFFER)
|
||||
if (p->peer)
|
||||
p->peer->node->ready[SPA_DIRECTION_INPUT]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node)
|
||||
|
|
@ -106,7 +106,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
}
|
||||
|
||||
pnode = pport->node;
|
||||
if (pport->io->status == SPA_RESULT_HAVE_BUFFER)
|
||||
if (pport->io->status == SPA_STATUS_HAVE_BUFFER)
|
||||
pnode->ready[SPA_DIRECTION_INPUT]++;
|
||||
|
||||
pready = pnode->ready[SPA_DIRECTION_INPUT];
|
||||
|
|
@ -123,12 +123,12 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
spa_list_for_each_safe(n, t, &ready, ready_link) {
|
||||
n->state = spa_node_process_input(n->implementation);
|
||||
spa_debug("node %p chain processed in %d", n, n->state);
|
||||
if (n->state == SPA_RESULT_HAVE_BUFFER)
|
||||
if (n->state == SPA_STATUS_HAVE_BUFFER)
|
||||
spa_graph_have_output(n->graph, n);
|
||||
else {
|
||||
n->ready[SPA_DIRECTION_INPUT] = 0;
|
||||
spa_list_for_each(p, &n->ports[SPA_DIRECTION_INPUT], link) {
|
||||
if (p->io->status == SPA_RESULT_OK &&
|
||||
if (p->io->status == SPA_STATUS_OK &&
|
||||
!(n->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
|
||||
n->ready[SPA_DIRECTION_INPUT]++;
|
||||
}
|
||||
|
|
@ -139,14 +139,14 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
|
||||
node->state = spa_node_process_output(node->implementation);
|
||||
spa_debug("node %p processed out %d", node, node->state);
|
||||
if (node->state == SPA_RESULT_NEED_BUFFER) {
|
||||
if (node->state == SPA_STATUS_NEED_BUFFER) {
|
||||
node->ready[SPA_DIRECTION_INPUT] = 0;
|
||||
spa_list_for_each(p, &node->ports[SPA_DIRECTION_INPUT], link) {
|
||||
if (p->io->status == SPA_RESULT_OK && !(node->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
|
||||
if (p->io->status == SPA_STATUS_OK && !(node->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
|
||||
node->ready[SPA_DIRECTION_INPUT]++;
|
||||
}
|
||||
}
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct spa_graph_callbacks spa_graph_impl_default = {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static inline void check_input(struct spa_graph_node *node)
|
|||
debug("node %p input peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
|
||||
|
||||
pnode->ready[SPA_DIRECTION_OUTPUT]++;
|
||||
if (pport->io->status == SPA_RESULT_OK)
|
||||
if (pport->io->status == SPA_STATUS_OK)
|
||||
node->ready[SPA_DIRECTION_INPUT]++;
|
||||
|
||||
debug("node %p input peer %p out %d %d\n", node, pnode,
|
||||
|
|
@ -81,7 +81,7 @@ static inline void check_output(struct spa_graph_node *node)
|
|||
pnode = pport->node;
|
||||
debug("node %p output peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
|
||||
|
||||
if (pport->io->status == SPA_RESULT_HAVE_BUFFER) {
|
||||
if (pport->io->status == SPA_STATUS_HAVE_BUFFER) {
|
||||
pnode->ready[SPA_DIRECTION_INPUT]++;
|
||||
node->required[SPA_DIRECTION_OUTPUT]++;
|
||||
}
|
||||
|
|
@ -97,21 +97,21 @@ static inline void spa_graph_impl_activate(void *data, struct spa_graph_node *no
|
|||
int res;
|
||||
|
||||
debug("node %p activate %d\n", node, node->state);
|
||||
if (node->state == SPA_RESULT_NEED_BUFFER) {
|
||||
if (node->state == SPA_STATUS_NEED_BUFFER) {
|
||||
res = spa_node_process_input(node->implementation);
|
||||
debug("node %p process in %d\n", node, res);
|
||||
}
|
||||
else if (node->state == SPA_RESULT_HAVE_BUFFER) {
|
||||
else if (node->state == SPA_STATUS_HAVE_BUFFER) {
|
||||
res = spa_node_process_output(node->implementation);
|
||||
debug("node %p process out %d\n", node, res);
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if (res == SPA_RESULT_NEED_BUFFER || (res == SPA_RESULT_OK && node->state == SPA_RESULT_NEED_BUFFER)) {
|
||||
if (res == SPA_STATUS_NEED_BUFFER || (res == SPA_STATUS_OK && node->state == SPA_STATUS_NEED_BUFFER)) {
|
||||
check_input(node);
|
||||
}
|
||||
else if (res == SPA_RESULT_HAVE_BUFFER) {
|
||||
else if (res == SPA_STATUS_HAVE_BUFFER) {
|
||||
check_output(node);
|
||||
}
|
||||
node->state = res;
|
||||
|
|
@ -125,7 +125,7 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
|
||||
debug("node %p start pull\n", node);
|
||||
|
||||
node->state = SPA_RESULT_NEED_BUFFER;
|
||||
node->state = SPA_STATUS_NEED_BUFFER;
|
||||
node->ready[SPA_DIRECTION_INPUT] = 0;
|
||||
|
||||
spa_list_for_each(p, &node->ports[SPA_DIRECTION_INPUT], link) {
|
||||
|
|
@ -140,19 +140,19 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
debug("node %p pull peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
|
||||
|
||||
pnode->ready[SPA_DIRECTION_OUTPUT]++;
|
||||
if (pport->io->status == SPA_RESULT_OK)
|
||||
if (pport->io->status == SPA_STATUS_OK)
|
||||
node->ready[SPA_DIRECTION_INPUT]++;
|
||||
|
||||
debug("node %p pull peer %p out %d %d\n", node, pnode, prequired, pnode->ready[SPA_DIRECTION_OUTPUT]);
|
||||
if (prequired > 0 && pnode->ready[SPA_DIRECTION_OUTPUT] >= prequired) {
|
||||
pnode->state = SPA_RESULT_HAVE_BUFFER;
|
||||
pnode->state = SPA_STATUS_HAVE_BUFFER;
|
||||
spa_graph_impl_activate(data, pnode);
|
||||
}
|
||||
}
|
||||
|
||||
debug("node %p end pull\n", node);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node)
|
||||
|
|
@ -162,7 +162,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
|
||||
debug("node %p start push\n", node);
|
||||
|
||||
node->state = SPA_RESULT_HAVE_BUFFER;
|
||||
node->state = SPA_STATUS_HAVE_BUFFER;
|
||||
|
||||
node->ready[SPA_DIRECTION_OUTPUT] = 0;
|
||||
node->required[SPA_DIRECTION_OUTPUT] = 0;
|
||||
|
|
@ -179,13 +179,13 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
prequired = pnode->required[SPA_DIRECTION_INPUT];
|
||||
debug("node %p push peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
|
||||
|
||||
if (pport->io->status == SPA_RESULT_HAVE_BUFFER) {
|
||||
if (pport->io->status == SPA_STATUS_HAVE_BUFFER) {
|
||||
pnode->ready[SPA_DIRECTION_INPUT]++;
|
||||
node->required[SPA_DIRECTION_OUTPUT]++;
|
||||
}
|
||||
debug("node %p push peer %p in %d %d\n", node, pnode, prequired, pnode->ready[SPA_DIRECTION_INPUT]);
|
||||
if (prequired > 0 && pnode->ready[SPA_DIRECTION_INPUT] >= prequired) {
|
||||
pnode->state = SPA_RESULT_NEED_BUFFER;
|
||||
pnode->state = SPA_STATUS_NEED_BUFFER;
|
||||
spa_graph_impl_activate(data, pnode);
|
||||
}
|
||||
}
|
||||
|
|
@ -195,7 +195,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
}
|
||||
debug("node %p end push\n", node);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct spa_graph_callbacks spa_graph_impl_default = {
|
||||
|
|
|
|||
|
|
@ -44,18 +44,18 @@ static inline void spa_graph_impl_activate(void *data, struct spa_graph_node *no
|
|||
int res = node->state;
|
||||
|
||||
debug("node %p activate %d\n", node, node->state);
|
||||
if (node->state == SPA_RESULT_NEED_BUFFER) {
|
||||
if (node->state == SPA_STATUS_NEED_BUFFER) {
|
||||
res = spa_node_process_input(node->implementation);
|
||||
debug("node %p process in %d\n", node, res);
|
||||
}
|
||||
else if (node->state == SPA_RESULT_HAVE_BUFFER) {
|
||||
else if (node->state == SPA_STATUS_HAVE_BUFFER) {
|
||||
res = spa_node_process_output(node->implementation);
|
||||
debug("node %p process out %d\n", node, res);
|
||||
}
|
||||
|
||||
if (recurse && (res == SPA_RESULT_NEED_BUFFER || res == SPA_RESULT_OK))
|
||||
if (recurse && (res == SPA_STATUS_NEED_BUFFER || res == SPA_STATUS_OK))
|
||||
spa_graph_impl_need_input(data, node);
|
||||
else if (recurse && (res == SPA_RESULT_HAVE_BUFFER))
|
||||
else if (recurse && (res == SPA_STATUS_HAVE_BUFFER))
|
||||
spa_graph_impl_have_output(data, node);
|
||||
else
|
||||
node->state = res;
|
||||
|
|
@ -70,7 +70,7 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
|
||||
debug("node %p start pull\n", node);
|
||||
|
||||
node->state = SPA_RESULT_NEED_BUFFER;
|
||||
node->state = SPA_STATUS_NEED_BUFFER;
|
||||
node->ready[SPA_DIRECTION_INPUT] = 0;
|
||||
required = node->required[SPA_DIRECTION_INPUT];
|
||||
|
||||
|
|
@ -85,15 +85,15 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
prequired = pnode->required[SPA_DIRECTION_OUTPUT];
|
||||
debug("node %p pull peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
|
||||
|
||||
if (pport->io->status == SPA_RESULT_NEED_BUFFER)
|
||||
if (pport->io->status == SPA_STATUS_NEED_BUFFER)
|
||||
pnode->ready[SPA_DIRECTION_OUTPUT]++;
|
||||
else if (pport->io->status == SPA_RESULT_OK)
|
||||
else if (pport->io->status == SPA_STATUS_OK)
|
||||
node->ready[SPA_DIRECTION_INPUT]++;
|
||||
|
||||
debug("node %p pull peer %p out %d %d\n", node, pnode, prequired, pnode->ready[SPA_DIRECTION_OUTPUT]);
|
||||
if (prequired > 0 && pnode->ready[SPA_DIRECTION_OUTPUT] >= prequired) {
|
||||
if (pnode->state == SPA_RESULT_NEED_BUFFER)
|
||||
pnode->state = SPA_RESULT_HAVE_BUFFER;
|
||||
if (pnode->state == SPA_STATUS_NEED_BUFFER)
|
||||
pnode->state = SPA_STATUS_HAVE_BUFFER;
|
||||
spa_graph_impl_activate(data, pnode, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
|
||||
debug("node %p end pull\n", node);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node)
|
||||
|
|
@ -111,7 +111,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
|
||||
debug("node %p start push\n", node);
|
||||
|
||||
node->state = SPA_RESULT_HAVE_BUFFER;
|
||||
node->state = SPA_STATUS_HAVE_BUFFER;
|
||||
node->ready[SPA_DIRECTION_OUTPUT] = 0;
|
||||
node->required[SPA_DIRECTION_OUTPUT] = 0;
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
prequired = pnode->required[SPA_DIRECTION_INPUT];
|
||||
debug("node %p push peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
|
||||
|
||||
if (pport->io->status == SPA_RESULT_HAVE_BUFFER) {
|
||||
if (pport->io->status == SPA_STATUS_HAVE_BUFFER) {
|
||||
pnode->ready[SPA_DIRECTION_INPUT]++;
|
||||
node->required[SPA_DIRECTION_OUTPUT]++;
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
|
||||
debug("node %p end push\n", node);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct spa_graph_callbacks spa_graph_impl_default = {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
}
|
||||
pnode = pport->node;
|
||||
|
||||
if (pport->io->status == SPA_RESULT_NEED_BUFFER) {
|
||||
if (pport->io->status == SPA_STATUS_NEED_BUFFER) {
|
||||
pnode->ready[SPA_DIRECTION_OUTPUT]++;
|
||||
node->required[SPA_DIRECTION_INPUT]++;
|
||||
}
|
||||
|
|
@ -70,13 +70,13 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
|
|||
pnode->state = spa_node_process_output(pnode->implementation);
|
||||
|
||||
spa_debug("peer %p processed out %d", pnode, pnode->state);
|
||||
if (pnode->state == SPA_RESULT_NEED_BUFFER)
|
||||
if (pnode->state == SPA_STATUS_NEED_BUFFER)
|
||||
spa_graph_need_input(pnode->graph, pnode);
|
||||
else if (pnode->state == SPA_RESULT_HAVE_BUFFER)
|
||||
else if (pnode->state == SPA_STATUS_HAVE_BUFFER)
|
||||
spa_graph_have_output(pnode->graph, pnode);
|
||||
}
|
||||
}
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node)
|
||||
|
|
@ -98,7 +98,7 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
}
|
||||
pnode = pport->node;
|
||||
|
||||
if (p->io->status == SPA_RESULT_HAVE_BUFFER) {
|
||||
if (p->io->status == SPA_STATUS_HAVE_BUFFER) {
|
||||
pnode->ready[SPA_DIRECTION_INPUT]++;
|
||||
node->required[SPA_DIRECTION_OUTPUT]++;
|
||||
}
|
||||
|
|
@ -113,13 +113,13 @@ static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *
|
|||
pnode->state = spa_node_process_input(pnode->implementation);
|
||||
|
||||
spa_debug("node %p chain processed in %d", pnode, pnode->state);
|
||||
if (pnode->state == SPA_RESULT_HAVE_BUFFER)
|
||||
if (pnode->state == SPA_STATUS_HAVE_BUFFER)
|
||||
spa_graph_have_output(pnode->graph, pnode);
|
||||
else if (pnode->state == SPA_RESULT_NEED_BUFFER)
|
||||
else if (pnode->state == SPA_STATUS_NEED_BUFFER)
|
||||
spa_graph_need_input(pnode->graph, pnode);
|
||||
}
|
||||
}
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct spa_graph_callbacks spa_graph_impl_default = {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ spa_graph_node_add(struct spa_graph *graph,
|
|||
struct spa_graph_node *node)
|
||||
{
|
||||
node->graph = graph;
|
||||
node->state = SPA_RESULT_OK;
|
||||
node->state = SPA_STATUS_OK;
|
||||
node->ready_link.next = NULL;
|
||||
spa_list_append(&graph->nodes, &node->link);
|
||||
spa_debug("node %p add", node);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue