mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -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
|
|
@ -113,7 +113,7 @@ int main(int argc, char *argv[])
|
|||
data.remote = pw_stream_get_remote(data.stream);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*result = spa_pod_builder_object(builder,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_Format,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "I", d->format.format,
|
||||
|
|
@ -251,7 +251,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamList,
|
||||
SPA_TYPE_OBJECT_ParamList, id,
|
||||
":", SPA_PARAM_LIST_id, "I", list[*index]);
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -268,7 +268,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, id,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 2,
|
||||
SPA_POD_PROP_MIN_MAX(2, MAX_BUFFERS),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -281,13 +281,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
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;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_TYPE_OBJECT_ParamMeta, id,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_VideoDamage,
|
||||
":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_region));
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*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, "Ieu", SPA_AUDIO_FORMAT_S16,
|
||||
|
|
@ -216,7 +216,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", d->format.format,
|
||||
|
|
@ -249,7 +249,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamList,
|
||||
SPA_TYPE_OBJECT_ParamList, id,
|
||||
":", SPA_PARAM_LIST_id, "I", list[*index]);
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -266,7 +266,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, id,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 1,
|
||||
SPA_POD_PROP_MIN_MAX(1, 32),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -279,7 +279,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
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;
|
||||
|
|
@ -291,7 +291,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ static int make_node(struct data *data)
|
|||
|
||||
data->node = pw_factory_create_object(factory,
|
||||
NULL,
|
||||
PW_ID_INTERFACE_Node,
|
||||
PW_TYPE_INTERFACE_Node,
|
||||
PW_VERSION_NODE,
|
||||
props, SPA_ID_INVALID);
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
|
||||
SDL_GetRendererInfo(d->renderer, &info);
|
||||
|
||||
spa_pod_builder_push_object(builder, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_push_object(builder, SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
||||
spa_pod_builder_enum(builder, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_enum(builder, SPA_MEDIA_SUBTYPE_raw);
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*result = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, id,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 2,
|
||||
SPA_POD_PROP_MIN_MAX(1, 32),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -295,7 +295,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*result = spa_pod_builder_object(builder,
|
||||
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;
|
||||
|
|
@ -458,7 +458,7 @@ static void make_nodes(struct data *data)
|
|||
"spa.factory.name", "v4l2-source", NULL);
|
||||
data->v4l2 = pw_factory_create_object(factory,
|
||||
NULL,
|
||||
PW_ID_INTERFACE_Node,
|
||||
PW_TYPE_INTERFACE_Node,
|
||||
PW_VERSION_NODE,
|
||||
props,
|
||||
SPA_ID_INVALID);
|
||||
|
|
|
|||
|
|
@ -272,10 +272,10 @@ registry_global(void *data,uint32_t id, uint32_t parent_id,
|
|||
|
||||
clock_gettime(CLOCK_MONOTONIC, &impl->now);
|
||||
|
||||
if (type == PW_ID_INTERFACE_Node) {
|
||||
if (type == PW_TYPE_INTERFACE_Node) {
|
||||
handle_node(impl, id, parent_id, type, props);
|
||||
}
|
||||
else if (type == PW_ID_INTERFACE_Port) {
|
||||
else if (type == PW_TYPE_INTERFACE_Port) {
|
||||
handle_port(impl, id, parent_id, type, props);
|
||||
}
|
||||
schedule_rescan(impl);
|
||||
|
|
@ -313,7 +313,7 @@ static void rescan_session(struct impl *impl)
|
|||
|
||||
sess->dsp = pw_core_proxy_create_object(impl->core_proxy,
|
||||
"audio-dsp",
|
||||
PW_ID_INTERFACE_Node,
|
||||
PW_TYPE_INTERFACE_Node,
|
||||
PW_VERSION_NODE,
|
||||
&props->dict,
|
||||
0);
|
||||
|
|
@ -334,7 +334,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
case PW_REMOTE_STATE_CONNECTED:
|
||||
impl->core_proxy = pw_remote_get_core_proxy(impl->remote);
|
||||
impl->registry_proxy = pw_core_proxy_get_registry(impl->core_proxy,
|
||||
PW_ID_INTERFACE_Registry,
|
||||
PW_TYPE_INTERFACE_Registry,
|
||||
PW_VERSION_REGISTRY, 0);
|
||||
pw_registry_proxy_add_listener(impl->registry_proxy,
|
||||
&impl->registry_listener,
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ static struct spa_pod *sdl_build_formats(SDL_RendererInfo *info, struct spa_pod_
|
|||
{
|
||||
int i, c;
|
||||
|
||||
spa_pod_builder_push_object(b, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_push_object(b, SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
||||
spa_pod_builder_enum(b, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_enum(b, SPA_MEDIA_SUBTYPE_raw);
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
SDL_UnlockTexture(data->texture);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 8,
|
||||
SPA_POD_PROP_MIN_MAX(2, 16),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -178,7 +178,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object(&b,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
data->stride = SPA_ROUND_UP_N(data->format.size.width * BPP, 4);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 2,
|
||||
SPA_POD_PROP_MIN_MAX(1, 32),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -177,12 +177,12 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object(&b,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
params[2] = spa_pod_builder_object(&b,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_VideoDamage,
|
||||
":", SPA_PARAM_META_size, "iru", sizeof(struct spa_meta_region) * 16,
|
||||
SPA_POD_PROP_MIN_MAX(sizeof(struct spa_meta_region) * 1,
|
||||
|
|
@ -223,7 +223,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
NULL));
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "I", SPA_VIDEO_FORMAT_RGB,
|
||||
|
|
|
|||
|
|
@ -464,11 +464,11 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u
|
|||
GstPipeWireDeviceProvider *self = rd->self;
|
||||
struct node_data *nd;
|
||||
|
||||
if (type == PW_ID_INTERFACE_Node) {
|
||||
if (type == PW_TYPE_INTERFACE_Node) {
|
||||
struct pw_node_proxy *node;
|
||||
|
||||
node = pw_registry_proxy_bind(rd->registry,
|
||||
id, PW_ID_INTERFACE_Node,
|
||||
id, PW_TYPE_INTERFACE_Node,
|
||||
PW_VERSION_NODE, sizeof(*nd));
|
||||
if (node == NULL)
|
||||
goto no_mem;
|
||||
|
|
@ -484,7 +484,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u
|
|||
pw_proxy_add_listener((struct pw_proxy*)node, &nd->proxy_listener, &proxy_node_events, nd);
|
||||
add_pending(self, &nd->pending, NULL, NULL);
|
||||
}
|
||||
else if (type == PW_ID_INTERFACE_Port) {
|
||||
else if (type == PW_TYPE_INTERFACE_Port) {
|
||||
struct pw_port_proxy *port;
|
||||
struct port_data *pd;
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u
|
|||
return;
|
||||
|
||||
port = pw_registry_proxy_bind(rd->registry,
|
||||
id, PW_ID_INTERFACE_Port,
|
||||
id, PW_TYPE_INTERFACE_Port,
|
||||
PW_VERSION_PORT, sizeof(*pd));
|
||||
if (port == NULL)
|
||||
goto no_mem;
|
||||
|
|
@ -590,7 +590,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
|
||||
self->core_proxy = pw_remote_get_core_proxy(r);
|
||||
data->registry = pw_core_proxy_get_registry(self->core_proxy,
|
||||
PW_ID_INTERFACE_Registry, PW_VERSION_REGISTRY, 0);
|
||||
PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, 0);
|
||||
pw_registry_proxy_add_listener(data->registry, &data->registry_listener, ®istry_events, data);
|
||||
pw_core_proxy_sync(self->core_proxy, ++self->seq);
|
||||
|
||||
|
|
@ -677,7 +677,7 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider)
|
|||
|
||||
self->core_proxy = pw_remote_get_core_proxy(self->remote);
|
||||
self->registry = pw_core_proxy_get_registry(self->core_proxy,
|
||||
PW_ID_INTERFACE_Registry, PW_VERSION_REGISTRY, 0);
|
||||
PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, 0);
|
||||
|
||||
data->registry = self->registry;
|
||||
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ handle_video_fields (ConvertData *d)
|
|||
|
||||
idx = gst_video_format_from_string (v);
|
||||
if (idx < SPA_N_ELEMENTS (video_format_map))
|
||||
spa_pod_builder_id (&d->b, video_format_map[idx]);
|
||||
spa_pod_builder_enum (&d->b, video_format_map[idx]);
|
||||
}
|
||||
prop = spa_pod_builder_pop(&d->b);
|
||||
if (i > 1)
|
||||
|
|
@ -447,7 +447,7 @@ handle_audio_fields (ConvertData *d)
|
|||
|
||||
idx = gst_audio_format_from_string (v);
|
||||
if (idx < SPA_N_ELEMENTS (audio_format_map))
|
||||
spa_pod_builder_id (&d->b, audio_format_map[idx]);
|
||||
spa_pod_builder_enum (&d->b, audio_format_map[idx]);
|
||||
}
|
||||
prop = spa_pod_builder_pop(&d->b);
|
||||
if (i > 1)
|
||||
|
|
@ -534,9 +534,9 @@ convert_1 (ConvertData *d)
|
|||
|
||||
d->b.write = write_pod;
|
||||
|
||||
spa_pod_builder_push_object (&d->b, d->id, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_id(&d->b, d->type->media_type);
|
||||
spa_pod_builder_id(&d->b, d->type->media_subtype);
|
||||
spa_pod_builder_push_object (&d->b, SPA_TYPE_OBJECT_Format, d->id);
|
||||
spa_pod_builder_enum(&d->b, d->type->media_type);
|
||||
spa_pod_builder_enum(&d->b, d->type->media_subtype);
|
||||
|
||||
if (d->type->media_type == SPA_MEDIA_TYPE_video)
|
||||
handle_video_fields (d);
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers);
|
||||
|
||||
spa_pod_builder_init (&b, buffer, sizeof (buffer));
|
||||
spa_pod_builder_push_object (&b, SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers);
|
||||
spa_pod_builder_push_object (&b, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers);
|
||||
if (size == 0)
|
||||
spa_pod_builder_add (&b,
|
||||
":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX), NULL);
|
||||
|
|
@ -248,7 +248,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
port_params[0] = spa_pod_builder_pop (&b);
|
||||
|
||||
port_params[1] = spa_pod_builder_object (&b,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@ on_format_changed (void *data,
|
|||
|
||||
spa_pod_builder_init (&b, buffer, sizeof (buffer));
|
||||
params[0] = spa_pod_builder_object (&b,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 16, SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "iru", 0, SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
|
|
@ -710,7 +710,7 @@ on_format_changed (void *data,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object (&b,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ int pw_client_register(struct pw_client *client,
|
|||
client->registered = true;
|
||||
|
||||
client->global = pw_global_new(core,
|
||||
PW_ID_INTERFACE_Client, PW_VERSION_CLIENT,
|
||||
PW_TYPE_INTERFACE_Client, PW_VERSION_CLIENT,
|
||||
properties,
|
||||
client);
|
||||
if (client->global == NULL)
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ static void core_get_registry(void *object, uint32_t version, uint32_t new_id)
|
|||
registry_resource = pw_resource_new(client,
|
||||
new_id,
|
||||
PW_PERM_RWX,
|
||||
PW_ID_INTERFACE_Registry,
|
||||
PW_TYPE_INTERFACE_Registry,
|
||||
version,
|
||||
sizeof(*data));
|
||||
if (registry_resource == NULL)
|
||||
|
|
@ -377,11 +377,11 @@ struct pw_core *pw_core_new(struct pw_loop *main_loop, struct pw_properties *pro
|
|||
|
||||
pw_map_init(&this->globals, 128, 32);
|
||||
|
||||
this->support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, this->data_loop->loop);
|
||||
this->support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, this->main_loop->loop);
|
||||
this->support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_LoopUtils, this->main_loop->utils);
|
||||
this->support[3] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, pw_log_get());
|
||||
this->support[4] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DBus, pw_get_spa_dbus(this->main_loop));
|
||||
this->support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, this->data_loop->loop);
|
||||
this->support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, this->main_loop->loop);
|
||||
this->support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, this->main_loop->utils);
|
||||
this->support[3] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, pw_log_get());
|
||||
this->support[4] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DBus, pw_get_spa_dbus(this->main_loop));
|
||||
this->n_support = 5;
|
||||
|
||||
pw_data_loop_start(this->data_loop_impl);
|
||||
|
|
@ -419,7 +419,7 @@ struct pw_core *pw_core_new(struct pw_loop *main_loop, struct pw_properties *pro
|
|||
this->sc_pagesize = sysconf(_SC_PAGESIZE);
|
||||
|
||||
this->global = pw_global_new(this,
|
||||
PW_ID_INTERFACE_Core,
|
||||
PW_TYPE_INTERFACE_Core,
|
||||
PW_VERSION_CORE,
|
||||
pw_properties_new(
|
||||
PW_CORE_PROP_USER_NAME, this->info.user_name,
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ int pw_factory_register(struct pw_factory *factory,
|
|||
factory->registered = true;
|
||||
|
||||
factory->global = pw_global_new(core,
|
||||
PW_ID_INTERFACE_Factory, PW_VERSION_FACTORY,
|
||||
PW_TYPE_INTERFACE_Factory, PW_VERSION_FACTORY,
|
||||
properties,
|
||||
factory);
|
||||
if (factory->global == NULL)
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ static int alloc_buffers(struct pw_link *this,
|
|||
|
||||
/* collect metadata */
|
||||
for (i = 0; i < n_params; i++) {
|
||||
if (spa_pod_is_object_type (params[i], SPA_ID_OBJECT_ParamMeta)) {
|
||||
if (spa_pod_is_object_type (params[i], SPA_TYPE_OBJECT_ParamMeta)) {
|
||||
uint32_t type, size;
|
||||
|
||||
if (spa_pod_object_parse(params[i],
|
||||
|
|
@ -657,7 +657,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
|
||||
max_buffers = MAX_BUFFERS;
|
||||
minsize = stride = 0;
|
||||
param = find_param(params, n_params, SPA_ID_OBJECT_ParamBuffers);
|
||||
param = find_param(params, n_params, SPA_TYPE_OBJECT_ParamBuffers);
|
||||
if (param) {
|
||||
uint32_t qmax_buffers = max_buffers,
|
||||
qminsize = minsize, qstride = stride;
|
||||
|
|
@ -1328,7 +1328,7 @@ int pw_link_register(struct pw_link *link,
|
|||
link->registered = true;
|
||||
|
||||
link->global = pw_global_new(core,
|
||||
PW_ID_INTERFACE_Link, PW_VERSION_LINK,
|
||||
PW_TYPE_INTERFACE_Link, PW_VERSION_LINK,
|
||||
properties,
|
||||
link);
|
||||
if (link->global == NULL)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include <spa/support/loop.h>
|
||||
#include <spa/support/loop-types.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <pipewire/loop.h>
|
||||
|
|
@ -77,25 +76,25 @@ struct pw_loop *pw_loop_new(struct pw_properties *properties)
|
|||
}
|
||||
|
||||
if ((res = spa_handle_get_interface(impl->handle,
|
||||
SPA_ID_INTERFACE_Loop,
|
||||
SPA_TYPE_INTERFACE_Loop,
|
||||
&iface)) < 0) {
|
||||
fprintf(stderr, "can't get %s interface %d\n", SPA_TYPE__Loop, res);
|
||||
fprintf(stderr, "can't get Loop interface %d\n", res);
|
||||
goto failed;
|
||||
}
|
||||
this->loop = iface;
|
||||
|
||||
if ((res = spa_handle_get_interface(impl->handle,
|
||||
SPA_ID_INTERFACE_LoopControl,
|
||||
SPA_TYPE_INTERFACE_LoopControl,
|
||||
&iface)) < 0) {
|
||||
fprintf(stderr, "can't get %s interface %d\n", SPA_TYPE__LoopControl, res);
|
||||
fprintf(stderr, "can't get LoopControl interface %d\n", res);
|
||||
goto failed;
|
||||
}
|
||||
this->control = iface;
|
||||
|
||||
if ((res = spa_handle_get_interface(impl->handle,
|
||||
SPA_ID_INTERFACE_LoopUtils,
|
||||
SPA_TYPE_INTERFACE_LoopUtils,
|
||||
&iface)) < 0) {
|
||||
fprintf(stderr, "can't get %s interface %d\n", SPA_TYPE__LoopUtils, res);
|
||||
fprintf(stderr, "can't get LoopUtils interface %d\n", res);
|
||||
goto failed;
|
||||
}
|
||||
this->utils = iface;
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ pw_module_load(struct pw_core *core,
|
|||
spa_list_append(&core->module_list, &this->link);
|
||||
|
||||
this->global = pw_global_new(core,
|
||||
PW_ID_INTERFACE_Module, PW_VERSION_MODULE,
|
||||
PW_TYPE_INTERFACE_Module, PW_VERSION_MODULE,
|
||||
pw_properties_new(
|
||||
PW_MODULE_PROP_NAME, name,
|
||||
NULL),
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ int pw_node_register(struct pw_node *this,
|
|||
this->registered = true;
|
||||
|
||||
this->global = pw_global_new(core,
|
||||
PW_ID_INTERFACE_Node, PW_VERSION_NODE,
|
||||
PW_TYPE_INTERFACE_Node, PW_VERSION_NODE,
|
||||
properties,
|
||||
this);
|
||||
if (this->global == NULL)
|
||||
|
|
|
|||
|
|
@ -379,9 +379,9 @@ int pw_unload_spa_interface(void *iface)
|
|||
|
||||
void *pw_get_spa_dbus(struct pw_loop *loop)
|
||||
{
|
||||
struct spa_support support = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_LoopUtils, loop->utils);
|
||||
struct spa_support support = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, loop->utils);
|
||||
|
||||
return pw_load_spa_interface("support/libspa-dbus", "dbus", SPA_ID_INTERFACE_DBus,
|
||||
return pw_load_spa_interface("support/libspa-dbus", "dbus", SPA_TYPE_INTERFACE_DBus,
|
||||
NULL, 1, &support);
|
||||
}
|
||||
|
||||
|
|
@ -430,11 +430,11 @@ void pw_init(int *argc, char **argv[])
|
|||
items[0] = SPA_DICT_ITEM_INIT("log.colors", "1");
|
||||
info = SPA_DICT_INIT(items, 1);
|
||||
|
||||
iface = load_interface(plugin, "logger", SPA_ID_INTERFACE_Log, &info,
|
||||
iface = load_interface(plugin, "logger", SPA_TYPE_INTERFACE_Log, &info,
|
||||
support->n_support, support->support);
|
||||
if (iface != NULL) {
|
||||
support->support[support->n_support++] =
|
||||
SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, iface->iface);
|
||||
SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, iface->iface);
|
||||
pw_log_set(iface->iface);
|
||||
}
|
||||
pw_log_info("version %s", pw_get_library_version());
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ int pw_port_register(struct pw_port *port,
|
|||
struct pw_core *core = node->core;
|
||||
|
||||
port->global = pw_global_new(core,
|
||||
PW_ID_INTERFACE_Port, PW_VERSION_PORT,
|
||||
PW_TYPE_INTERFACE_Port, PW_VERSION_PORT,
|
||||
properties,
|
||||
port);
|
||||
if (port->global == NULL)
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ static int do_connect(struct pw_remote *remote)
|
|||
dummy.remote = remote;
|
||||
|
||||
remote->core_proxy = (struct pw_core_proxy*)pw_proxy_new(&dummy,
|
||||
PW_ID_INTERFACE_Core, PW_VERSION_CORE);
|
||||
PW_TYPE_INTERFACE_Core, PW_VERSION_CORE);
|
||||
if (remote->core_proxy == NULL)
|
||||
goto no_proxy;
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@ struct pw_proxy *pw_remote_export(struct pw_remote *remote,
|
|||
|
||||
proxy = pw_core_proxy_create_object(remote->core_proxy,
|
||||
"client-node",
|
||||
PW_ID_INTERFACE_ClientNode,
|
||||
PW_TYPE_INTERFACE_ClientNode,
|
||||
PW_VERSION_CLIENT_NODE,
|
||||
&node->properties->dict,
|
||||
sizeof(struct node_data));
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
|
||||
if (last_id == SPA_ID_INVALID){
|
||||
*result = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamList,
|
||||
SPA_TYPE_OBJECT_ParamList, id,
|
||||
":", SPA_PARAM_LIST_id, "I", new_id);
|
||||
last_id = new_id;
|
||||
}
|
||||
|
|
@ -433,7 +433,7 @@ static int port_set_format(struct spa_node *node,
|
|||
spa_debug_format(2, NULL, format);
|
||||
|
||||
clear_params(stream, PARAM_TYPE_FORMAT);
|
||||
if (spa_pod_is_object_type(format, SPA_ID_OBJECT_Format)) {
|
||||
if (spa_pod_is_object_type(format, SPA_TYPE_OBJECT_Format)) {
|
||||
p = add_param(stream, PARAM_TYPE_FORMAT, format);
|
||||
if (p == NULL)
|
||||
goto no_mem;
|
||||
|
|
|
|||
|
|
@ -33,22 +33,22 @@ extern "C" {
|
|||
#include <pipewire/map.h>
|
||||
|
||||
enum {
|
||||
PW_ID_FIRST = SPA_ID_VENDOR_PipeWire,
|
||||
PW_TYPE_FIRST = SPA_TYPE_VENDOR_PipeWire,
|
||||
|
||||
PW_ID_INTERFACE_Core,
|
||||
PW_ID_INTERFACE_Registry,
|
||||
PW_ID_INTERFACE_Node,
|
||||
PW_ID_INTERFACE_Port,
|
||||
PW_ID_INTERFACE_Factory,
|
||||
PW_ID_INTERFACE_Link,
|
||||
PW_ID_INTERFACE_Client,
|
||||
PW_ID_INTERFACE_Module,
|
||||
PW_ID_INTERFACE_ClientNode,
|
||||
PW_TYPE_INTERFACE_Core,
|
||||
PW_TYPE_INTERFACE_Registry,
|
||||
PW_TYPE_INTERFACE_Node,
|
||||
PW_TYPE_INTERFACE_Port,
|
||||
PW_TYPE_INTERFACE_Factory,
|
||||
PW_TYPE_INTERFACE_Link,
|
||||
PW_TYPE_INTERFACE_Client,
|
||||
PW_TYPE_INTERFACE_Module,
|
||||
PW_TYPE_INTERFACE_ClientNode,
|
||||
|
||||
};
|
||||
|
||||
enum {
|
||||
PW_IO_BASE = PW_ID_FIRST,
|
||||
PW_IO_BASE = PW_TYPE_FIRST,
|
||||
PW_IO_ClientNodePosition,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old,
|
|||
fprintf(stdout, "remote %d state: \"%s\"\n", rd->id, pw_remote_state_as_string(state));
|
||||
rd->core_proxy = pw_remote_get_core_proxy(rd->remote);
|
||||
rd->registry_proxy = pw_core_proxy_get_registry(rd->core_proxy,
|
||||
PW_ID_INTERFACE_Registry,
|
||||
PW_TYPE_INTERFACE_Registry,
|
||||
PW_VERSION_REGISTRY, 0);
|
||||
pw_registry_proxy_add_listener(rd->registry_proxy,
|
||||
&rd->registry_listener,
|
||||
|
|
@ -665,7 +665,7 @@ static void node_event_param(void *object, uint32_t id, uint32_t index, uint32_t
|
|||
fprintf(stdout, "remote %d node %d param %d index %d\n",
|
||||
rd->id, data->global->id, id, index);
|
||||
|
||||
if (spa_pod_is_object_type(param, SPA_ID_OBJECT_Format))
|
||||
if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(2, NULL, param);
|
||||
else
|
||||
spa_debug_pod(2, spa_debug_types, param);
|
||||
|
|
@ -702,7 +702,7 @@ static void port_event_param(void *object, uint32_t id, uint32_t index, uint32_t
|
|||
fprintf(stdout, "remote %d port %d param %d index %d\n",
|
||||
rd->id, data->global->id, id, index);
|
||||
|
||||
if (spa_pod_is_object_type(param, SPA_ID_OBJECT_Format))
|
||||
if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(2, NULL, param);
|
||||
else
|
||||
spa_debug_pod(2, spa_debug_types, param);
|
||||
|
|
@ -812,43 +812,43 @@ static bool bind_global(struct remote_data *rd, struct global *global, char **er
|
|||
struct pw_proxy *proxy;
|
||||
|
||||
switch (global->type) {
|
||||
case PW_ID_INTERFACE_Core:
|
||||
case PW_TYPE_INTERFACE_Core:
|
||||
events = &core_events;
|
||||
client_version = PW_VERSION_CORE;
|
||||
destroy = (pw_destroy_t) pw_core_info_free;
|
||||
info_func = info_core;
|
||||
break;
|
||||
case PW_ID_INTERFACE_Module:
|
||||
case PW_TYPE_INTERFACE_Module:
|
||||
events = &module_events;
|
||||
client_version = PW_VERSION_MODULE;
|
||||
destroy = (pw_destroy_t) pw_module_info_free;
|
||||
info_func = info_module;
|
||||
break;
|
||||
case PW_ID_INTERFACE_Node:
|
||||
case PW_TYPE_INTERFACE_Node:
|
||||
events = &node_events;
|
||||
client_version = PW_VERSION_NODE;
|
||||
destroy = (pw_destroy_t) pw_node_info_free;
|
||||
info_func = info_node;
|
||||
break;
|
||||
case PW_ID_INTERFACE_Port:
|
||||
case PW_TYPE_INTERFACE_Port:
|
||||
events = &port_events;
|
||||
client_version = PW_VERSION_PORT;
|
||||
destroy = (pw_destroy_t) pw_port_info_free;
|
||||
info_func = info_port;
|
||||
break;
|
||||
case PW_ID_INTERFACE_Factory:
|
||||
case PW_TYPE_INTERFACE_Factory:
|
||||
events = &factory_events;
|
||||
client_version = PW_VERSION_FACTORY;
|
||||
destroy = (pw_destroy_t) pw_factory_info_free;
|
||||
info_func = info_factory;
|
||||
break;
|
||||
case PW_ID_INTERFACE_Client:
|
||||
case PW_TYPE_INTERFACE_Client:
|
||||
events = &client_events;
|
||||
client_version = PW_VERSION_CLIENT;
|
||||
destroy = (pw_destroy_t) pw_client_info_free;
|
||||
info_func = info_client;
|
||||
break;
|
||||
case PW_ID_INTERFACE_Link:
|
||||
case PW_TYPE_INTERFACE_Link:
|
||||
events = &link_events;
|
||||
client_version = PW_VERSION_LINK;
|
||||
destroy = (pw_destroy_t) pw_link_info_free;
|
||||
|
|
@ -957,7 +957,7 @@ static bool do_create_node(struct data *data, const char *cmd, char *args, char
|
|||
props = parse_props(a[1]);
|
||||
|
||||
proxy = pw_core_proxy_create_object(rd->core_proxy, a[0],
|
||||
PW_ID_INTERFACE_Node, PW_VERSION_NODE,
|
||||
PW_TYPE_INTERFACE_Node, PW_VERSION_NODE,
|
||||
props ? &props->dict : NULL,
|
||||
sizeof(struct proxy_data));
|
||||
|
||||
|
|
@ -1025,7 +1025,7 @@ static bool do_create_link(struct data *data, const char *cmd, char *args, char
|
|||
|
||||
proxy = (struct pw_proxy*)pw_core_proxy_create_object(rd->core_proxy,
|
||||
"link-factory",
|
||||
PW_ID_INTERFACE_Link,
|
||||
PW_TYPE_INTERFACE_Link,
|
||||
PW_VERSION_LINK,
|
||||
props ? &props->dict : NULL,
|
||||
sizeof(struct proxy_data));
|
||||
|
|
@ -1070,7 +1070,7 @@ static bool do_export_node(struct data *data, const char *cmd, char *args, char
|
|||
asprintf(error, "object %d does not exist", atoi(a[0]));
|
||||
return false;
|
||||
}
|
||||
if (pw_global_get_type(global) != PW_ID_INTERFACE_Node) {
|
||||
if (pw_global_get_type(global) != PW_TYPE_INTERFACE_Node) {
|
||||
asprintf(error, "object %d is not a node", atoi(a[0]));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1111,7 +1111,7 @@ static bool do_node_params(struct data *data, const char *cmd, char *args, char
|
|||
asprintf(error, "%s: unknown global %d", cmd, id);
|
||||
return false;
|
||||
}
|
||||
if (global->type != PW_ID_INTERFACE_Node) {
|
||||
if (global->type != PW_TYPE_INTERFACE_Node) {
|
||||
asprintf(error, "object %d is not a node", atoi(a[0]));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1145,7 +1145,7 @@ static bool do_port_params(struct data *data, const char *cmd, char *args, char
|
|||
asprintf(error, "%s: unknown global %d", cmd, id);
|
||||
return false;
|
||||
}
|
||||
if (global->type != PW_ID_INTERFACE_Port) {
|
||||
if (global->type != PW_TYPE_INTERFACE_Port) {
|
||||
asprintf(error, "object %d is not a port", atoi(a[0]));
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ static void print_node(struct proxy_data *data)
|
|||
printf("%c\tname: \"%s\"\n", MARK_CHANGE(0), info->name);
|
||||
printf("%c\tparams:\n", MARK_CHANGE(5));
|
||||
for (i = 0; i < data->n_params; i++) {
|
||||
if (spa_pod_is_object_type(data->params[i], SPA_ID_OBJECT_Format))
|
||||
if (spa_pod_is_object_type(data->params[i], SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(2, NULL, data->params[i]);
|
||||
else
|
||||
spa_debug_pod(2, spa_debug_types, data->params[i]);
|
||||
|
|
@ -292,7 +292,7 @@ static void print_port(struct proxy_data *data)
|
|||
printf("%c\tname: \"%s\"\n", MARK_CHANGE(0), info->name);
|
||||
printf("%c\tparams:\n", MARK_CHANGE(2));
|
||||
for (i = 0; i < data->n_params; i++) {
|
||||
if (spa_pod_is_object_type(data->params[i], SPA_ID_OBJECT_Format))
|
||||
if (spa_pod_is_object_type(data->params[i], SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(2, NULL, data->params[i]);
|
||||
else
|
||||
spa_debug_pod(2, spa_debug_types, data->params[i]);
|
||||
|
|
@ -473,34 +473,34 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id,
|
|||
pw_destroy_t destroy;
|
||||
print_func_t print_func = NULL;
|
||||
|
||||
if (type == PW_ID_INTERFACE_Node) {
|
||||
if (type == PW_TYPE_INTERFACE_Node) {
|
||||
events = &node_events;
|
||||
client_version = PW_VERSION_NODE;
|
||||
destroy = (pw_destroy_t) pw_node_info_free;
|
||||
print_func = print_node;
|
||||
}
|
||||
else if (type == PW_ID_INTERFACE_Port) {
|
||||
else if (type == PW_TYPE_INTERFACE_Port) {
|
||||
events = &port_events;
|
||||
client_version = PW_VERSION_PORT;
|
||||
destroy = (pw_destroy_t) pw_port_info_free;
|
||||
print_func = print_port;
|
||||
}
|
||||
else if (type == PW_ID_INTERFACE_Module) {
|
||||
else if (type == PW_TYPE_INTERFACE_Module) {
|
||||
events = &module_events;
|
||||
client_version = PW_VERSION_MODULE;
|
||||
destroy = (pw_destroy_t) pw_module_info_free;
|
||||
}
|
||||
else if (type == PW_ID_INTERFACE_Factory) {
|
||||
else if (type == PW_TYPE_INTERFACE_Factory) {
|
||||
events = &factory_events;
|
||||
client_version = PW_VERSION_FACTORY;
|
||||
destroy = (pw_destroy_t) pw_factory_info_free;
|
||||
}
|
||||
else if (type == PW_ID_INTERFACE_Client) {
|
||||
else if (type == PW_TYPE_INTERFACE_Client) {
|
||||
events = &client_events;
|
||||
client_version = PW_VERSION_CLIENT;
|
||||
destroy = (pw_destroy_t) pw_client_info_free;
|
||||
}
|
||||
else if (type == PW_ID_INTERFACE_Link) {
|
||||
else if (type == PW_TYPE_INTERFACE_Link) {
|
||||
events = &link_events;
|
||||
client_version = PW_VERSION_LINK;
|
||||
destroy = (pw_destroy_t) pw_link_info_free;
|
||||
|
|
@ -572,7 +572,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old,
|
|||
|
||||
data->core_proxy = pw_remote_get_core_proxy(data->remote);
|
||||
data->registry_proxy = pw_core_proxy_get_registry(data->core_proxy,
|
||||
PW_ID_INTERFACE_Registry,
|
||||
PW_TYPE_INTERFACE_Registry,
|
||||
PW_VERSION_REGISTRY, 0);
|
||||
pw_registry_proxy_add_listener(data->registry_proxy,
|
||||
&data->registry_listener,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue