summaryrefslogtreecommitdiff
path: root/spa/tools
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-02-18 12:31:36 +0100
committerWim Taymans <wtaymans@redhat.com>2019-02-18 12:31:36 +0100
commiteea062ee536b0813dd0d4225b5fc01127fcc0c4c (patch)
treeb90ee41a8fc4129c8499932da2f7e40ac9f30347 /spa/tools
parent0d8821096ab0bbd3d7362b981fef57426c9ca154 (diff)
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.
Diffstat (limited to 'spa/tools')
-rw-r--r--spa/tools/spa-inspect.c6
-rw-r--r--spa/tools/spa-monitor.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/spa/tools/spa-inspect.c b/spa/tools/spa-inspect.c
index 0520bfeb..092de015 100644
--- a/spa/tools/spa-inspect.c
+++ b/spa/tools/spa-inspect.c
@@ -136,7 +136,7 @@ inspect_port_params(struct data *data, struct spa_node *node,
}
}
-static void node_info(void *_data, const struct spa_node_info *info)
+static int node_info(void *_data, const struct spa_node_info *info)
{
struct data *data = _data;
@@ -148,9 +148,10 @@ static void node_info(void *_data, const struct spa_node_info *info)
spa_debug_dict(2, info->props);
}
inspect_node_params(data, data->node);
+ return 0;
}
-static void node_port_info(void *_data, enum spa_direction direction, uint32_t id,
+static int node_port_info(void *_data, enum spa_direction direction, uint32_t id,
const struct spa_port_info *info)
{
struct data *data = _data;
@@ -164,6 +165,7 @@ static void node_port_info(void *_data, enum spa_direction direction, uint32_t i
id);
inspect_port_params(data, data->node, direction, id);
}
+ return 0;
}
static const struct spa_node_callbacks node_callbacks =
diff --git a/spa/tools/spa-monitor.c b/spa/tools/spa-monitor.c
index 9786cb22..ccca863d 100644
--- a/spa/tools/spa-monitor.c
+++ b/spa/tools/spa-monitor.c
@@ -61,12 +61,13 @@ static void inspect_item(struct data *data, struct spa_pod *item)
spa_debug_pod(0, NULL, item);
}
-static void on_monitor_info(void *_data, const struct spa_dict *info)
+static int on_monitor_info(void *_data, const struct spa_dict *info)
{
spa_debug_dict(0, info);
+ return 0;
}
-static void on_monitor_event(void *_data, struct spa_event *event)
+static int on_monitor_event(void *_data, struct spa_event *event)
{
struct data *data = _data;
@@ -84,6 +85,7 @@ static void on_monitor_event(void *_data, struct spa_event *event)
inspect_item(data, SPA_POD_CONTENTS(struct spa_event, event));
break;
}
+ return 0;
}
static int do_add_source(struct spa_loop *loop, struct spa_source *source)