mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
More type cleanups
SPA_ID_* -> SPA_TYPE_*. We use 'type' for all registered types. ID refers to either a registered type or an enum. Improve introspection of object ids. Make 0 an invalid enum and use it to look up the object id type. Move some type-info files together. Swap type and id of the object, we first specify the type and then the id because the meaning of the id depends on the object type.
This commit is contained in:
parent
281b65934e
commit
90c1a95eef
117 changed files with 1198 additions and 1272 deletions
|
|
@ -185,7 +185,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
|
|||
|
||||
factory = pw_factory_new(core,
|
||||
"audio-dsp",
|
||||
PW_ID_INTERFACE_Node,
|
||||
PW_TYPE_INTERFACE_Node,
|
||||
PW_VERSION_NODE,
|
||||
NULL,
|
||||
sizeof(*data));
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
|
|||
|
||||
factory = pw_factory_new(core,
|
||||
"client-node",
|
||||
PW_ID_INTERFACE_ClientNode,
|
||||
PW_TYPE_INTERFACE_ClientNode,
|
||||
PW_VERSION_CLIENT_NODE,
|
||||
NULL,
|
||||
sizeof(*data));
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
|
||||
param = this->params[(*index)++];
|
||||
|
||||
if (!spa_pod_is_object_id(param, id))
|
||||
if (!spa_pod_is_object_type(param, id))
|
||||
continue;
|
||||
|
||||
if (spa_pod_filter(builder, result, param, filter) == 0)
|
||||
|
|
@ -1155,10 +1155,10 @@ node_init(struct node *this,
|
|||
|
||||
for (i = 0; i < n_support; i++) {
|
||||
switch (support[i].type) {
|
||||
case SPA_ID_INTERFACE_Log:
|
||||
case SPA_TYPE_INTERFACE_Log:
|
||||
this->log = support[i].data;
|
||||
break;
|
||||
case SPA_ID_INTERFACE_DataLoop:
|
||||
case SPA_TYPE_INTERFACE_DataLoop:
|
||||
this->data_loop = support[i].data;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -813,7 +813,7 @@ node_init(struct node *this,
|
|||
uint32_t i;
|
||||
|
||||
for (i = 0; i < n_support; i++) {
|
||||
if (support[i].type == SPA_ID_INTERFACE_Log)
|
||||
if (support[i].type == SPA_TYPE_INTERFACE_Log)
|
||||
this->log = support[i].data;
|
||||
}
|
||||
this->node = impl_node;
|
||||
|
|
@ -905,7 +905,7 @@ static void client_node_initialized(void *data)
|
|||
media_type == SPA_MEDIA_TYPE_audio &&
|
||||
media_subtype == SPA_MEDIA_SUBTYPE_raw) {
|
||||
if ((impl->adapter = pw_load_spa_interface("audioconvert/libspa-audioconvert",
|
||||
"audioconvert", SPA_ID_INTERFACE_Node, NULL, 0, NULL)) == NULL)
|
||||
"audioconvert", SPA_TYPE_INTERFACE_Node, NULL, 0, NULL)) == NULL)
|
||||
return;
|
||||
|
||||
impl->adapter_mix = impl->adapter;
|
||||
|
|
|
|||
|
|
@ -938,7 +938,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_
|
|||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_client_node_marshal = {
|
||||
PW_ID_INTERFACE_ClientNode,
|
||||
PW_TYPE_INTERFACE_ClientNode,
|
||||
PW_VERSION_CLIENT_NODE,
|
||||
&pw_protocol_native_client_node_method_marshal,
|
||||
&pw_protocol_native_client_node_method_demarshal,
|
||||
|
|
|
|||
|
|
@ -221,16 +221,16 @@ set_global_permissions(void *data, struct pw_global *global)
|
|||
props = pw_global_get_properties(global);
|
||||
|
||||
switch (pw_global_get_type(global)) {
|
||||
case PW_ID_INTERFACE_Core:
|
||||
case PW_TYPE_INTERFACE_Core:
|
||||
allowed = true;
|
||||
break;
|
||||
case PW_ID_INTERFACE_Factory:
|
||||
case PW_TYPE_INTERFACE_Factory:
|
||||
if (props && (str = pw_properties_get(props, "factory.name"))) {
|
||||
if (strcmp(str, "client-node") == 0)
|
||||
allowed = true;
|
||||
}
|
||||
break;
|
||||
case PW_ID_INTERFACE_Node:
|
||||
case PW_TYPE_INTERFACE_Node:
|
||||
if (props && (str = pw_properties_get(props, "media.class"))) {
|
||||
if (strcmp(str, "Video/Source") == 0 && cinfo->camera_allowed)
|
||||
allowed = true;
|
||||
|
|
@ -393,7 +393,7 @@ core_global_added(void *data, struct pw_global *global)
|
|||
struct client_info *cinfo;
|
||||
int res;
|
||||
|
||||
if (pw_global_get_type(global) == PW_ID_INTERFACE_Client) {
|
||||
if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Client) {
|
||||
struct pw_client *client = pw_global_get_object(global);
|
||||
|
||||
res = check_sandboxed(client);
|
||||
|
|
@ -432,7 +432,7 @@ core_global_removed(void *data, struct pw_global *global)
|
|||
{
|
||||
struct impl *impl = data;
|
||||
|
||||
if (pw_global_get_type(global) == PW_ID_INTERFACE_Client) {
|
||||
if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Client) {
|
||||
struct pw_client *client = pw_global_get_object(global);
|
||||
struct client_info *cinfo;
|
||||
|
||||
|
|
@ -483,7 +483,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
|
|||
|
||||
support = pw_core_get_support(core, &n_support);
|
||||
|
||||
dbus = spa_support_find(support, n_support, SPA_ID_INTERFACE_DBus);
|
||||
dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
|
||||
if (dbus == NULL)
|
||||
return -ENOTSUP;
|
||||
|
||||
|
|
|
|||
|
|
@ -88,13 +88,13 @@ static void *create_object(void *_data,
|
|||
core = pw_client_get_core(client);
|
||||
|
||||
global = pw_core_find_global(core, output_node_id);
|
||||
if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Node)
|
||||
if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Node)
|
||||
goto no_output;
|
||||
|
||||
output_node = pw_global_get_object(global);
|
||||
|
||||
global = pw_core_find_global(core, input_node_id);
|
||||
if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Node)
|
||||
if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Node)
|
||||
goto no_input;
|
||||
|
||||
input_node = pw_global_get_object(global);
|
||||
|
|
@ -103,7 +103,7 @@ static void *create_object(void *_data,
|
|||
outport = pw_node_find_port(output_node, SPA_DIRECTION_OUTPUT, SPA_ID_INVALID);
|
||||
else {
|
||||
global = pw_core_find_global(core, output_port_id);
|
||||
if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Port)
|
||||
if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Port)
|
||||
goto no_output_port;
|
||||
|
||||
outport = pw_global_get_object(global);
|
||||
|
|
@ -115,7 +115,7 @@ static void *create_object(void *_data,
|
|||
inport = pw_node_find_port(input_node, SPA_DIRECTION_INPUT, SPA_ID_INVALID);
|
||||
else {
|
||||
global = pw_core_find_global(core, input_port_id);
|
||||
if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Port)
|
||||
if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Port)
|
||||
goto no_output_port;
|
||||
|
||||
inport = pw_global_get_object(global);
|
||||
|
|
@ -204,7 +204,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
|
|||
|
||||
factory = pw_factory_new(core,
|
||||
"link-factory",
|
||||
PW_ID_INTERFACE_Link,
|
||||
PW_TYPE_INTERFACE_Link,
|
||||
PW_VERSION_LINK,
|
||||
NULL,
|
||||
sizeof(*data));
|
||||
|
|
|
|||
|
|
@ -687,7 +687,7 @@ static int on_global(void *data, struct pw_global *global)
|
|||
bool need_dsp;
|
||||
uint64_t plugged;
|
||||
|
||||
if (pw_global_get_type(global) != PW_ID_INTERFACE_Node)
|
||||
if (pw_global_get_type(global) != PW_TYPE_INTERFACE_Node)
|
||||
return 0;
|
||||
|
||||
node = pw_global_get_object(global);
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ struct pw_node *pw_audio_dsp_new(struct pw_core *core,
|
|||
p->spa_handle, NULL,
|
||||
support, n_support);
|
||||
|
||||
spa_handle_get_interface(p->spa_handle, SPA_ID_INTERFACE_Node, &iface);
|
||||
spa_handle_get_interface(p->spa_handle, SPA_TYPE_INTERFACE_Node, &iface);
|
||||
|
||||
p->spa_node = iface;
|
||||
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
case 0:
|
||||
if (this->have_format) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
|
|
@ -334,7 +334,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels);
|
||||
} else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
|
|
@ -365,7 +365,7 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
|
|
@ -414,7 +414,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id,
|
||||
":", SPA_PARAM_LIST_id, "I", list[*index]);
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -436,7 +436,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, id,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 1,
|
||||
SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -453,7 +453,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_TYPE_OBJECT_ParamMeta, id,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header));
|
||||
break;
|
||||
|
|
@ -466,13 +466,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
SPA_TYPE_OBJECT_ParamIO, id,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
SPA_TYPE_OBJECT_ParamIO, id,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range));
|
||||
break;
|
||||
|
|
@ -924,7 +924,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface)
|
||||
static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface)
|
||||
{
|
||||
struct impl *this;
|
||||
|
||||
|
|
@ -933,7 +933,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id,
|
|||
|
||||
this = (struct impl *) handle;
|
||||
|
||||
if (interface_id == SPA_ID_INTERFACE_Node)
|
||||
if (type == SPA_TYPE_INTERFACE_Node)
|
||||
*interface = &this->node;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
@ -973,7 +973,7 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
this = (struct impl *) handle;
|
||||
|
||||
for (i = 0; i < n_support; i++) {
|
||||
if (support[i].type == SPA_ID_INTERFACE_Log)
|
||||
if (support[i].type == SPA_TYPE_INTERFACE_Log)
|
||||
this->log = support[i].data;
|
||||
}
|
||||
|
||||
|
|
@ -990,7 +990,7 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
}
|
||||
|
||||
static const struct spa_interface_info impl_interfaces[] = {
|
||||
{SPA_ID_INTERFACE_Node,},
|
||||
{SPA_TYPE_INTERFACE_Node,},
|
||||
};
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -1106,7 +1106,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_d
|
|||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
|
||||
PW_ID_INTERFACE_Core,
|
||||
PW_TYPE_INTERFACE_Core,
|
||||
PW_VERSION_CORE,
|
||||
&pw_protocol_native_core_method_marshal,
|
||||
pw_protocol_native_core_method_demarshal,
|
||||
|
|
@ -1137,7 +1137,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_registry_eve
|
|||
};
|
||||
|
||||
const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
|
||||
PW_ID_INTERFACE_Registry,
|
||||
PW_TYPE_INTERFACE_Registry,
|
||||
PW_VERSION_REGISTRY,
|
||||
&pw_protocol_native_registry_method_marshal,
|
||||
pw_protocol_native_registry_method_demarshal,
|
||||
|
|
@ -1157,7 +1157,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_module_event
|
|||
};
|
||||
|
||||
const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
|
||||
PW_ID_INTERFACE_Module,
|
||||
PW_TYPE_INTERFACE_Module,
|
||||
PW_VERSION_MODULE,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_module_event_marshal,
|
||||
|
|
@ -1175,7 +1175,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_factory_even
|
|||
};
|
||||
|
||||
const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
|
||||
PW_ID_INTERFACE_Factory,
|
||||
PW_TYPE_INTERFACE_Factory,
|
||||
PW_VERSION_FACTORY,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_factory_event_marshal,
|
||||
|
|
@ -1204,7 +1204,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_node_event_d
|
|||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
|
||||
PW_ID_INTERFACE_Node,
|
||||
PW_TYPE_INTERFACE_Node,
|
||||
PW_VERSION_NODE,
|
||||
&pw_protocol_native_node_method_marshal,
|
||||
pw_protocol_native_node_method_demarshal,
|
||||
|
|
@ -1236,7 +1236,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_port_event_d
|
|||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_port_marshal = {
|
||||
PW_ID_INTERFACE_Port,
|
||||
PW_TYPE_INTERFACE_Port,
|
||||
PW_VERSION_PORT,
|
||||
&pw_protocol_native_port_method_marshal,
|
||||
pw_protocol_native_port_method_demarshal,
|
||||
|
|
@ -1256,7 +1256,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_event
|
|||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
|
||||
PW_ID_INTERFACE_Client,
|
||||
PW_TYPE_INTERFACE_Client,
|
||||
PW_VERSION_CLIENT,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_client_event_marshal,
|
||||
|
|
@ -1274,7 +1274,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_link_event_d
|
|||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
|
||||
PW_ID_INTERFACE_Link,
|
||||
PW_TYPE_INTERFACE_Link,
|
||||
PW_VERSION_LINK,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_link_event_marshal,
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
|
|||
|
||||
support = pw_core_get_support(core, &n_support);
|
||||
|
||||
loop = spa_support_find(support, n_support, SPA_ID_INTERFACE_DataLoop);
|
||||
loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DataLoop);
|
||||
if (loop == NULL)
|
||||
return -ENOTSUP;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ core_global_added(void *data, struct pw_global *global)
|
|||
{
|
||||
struct impl *impl = data;
|
||||
|
||||
if (pw_global_get_type(global) == PW_ID_INTERFACE_Node) {
|
||||
if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Node) {
|
||||
struct pw_node *node = pw_global_get_object(global);
|
||||
struct node_info *info;
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ core_global_removed(void *data, struct pw_global *global)
|
|||
{
|
||||
struct impl *impl = data;
|
||||
|
||||
if (pw_global_get_type(global) == PW_ID_INTERFACE_Node) {
|
||||
if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Node) {
|
||||
struct pw_node *node = pw_global_get_object(global);
|
||||
struct node_info *info;
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
|
|||
|
||||
factory = pw_factory_new(core,
|
||||
"spa-node-factory",
|
||||
PW_ID_INTERFACE_Node,
|
||||
PW_TYPE_INTERFACE_Node,
|
||||
PW_VERSION_NODE,
|
||||
NULL,
|
||||
sizeof(*data));
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ static struct monitor_item *add_item(struct pw_spa_monitor *this,
|
|||
pw_log_error("can't make factory instance: %d", res);
|
||||
return NULL;
|
||||
}
|
||||
if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &node_iface)) < 0) {
|
||||
if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &node_iface)) < 0) {
|
||||
pw_log_error("can't get NODE interface: %d", res);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -315,7 +315,7 @@ struct pw_spa_monitor *pw_spa_monitor_load(struct pw_core *core,
|
|||
pw_log_error("can't make factory instance: %d", res);
|
||||
goto init_failed;
|
||||
}
|
||||
if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Monitor, &iface)) < 0) {
|
||||
if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Monitor, &iface)) < 0) {
|
||||
pw_log_error("can't get MONITOR interface: %d", res);
|
||||
goto interface_failed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,48 +170,48 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
|
||||
while ((key = pw_properties_iterate(pw_props, &state))) {
|
||||
struct spa_pod_prop *prop;
|
||||
uint32_t id = 0;
|
||||
uint32_t type = 0;
|
||||
|
||||
#if 0
|
||||
if (!spa_type_is_a(key, SPA_TYPE_PROPS_BASE))
|
||||
continue;
|
||||
|
||||
#endif
|
||||
id = spa_debug_type_find_id(spa_debug_types, key);
|
||||
if (id == SPA_ID_INVALID)
|
||||
type = spa_debug_type_find_type(spa_debug_types, key);
|
||||
if (type == SPA_TYPE_None)
|
||||
continue;
|
||||
|
||||
if ((prop = spa_pod_find_prop(props, id))) {
|
||||
if ((prop = spa_pod_find_prop(props, type))) {
|
||||
const char *value = pw_properties_get(pw_props, key);
|
||||
|
||||
pw_log_info("configure prop %s", key);
|
||||
|
||||
switch(prop->body.value.type) {
|
||||
case SPA_ID_Bool:
|
||||
case SPA_TYPE_Bool:
|
||||
SPA_POD_VALUE(struct spa_pod_bool, &prop->body.value) =
|
||||
pw_properties_parse_bool(value);
|
||||
break;
|
||||
case SPA_ID_Enum:
|
||||
case SPA_TYPE_Enum:
|
||||
SPA_POD_VALUE(struct spa_pod_enum, &prop->body.value) =
|
||||
spa_debug_type_find_id(spa_debug_types, value);
|
||||
spa_debug_type_find_type(spa_debug_types, value);
|
||||
break;
|
||||
case SPA_ID_Int:
|
||||
case SPA_TYPE_Int:
|
||||
SPA_POD_VALUE(struct spa_pod_int, &prop->body.value) =
|
||||
pw_properties_parse_int(value);
|
||||
break;
|
||||
case SPA_ID_Long:
|
||||
case SPA_TYPE_Long:
|
||||
SPA_POD_VALUE(struct spa_pod_long, &prop->body.value) =
|
||||
pw_properties_parse_int64(value);
|
||||
break;
|
||||
case SPA_ID_Float:
|
||||
case SPA_TYPE_Float:
|
||||
SPA_POD_VALUE(struct spa_pod_float, &prop->body.value) =
|
||||
pw_properties_parse_float(value);
|
||||
break;
|
||||
case SPA_ID_Double:
|
||||
case SPA_TYPE_Double:
|
||||
SPA_POD_VALUE(struct spa_pod_double, &prop->body.value) =
|
||||
pw_properties_parse_double(value);
|
||||
break;
|
||||
case SPA_ID_String:
|
||||
case SPA_TYPE_String:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -293,7 +293,7 @@ struct pw_node *pw_spa_node_load(struct pw_core *core,
|
|||
if (SPA_RESULT_IS_ASYNC(res))
|
||||
flags |= PW_SPA_NODE_FLAG_ASYNC;
|
||||
|
||||
if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) {
|
||||
if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) {
|
||||
pw_log_error("can't get node interface %d", res);
|
||||
goto interface_failed;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue