interfaces: improve remote API

Add return values to events and method callbacks. This makes it
possible to pass any error or async return value.
Add sync/done/error in both directions so that both proxy and resource
and perform/reply sync and produce errors.
Return a SPA_ASYNC from remote method calls (and events), keep the
sequence number in the connection.
With the core sync/done we can remove the client-node done method and
it's internal sequence number along with the seq number in method calls.
We can also use the method/event async return value to perform a sync
with as the unique sequence number for this method.
Add sync method and done/error event to proxy and resource.
This commit is contained in:
Wim Taymans 2019-02-18 12:31:36 +01:00
parent 0d8821096a
commit eea062ee53
41 changed files with 1180 additions and 817 deletions

View file

@ -550,16 +550,17 @@ static void emit_port_info(struct impl *this,
}
static void fmt_input_port_info(void *data,
static int fmt_input_port_info(void *data,
enum spa_direction direction, uint32_t port,
const struct spa_port_info *info)
{
struct impl *this = data;
if (direction != SPA_DIRECTION_INPUT)
return;
return 0;
emit_port_info(this, direction, port, info);
return 0;
}
static struct spa_node_callbacks fmt_input_callbacks = {
@ -567,16 +568,17 @@ static struct spa_node_callbacks fmt_input_callbacks = {
.port_info = fmt_input_port_info
};
static void fmt_output_port_info(void *data,
static int fmt_output_port_info(void *data,
enum spa_direction direction, uint32_t port,
const struct spa_port_info *info)
{
struct impl *this = data;
if (direction != SPA_DIRECTION_OUTPUT)
return;
return 0;
emit_port_info(this, direction, port, info);
return 0;
}
static struct spa_node_callbacks fmt_output_callbacks = {