mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
metadata: return pw_metadata from factory create
That is what the factory return value says.
This commit is contained in:
parent
c968259348
commit
6394eb1b18
2 changed files with 10 additions and 7 deletions
|
|
@ -29,7 +29,7 @@ static const struct spa_dict_item module_props[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void * pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
|
struct pw_metadata *pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
|
||||||
struct pw_properties *properties);
|
struct pw_properties *properties);
|
||||||
|
|
||||||
struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
|
struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
|
||||||
|
|
@ -56,7 +56,7 @@ static void *create_object(void *_data,
|
||||||
{
|
{
|
||||||
struct factory_data *data = _data;
|
struct factory_data *data = _data;
|
||||||
struct pw_context *context = pw_impl_module_get_context(data->module);
|
struct pw_context *context = pw_impl_module_get_context(data->module);
|
||||||
void *result;
|
struct pw_metadata *result;
|
||||||
struct pw_resource *metadata_resource = NULL;
|
struct pw_resource *metadata_resource = NULL;
|
||||||
struct pw_impl_client *client = resource ? pw_resource_get_client(resource) : NULL;
|
struct pw_impl_client *client = resource ? pw_resource_get_client(resource) : NULL;
|
||||||
int res;
|
int res;
|
||||||
|
|
@ -91,13 +91,16 @@ static void *create_object(void *_data,
|
||||||
goto error_node;
|
goto error_node;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = pw_context_create_metadata(context, NULL, properties, 0);
|
struct pw_impl_metadata *impl;
|
||||||
if (result == NULL) {
|
|
||||||
|
impl = pw_context_create_metadata(context, NULL, properties, 0);
|
||||||
|
if (impl == NULL) {
|
||||||
properties = NULL;
|
properties = NULL;
|
||||||
res = -errno;
|
res = -errno;
|
||||||
goto error_node;
|
goto error_node;
|
||||||
}
|
}
|
||||||
pw_impl_metadata_register(result, NULL);
|
pw_impl_metadata_register(impl, NULL);
|
||||||
|
result = pw_impl_metadata_get_implementation(impl);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ static const struct pw_resource_events global_resource_events = {
|
||||||
.destroy = global_resource_destroy,
|
.destroy = global_resource_destroy,
|
||||||
};
|
};
|
||||||
|
|
||||||
void *
|
struct pw_metadata *
|
||||||
pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
|
pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
|
|
@ -292,5 +292,5 @@ pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
|
||||||
&impl->resource_listener,
|
&impl->resource_listener,
|
||||||
&global_resource_events, impl);
|
&global_resource_events, impl);
|
||||||
|
|
||||||
return impl;
|
return impl->metadata;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue