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

@ -515,6 +515,8 @@ struct pw_link {
#define pw_resource_events_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_resource_events, m, v, ##__VA_ARGS__)
#define pw_resource_events_destroy(o) pw_resource_events_emit(o, destroy, 0)
#define pw_resource_events_done(o,s) pw_resource_events_emit(o, done, 0, s)
#define pw_resource_events_error(o,e,m) pw_resource_events_emit(o, error, 0, e, m)
struct pw_resource {
struct pw_core *core; /**< the core object */
@ -539,6 +541,7 @@ struct pw_resource {
#define pw_proxy_events_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_proxy_events, m, v, ##__VA_ARGS__)
#define pw_proxy_events_destroy(p) pw_proxy_events_emit(p, destroy, 0)
#define pw_proxy_events_done(p,s) pw_proxy_events_emit(p, done, 0, s)
#define pw_proxy_events_error(p,r,m) pw_proxy_events_emit(p, error, 0, r, m)
struct pw_proxy {