remote: move node export code to client-node module

Make the code to export objects more generic. Make it possible for
modules to register a type to export.
Make the client-node also able to export plain spa_nodes.
Let the remote signal the global of the exported object if any. We can
then remote the (unused) remote_id from the proxy.
This commit is contained in:
Wim Taymans 2019-01-31 11:02:13 +01:00
parent 7ec9de5ac6
commit 31dacd9d6f
20 changed files with 1236 additions and 1055 deletions

View file

@ -72,7 +72,6 @@ struct data {
struct pw_remote *remote;
struct spa_hook remote_listener;
struct pw_node *node;
struct spa_port_info port_info;
struct spa_node impl_node;
@ -493,13 +492,8 @@ static void make_node(struct data *data)
pw_properties_set(props, PW_NODE_PROP_CATEGORY, "Capture");
pw_properties_set(props, PW_NODE_PROP_ROLE, "Camera");
data->node = pw_node_new(data->core, "SDL-sink", props, 0);
data->impl_node = impl_node;
pw_node_set_implementation(data->node, &data->impl_node);
pw_node_register(data->node, NULL, NULL, NULL);
pw_node_set_active(data->node, true);
pw_remote_export(data->remote, data->node);
pw_remote_export(data->remote, SPA_TYPE_INTERFACE_Node, props, &data->impl_node);
}
static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remote_state state, const char *error)

View file

@ -505,14 +505,8 @@ static void make_node(struct data *data)
if (data->path)
pw_properties_set(props, PW_NODE_PROP_TARGET_NODE, data->path);
data->node = pw_node_new(data->core, "export-source", props, 0);
data->impl_node = impl_node;
pw_node_set_implementation(data->node, &data->impl_node);
pw_node_register(data->node, NULL, NULL, NULL);
pw_node_set_active(data->node, true);
pw_remote_export(data->remote, data->node);
pw_remote_export(data->remote, SPA_TYPE_INTERFACE_Node, props, &data->impl_node);
}
static void on_state_changed(void *_data, enum pw_remote_state old,

View file

@ -70,7 +70,7 @@ static int make_node(struct data *data)
pw_node_set_active(data->node, true);
pw_remote_export(data->remote, data->node);
pw_remote_export(data->remote, PW_TYPE_INTERFACE_Node, NULL, data->node);
return 0;
}