simplify things with just 1 process function

Make just one process function in spa node. With the io area states
we can do more complicated io patterns.
This commit is contained in:
Wim Taymans 2018-03-16 16:55:25 +01:00
parent e8d0281982
commit 9b0a880afb
21 changed files with 202 additions and 359 deletions

View file

@ -229,8 +229,8 @@ static void on_sink_pull(struct data *data)
{
spa_log_trace(data->log, "do sink pull");
if (data->mode & MODE_DIRECT) {
spa_node_process_output(data->source);
spa_node_process_input(data->sink);
spa_node_process(data->source);
spa_node_process(data->sink);
} else {
spa_graph_need_input(&data->graph, &data->sink_node);
}
@ -240,8 +240,8 @@ static void on_source_push(struct data *data)
{
spa_log_trace(data->log, "do source push");
if (data->mode & MODE_DIRECT) {
spa_node_process_output(data->source);
spa_node_process_input(data->sink);
spa_node_process(data->source);
spa_node_process(data->sink);
} else {
spa_graph_have_output(&data->graph, &data->source_node);
}

View file

@ -219,12 +219,12 @@ static void on_sink_need_input(void *_data)
struct data *data = _data;
int res;
res = spa_node_process_output(data->source);
res = spa_node_process(data->source);
if (res != SPA_STATUS_HAVE_BUFFER)
printf("got process_output error from source %d\n", res);
printf("got process error from source %d\n", res);
if ((res = spa_node_process_input(data->sink)) < 0)
printf("got process_input error from sink %d\n", res);
if ((res = spa_node_process(data->sink)) < 0)
printf("got process error from sink %d\n", res);
}
static void

View file

@ -276,7 +276,7 @@ static void on_source_have_output(void *_data)
io->status = SPA_STATUS_NEED_BUFFER;
if ((res = spa_node_process_output(data->source)) < 0)
if ((res = spa_node_process(data->source)) < 0)
printf("got pull error %d\n", res);
}