mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
node_factory -> factory
Rename the node-factory to a more generic object factory. Add type and version to create objects from a factory Start on factory introspection
This commit is contained in:
parent
3c1957fd9d
commit
7f20e04803
24 changed files with 472 additions and 325 deletions
|
|
@ -811,7 +811,7 @@ static bool do_info(struct data *data, const char *cmd, char *args, char **error
|
|||
static bool do_create_node(struct data *data, const char *cmd, char *args, char **error)
|
||||
{
|
||||
struct remote_data *rd = data->current;
|
||||
char *a[3];
|
||||
char *a[2];
|
||||
int n;
|
||||
uint32_t id;
|
||||
struct pw_type *t = data->t;
|
||||
|
|
@ -819,18 +819,18 @@ static bool do_create_node(struct data *data, const char *cmd, char *args, char
|
|||
struct pw_properties *props = NULL;
|
||||
struct proxy_data *pd;
|
||||
|
||||
n = pw_split_ip(args, WHITESPACE, 3, a);
|
||||
if (n < 2) {
|
||||
asprintf(error, "%s <factory-name> <name> [<properties>]", cmd);
|
||||
n = pw_split_ip(args, WHITESPACE, 2, a);
|
||||
if (n < 1) {
|
||||
asprintf(error, "%s <factory-name> [<properties>]", cmd);
|
||||
return false;
|
||||
}
|
||||
if (n == 3)
|
||||
props = parse_props(a[2]);
|
||||
if (n == 2)
|
||||
props = parse_props(a[1]);
|
||||
|
||||
proxy = pw_core_proxy_create_node(rd->core_proxy, a[0], a[1],
|
||||
t->node, PW_VERSION_NODE,
|
||||
props ? &props->dict : NULL,
|
||||
sizeof(struct proxy_data));
|
||||
proxy = pw_core_proxy_create_object(rd->core_proxy, a[0],
|
||||
t->node, PW_VERSION_NODE,
|
||||
props ? &props->dict : NULL,
|
||||
sizeof(struct proxy_data));
|
||||
|
||||
pd = pw_proxy_get_user_data(proxy);
|
||||
pd->rd = rd;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue