mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
More type fixes
Param ids and IO ids are now simple enums. Move some type info in one place, delete some type-info files Fix type debug Make audio layout an enum Mark more enums as enums in types so they show us with their names in the debug.
This commit is contained in:
parent
93a8747a44
commit
d26aecfef2
82 changed files with 869 additions and 1118 deletions
|
|
@ -113,11 +113,11 @@ int main(int argc, char *argv[])
|
|||
data.remote = pw_stream_get_remote(data.stream);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", DEFAULT_CHANNELS,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", DEFAULT_RATE);
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ static int impl_port_set_io(struct spa_node *node,
|
|||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
d->io = data;
|
||||
#if 0
|
||||
else if (id == d->type.io_prop_param) {
|
||||
|
|
@ -218,7 +218,7 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*result = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "I", d->format.format,
|
||||
|
|
@ -241,13 +241,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
struct spa_pod *param;
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -257,13 +257,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
return port_get_format(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -360,7 +360,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
d->io = data;
|
||||
#if 0
|
||||
else if (id == type.io_prop_volume) {
|
||||
|
|
@ -181,13 +181,13 @@ static int port_enum_formats(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_F32),
|
||||
":", SPA_FORMAT_AUDIO_layout, "ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "Ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
|
||||
":", SPA_FORMAT_AUDIO_channels, "iru", 2,
|
||||
|
|
@ -216,11 +216,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", d->format.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", d->format.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", d->format.layout,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", d->format.channels,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", d->format.rate);
|
||||
|
||||
|
|
@ -239,13 +239,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
struct spa_pod *param;
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -255,13 +255,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
return port_get_format(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", 0,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -287,12 +287,12 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -356,7 +356,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
d->io = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
@ -225,9 +225,9 @@ static int port_enum_formats(struct spa_node *node,
|
|||
|
||||
SDL_GetRendererInfo(d->renderer, &info);
|
||||
|
||||
spa_pod_builder_push_object(builder, SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_id(builder, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_id(builder, SPA_MEDIA_SUBTYPE_raw);
|
||||
spa_pod_builder_push_object(builder, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_enum(builder, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_enum(builder, SPA_MEDIA_SUBTYPE_raw);
|
||||
|
||||
spa_pod_builder_push_prop(builder, SPA_FORMAT_VIDEO_format,
|
||||
SPA_POD_PROP_FLAG_UNSET |
|
||||
|
|
@ -237,13 +237,13 @@ static int port_enum_formats(struct spa_node *node,
|
|||
if (id == 0)
|
||||
continue;
|
||||
if (c++ == 0)
|
||||
spa_pod_builder_id(builder, id);
|
||||
spa_pod_builder_id(builder, id);
|
||||
spa_pod_builder_enum(builder, id);
|
||||
spa_pod_builder_enum(builder, id);
|
||||
}
|
||||
for (i = 0; i < SPA_N_ELEMENTS(video_formats); i++) {
|
||||
uint32_t id = video_formats[i].id;
|
||||
if (id != SPA_VIDEO_FORMAT_UNKNOWN)
|
||||
spa_pod_builder_id(builder, id);
|
||||
spa_pod_builder_enum(builder, id);
|
||||
}
|
||||
spa_pod_builder_pop(builder);
|
||||
|
||||
|
|
@ -273,10 +273,10 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -97,9 +97,9 @@ static struct spa_pod *sdl_build_formats(SDL_RendererInfo *info, struct spa_pod_
|
|||
{
|
||||
int i, c;
|
||||
|
||||
spa_pod_builder_push_object(b, SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_id(b, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_id(b, SPA_MEDIA_SUBTYPE_raw);
|
||||
spa_pod_builder_push_object(b, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_enum(b, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_enum(b, SPA_MEDIA_SUBTYPE_raw);
|
||||
|
||||
spa_pod_builder_push_prop(b, SPA_FORMAT_VIDEO_format,
|
||||
SPA_POD_PROP_FLAG_UNSET |
|
||||
|
|
@ -109,13 +109,13 @@ static struct spa_pod *sdl_build_formats(SDL_RendererInfo *info, struct spa_pod_
|
|||
if (id == 0)
|
||||
continue;
|
||||
if (c++ == 0)
|
||||
spa_pod_builder_id(b, id);
|
||||
spa_pod_builder_id(b, id);
|
||||
spa_pod_builder_enum(b, id);
|
||||
spa_pod_builder_enum(b, id);
|
||||
}
|
||||
for (i = 0; i < SPA_N_ELEMENTS(sdl_video_formats); i++) {
|
||||
uint32_t id = sdl_video_formats[i].id;
|
||||
if (id != SPA_VIDEO_FORMAT_UNKNOWN)
|
||||
spa_pod_builder_id(b, id);
|
||||
spa_pod_builder_enum(b, id);
|
||||
}
|
||||
spa_pod_builder_pop(b);
|
||||
spa_pod_builder_add(b,
|
||||
|
|
|
|||
|
|
@ -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_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
":", 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_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", 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_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
":", 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_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", 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_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", 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_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "I", SPA_VIDEO_FORMAT_RGB,
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ static void port_event_info(void *data, struct pw_port_info *info)
|
|||
|
||||
if (info->change_mask & PW_PORT_CHANGE_MASK_ENUM_PARAMS) {
|
||||
pw_port_proxy_enum_params((struct pw_port_proxy*)port_data->proxy,
|
||||
SPA_ID_PARAM_EnumFormat, 0, 0, NULL);
|
||||
SPA_PARAM_EnumFormat, 0, 0, NULL);
|
||||
add_pending(self, &port_data->pending_param, do_add_node, port_data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ handle_audio_fields (ConvertData *d)
|
|||
SPA_FORMAT_AUDIO_layout,
|
||||
get_range_type (value));
|
||||
|
||||
spa_pod_builder_int (&d->b, layout);
|
||||
spa_pod_builder_enum (&d->b, layout);
|
||||
}
|
||||
prop = spa_pod_builder_pop(&d->b);
|
||||
if (i > 1)
|
||||
|
|
|
|||
|
|
@ -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_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers);
|
||||
spa_pod_builder_push_object (&b, SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers);
|
||||
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_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
|
|
@ -510,7 +510,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
|
||||
pwsink = GST_PIPEWIRE_SINK (bsink);
|
||||
|
||||
possible = gst_caps_to_format_all (caps, SPA_ID_PARAM_EnumFormat);
|
||||
possible = gst_caps_to_format_all (caps, SPA_PARAM_EnumFormat);
|
||||
|
||||
pw_thread_loop_lock (pwsink->main_loop);
|
||||
state = pw_stream_get_state (pwsink->stream, &error);
|
||||
|
|
|
|||
|
|
@ -587,7 +587,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
GST_DEBUG_OBJECT (basesrc, "have common caps: %" GST_PTR_FORMAT, caps);
|
||||
|
||||
/* open a connection with these caps */
|
||||
possible = gst_caps_to_format_all (caps, SPA_ID_PARAM_EnumFormat);
|
||||
possible = gst_caps_to_format_all (caps, SPA_PARAM_EnumFormat);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
/* first disconnect */
|
||||
|
|
@ -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_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
":", 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_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ do_update_port(struct node *this,
|
|||
for (i = 0; i < port->n_params; i++) {
|
||||
port->params[i] = pw_spa_pod_copy(params[i]);
|
||||
|
||||
if (spa_pod_is_object_id(port->params[i], SPA_ID_PARAM_Format))
|
||||
if (spa_pod_is_object_id(port->params[i], SPA_PARAM_Format))
|
||||
port->have_format = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1279,7 +1279,7 @@ static void node_initialized(void *data)
|
|||
pw_log_debug("client-node %p: io areas %p", node, impl->io_areas->ptr);
|
||||
|
||||
pw_client_node_resource_set_io(this->resource,
|
||||
PW_ID_IO_ClientNodePosition,
|
||||
PW_IO_ClientNodePosition,
|
||||
m->id,
|
||||
area_size,
|
||||
sizeof(struct pw_client_node_position));
|
||||
|
|
@ -1434,7 +1434,7 @@ static int impl_mix_port_set_io(struct spa_node *node,
|
|||
if (mix == NULL)
|
||||
return -EIO;
|
||||
|
||||
if (id == SPA_ID_IO_Buffers) {
|
||||
if (id == SPA_IO_Buffers) {
|
||||
if (data && size >= sizeof(struct spa_io_buffers))
|
||||
mix->io = data;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ impl_node_add_port(struct spa_node *node, enum spa_direction direction, uint32_t
|
|||
|
||||
if ((res = spa_node_port_set_io(impl->adapter_mix,
|
||||
direction, port_id,
|
||||
SPA_ID_IO_ControlRange,
|
||||
SPA_IO_ControlRange,
|
||||
&impl->ctrl,
|
||||
sizeof(&impl->ctrl))) < 0)
|
||||
return res;
|
||||
|
|
@ -374,20 +374,20 @@ static int negotiate_format(struct impl *impl)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
NULL, &format, &b)) <= 0) {
|
||||
debug_params(impl, impl->adapter_mix, SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_EnumFormat, NULL);
|
||||
SPA_PARAM_EnumFormat, NULL);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
format, &format, &b)) <= 0) {
|
||||
debug_params(impl, impl->cnode, impl->direction, 0,
|
||||
SPA_ID_PARAM_EnumFormat, format);
|
||||
SPA_PARAM_EnumFormat, format);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
|
@ -396,13 +396,13 @@ static int negotiate_format(struct impl *impl)
|
|||
|
||||
if ((res = spa_node_port_set_param(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -433,10 +433,10 @@ static int negotiate_buffers(struct impl *impl)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) <= 0) {
|
||||
debug_params(impl, impl->adapter_mix, SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_Buffers, param);
|
||||
SPA_PARAM_Buffers, param);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if (res == 0)
|
||||
|
|
@ -445,10 +445,10 @@ static int negotiate_buffers(struct impl *impl)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) < 0) {
|
||||
debug_params(impl, impl->cnode, impl->direction, 0,
|
||||
SPA_ID_PARAM_Buffers, param);
|
||||
SPA_PARAM_Buffers, param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -597,7 +597,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
flags, param)) < 0)
|
||||
return res;
|
||||
|
||||
if (id == SPA_ID_PARAM_Format && impl->use_converter) {
|
||||
if (id == SPA_PARAM_Format && impl->use_converter) {
|
||||
if (param == NULL) {
|
||||
if ((res = spa_node_port_set_param(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(direction), 0, id,
|
||||
|
|
@ -636,7 +636,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
if (impl->use_converter)
|
||||
res = spa_node_port_set_io(impl->adapter_mix, direction, port_id, id, data, size);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers && size >= sizeof(struct spa_io_buffers)) {
|
||||
if (id == SPA_IO_Buffers && size >= sizeof(struct spa_io_buffers)) {
|
||||
impl->io = data;
|
||||
}
|
||||
|
||||
|
|
@ -874,7 +874,7 @@ static void client_node_initialized(void *data)
|
|||
|
||||
if ((res = spa_node_port_set_io(impl->client_port->mix,
|
||||
impl->direction, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
impl->client_port_mix.io,
|
||||
sizeof(impl->client_port_mix.io))) < 0)
|
||||
return;
|
||||
|
|
@ -883,7 +883,7 @@ static void client_node_initialized(void *data)
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if ((res = spa_node_port_enum_params(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
NULL, &format, &b)) <= 0) {
|
||||
pw_log_warn("client-stream %p: no format given", &impl->this);
|
||||
impl->adapter = impl->cnode;
|
||||
|
|
@ -920,7 +920,7 @@ static void client_node_initialized(void *data)
|
|||
if (impl->use_converter) {
|
||||
if ((res = spa_node_port_set_io(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
impl->client_port_mix.io,
|
||||
sizeof(impl->client_port_mix.io))) < 0)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ static int find_port_format(struct impl *impl, struct pw_port *port,
|
|||
struct channel_data data = { impl, 0, 0 };
|
||||
|
||||
pw_port_for_each_param(port,
|
||||
SPA_ID_PARAM_EnumFormat,
|
||||
SPA_PARAM_EnumFormat,
|
||||
0, 0, NULL,
|
||||
collect_audio_format, &data);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "floatmix"
|
||||
|
|
@ -327,20 +325,20 @@ static int port_enum_formats(struct spa_node *node,
|
|||
case 0:
|
||||
if (this->have_format) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", this->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels);
|
||||
} else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "iru", 44100,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_FORMAT_AUDIO_channels, "iru", 1);
|
||||
|
|
@ -367,11 +365,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", this->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels);
|
||||
|
||||
|
|
@ -407,13 +405,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -422,16 +420,16 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -448,7 +446,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -464,18 +462,18 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", 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_PARAM_IO_id, "I", SPA_ID_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -628,7 +626,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -714,9 +712,9 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else if (id == SPA_ID_IO_ControlRange)
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
port->ctrl = data;
|
||||
#if 0
|
||||
else if (id == t->io_prop_volume && direction == SPA_DIRECTION_INPUT)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ static struct monitor_item *add_item(struct pw_spa_monitor *this,
|
|||
|
||||
if (spa_pod_object_parse(item,
|
||||
":", SPA_MONITOR_ITEM_id, "s", &id,
|
||||
":", SPA_MONITOR_ITEM_state, "i", &state,
|
||||
":", SPA_MONITOR_ITEM_state, "I", &state,
|
||||
":", SPA_MONITOR_ITEM_name, "s", &name,
|
||||
":", SPA_MONITOR_ITEM_class, "s", &klass,
|
||||
":", SPA_MONITOR_ITEM_factory, "p", &factory,
|
||||
|
|
@ -185,7 +185,7 @@ static void change_item(struct pw_spa_monitor *this, struct spa_pod *item, uint6
|
|||
|
||||
if (spa_pod_object_parse(item,
|
||||
":", SPA_MONITOR_ITEM_name, "s", &name,
|
||||
":", SPA_MONITOR_ITEM_state, "i", &state,
|
||||
":", SPA_MONITOR_ITEM_state, "I", &state,
|
||||
":", SPA_MONITOR_ITEM_id, "s", &id, NULL) < 0)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
uint8_t buf[2048];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buf, sizeof(buf));
|
||||
|
||||
if ((res = spa_node_enum_params(spa_node, SPA_ID_PARAM_Props, &index, NULL, &props, &b)) <= 0) {
|
||||
if ((res = spa_node_enum_params(spa_node, SPA_PARAM_Props, &index, NULL, &props, &b)) <= 0) {
|
||||
pw_log_debug("spa_node_get_props failed: %d", res);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
pw_properties_parse_bool(value);
|
||||
break;
|
||||
case SPA_ID_Enum:
|
||||
SPA_POD_VALUE(struct spa_pod_id, &prop->body.value) =
|
||||
SPA_POD_VALUE(struct spa_pod_enum, &prop->body.value) =
|
||||
spa_debug_type_find_id(spa_debug_types, value);
|
||||
break;
|
||||
case SPA_ID_Int:
|
||||
|
|
@ -219,7 +219,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
}
|
||||
}
|
||||
|
||||
if ((res = spa_node_set_param(spa_node, SPA_ID_PARAM_Props, 0, props)) < 0) {
|
||||
if ((res = spa_node_set_param(spa_node, SPA_PARAM_Props, 0, props)) < 0) {
|
||||
pw_log_debug("spa_node_set_props failed: %d", res);
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ pw_control_new(struct pw_core *core,
|
|||
|
||||
direction = SPA_DIRECTION_OUTPUT;
|
||||
#if 0
|
||||
direction = spa_pod_is_object_id(param, SPA_ID_PARAM_PropsOut) ?
|
||||
direction = spa_pod_is_object_id(param, SPA_PARAM_PropsOut) ?
|
||||
SPA_DIRECTION_OUTPUT : SPA_DIRECTION_INPUT;
|
||||
|
||||
if (spa_pod_object_parse(param,
|
||||
|
|
|
|||
|
|
@ -726,7 +726,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
/* only input needs format */
|
||||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
SPA_ID_PARAM_Format, &oidx,
|
||||
SPA_PARAM_Format, &oidx,
|
||||
NULL, format, builder)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -740,7 +740,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
/* only output needs format */
|
||||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
SPA_ID_PARAM_Format, &iidx,
|
||||
SPA_PARAM_Format, &iidx,
|
||||
NULL, format, builder)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -760,7 +760,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
spa_pod_builder_init(&fb, fbuf, sizeof(fbuf));
|
||||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
SPA_ID_PARAM_EnumFormat, &iidx,
|
||||
SPA_PARAM_EnumFormat, &iidx,
|
||||
NULL, &filter, &fb)) <= 0) {
|
||||
if (res == 0 && iidx == 0) {
|
||||
asprintf(error, "error input enum formats: %s", spa_strerror(res));
|
||||
|
|
@ -775,7 +775,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
|
||||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
SPA_ID_PARAM_EnumFormat, &oidx,
|
||||
SPA_PARAM_EnumFormat, &oidx,
|
||||
filter, format, builder)) <= 0) {
|
||||
if (res == 0) {
|
||||
oidx = 0;
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
index = 0;
|
||||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
SPA_ID_PARAM_Format, &index,
|
||||
SPA_PARAM_Format, &index,
|
||||
format, ¤t, &b)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -204,7 +204,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
index = 0;
|
||||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
SPA_ID_PARAM_Format, &index,
|
||||
SPA_PARAM_Format, &index,
|
||||
format, ¤t, &b)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -230,7 +230,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
pw_log_debug("link %p: doing set format on output mix", this);
|
||||
if ((res = pw_port_set_param(output,
|
||||
this->rt.out_mix.port.port_id,
|
||||
SPA_ID_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
SPA_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
format)) < 0) {
|
||||
asprintf(&error, "error set output format: %d", res);
|
||||
goto error;
|
||||
|
|
@ -243,7 +243,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
pw_log_debug("link %p: doing set format on input mix", this);
|
||||
if ((res2 = pw_port_set_param(input,
|
||||
this->rt.in_mix.port.port_id,
|
||||
SPA_ID_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
SPA_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
format)) < 0) {
|
||||
asprintf(&error, "error set input format: %d", res2);
|
||||
goto error;
|
||||
|
|
@ -536,7 +536,7 @@ static int port_set_io(struct pw_link *this, struct pw_port *port, void *data, s
|
|||
if ((res = spa_node_port_set_io(port->mix,
|
||||
p->direction,
|
||||
p->port_id,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
data, size)) < 0)
|
||||
pw_log_warn("port %p: can't set io: %s", port, spa_strerror(res));
|
||||
}
|
||||
|
|
@ -642,8 +642,8 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
size_t data_sizes[1];
|
||||
ssize_t data_strides[1];
|
||||
|
||||
n_params = param_filter(this, input, output, SPA_ID_PARAM_Buffers, &b);
|
||||
n_params += param_filter(this, input, output, SPA_ID_PARAM_Meta, &b);
|
||||
n_params = param_filter(this, input, output, SPA_PARAM_Buffers, &b);
|
||||
n_params += param_filter(this, input, output, SPA_PARAM_Meta, &b);
|
||||
|
||||
params = alloca(n_params * sizeof(struct spa_pod *));
|
||||
for (i = 0, offset = 0; i < n_params; i++) {
|
||||
|
|
|
|||
|
|
@ -112,14 +112,14 @@ static int suspend_node(struct pw_node *this)
|
|||
pw_log_debug("node %p: suspend node", this);
|
||||
|
||||
spa_list_for_each(p, &this->input_ports, link) {
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_ID_PARAM_Format, 0, NULL)) < 0)
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||
pw_log_warn("error unset format input: %s", spa_strerror(res));
|
||||
/* force CONFIGURE in case of async */
|
||||
p->state = PW_PORT_STATE_CONFIGURE;
|
||||
}
|
||||
|
||||
spa_list_for_each(p, &this->output_ports, link) {
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_ID_PARAM_Format, 0, NULL)) < 0)
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||
pw_log_warn("error unset format output: %s", spa_strerror(res));
|
||||
/* force CONFIGURE in case of async */
|
||||
p->state = PW_PORT_STATE_CONFIGURE;
|
||||
|
|
|
|||
|
|
@ -527,26 +527,26 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
}
|
||||
|
||||
#if 0
|
||||
pw_port_for_each_param(port, SPA_ID_PARAM_PropsOut, 0, 0, NULL, make_control, port);
|
||||
pw_port_for_each_param(port, SPA_ID_PARAM_PropsIn, 0, 0, NULL, make_control, port);
|
||||
pw_port_for_each_param(port, SPA_PARAM_PropsOut, 0, 0, NULL, make_control, port);
|
||||
pw_port_for_each_param(port, SPA_PARAM_PropsIn, 0, 0, NULL, make_control, port);
|
||||
#endif
|
||||
|
||||
pw_log_debug("port %p: setting node io", port);
|
||||
spa_node_port_set_io(node->node,
|
||||
port->direction, port_id,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&port->rt.io, sizeof(port->rt.io));
|
||||
|
||||
if (port->mix && port->mix->port_set_io) {
|
||||
spa_node_port_set_io(port->mix,
|
||||
pw_direction_reverse(port->direction), 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&port->rt.io, sizeof(port->rt.io));
|
||||
}
|
||||
|
||||
if (spa_node_port_set_io(node->node,
|
||||
port->direction, port_id,
|
||||
SPA_ID_IO_Clock,
|
||||
SPA_IO_Clock,
|
||||
&port->rt.clock, sizeof(port->rt.clock)) >= 0) {
|
||||
node->rt.clock = &port->rt.clock;
|
||||
pw_log_debug("port %p: set node clock %p", port, node->rt.clock);
|
||||
|
|
@ -813,7 +813,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32
|
|||
}
|
||||
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
if (param == NULL || res < 0) {
|
||||
free_allocation(&port->allocation);
|
||||
port->allocated = false;
|
||||
|
|
|
|||
|
|
@ -775,7 +775,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
|||
spa_pod_builder_init(&b, buf, sizeof(buf));
|
||||
if (spa_node_port_enum_params(port->node->node,
|
||||
port->direction, port->port_id,
|
||||
SPA_ID_PARAM_List, &idx1,
|
||||
SPA_PARAM_List, &idx1,
|
||||
NULL, ¶m, &b) <= 0)
|
||||
break;
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ client_node_set_io(void *object,
|
|||
pw_log_debug("node %p: set io %s %p", proxy,
|
||||
spa_debug_type_find_name(spa_debug_types, id), ptr);
|
||||
|
||||
if (id == PW_ID_IO_ClientNodePosition) {
|
||||
if (id == PW_IO_ClientNodePosition) {
|
||||
if (ptr == NULL && data->position) {
|
||||
m = find_mem_ptr(data, data->position);
|
||||
if (m && --m->ref == 0)
|
||||
|
|
@ -973,7 +973,7 @@ client_node_port_set_param(void *object,
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
struct mix *mix;
|
||||
spa_list_for_each(mix, &data->mix[direction], link) {
|
||||
if (mix->port->port_id == port_id)
|
||||
|
|
@ -1202,7 +1202,7 @@ client_node_port_set_io(void *object,
|
|||
pw_log_debug("port %p: set io %s %p", mix->port,
|
||||
spa_debug_type_find_name(spa_debug_types, id), ptr);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers) {
|
||||
if (id == SPA_IO_Buffers) {
|
||||
if (ptr == NULL && mix->mix.io) {
|
||||
deactivate_mix(data, mix);
|
||||
m = find_mem_ptr(data, mix->mix.io);
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
pw_log_debug("stream %p: set io %s %p %zd", impl,
|
||||
spa_debug_type_find_name(spa_debug_types, id), data, size);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers) {
|
||||
if (id == SPA_IO_Buffers) {
|
||||
if (data && size >= sizeof(struct spa_io_buffers))
|
||||
impl->io = data;
|
||||
else
|
||||
|
|
@ -395,7 +395,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
|
||||
(*index)++;
|
||||
|
||||
if (id == SPA_ID_PARAM_List) {
|
||||
if (id == SPA_PARAM_List) {
|
||||
uint32_t new_id = ((struct spa_pod_object *) param)->body.id;
|
||||
|
||||
if (last_id == SPA_ID_INVALID){
|
||||
|
|
@ -438,7 +438,7 @@ static int port_set_format(struct spa_node *node,
|
|||
if (p == NULL)
|
||||
goto no_mem;
|
||||
|
||||
((struct spa_pod_object*)p->param)->body.id = SPA_ID_PARAM_Format;
|
||||
((struct spa_pod_object*)p->param)->body.id = SPA_PARAM_Format;
|
||||
}
|
||||
else
|
||||
p = NULL;
|
||||
|
|
@ -466,7 +466,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ extern "C" {
|
|||
#include <spa/node/event.h>
|
||||
#include <spa/node/command.h>
|
||||
#include <spa/monitor/monitor.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/node/io.h>
|
||||
|
||||
#include <pipewire/map.h>
|
||||
|
|
@ -47,8 +45,11 @@ enum {
|
|||
PW_ID_INTERFACE_Module,
|
||||
PW_ID_INTERFACE_ClientNode,
|
||||
|
||||
PW_ID_IO_BASE = PW_ID_FIRST + SPA_ID_IO_BASE,
|
||||
PW_ID_IO_ClientNodePosition,
|
||||
};
|
||||
|
||||
enum {
|
||||
PW_IO_BASE = PW_ID_FIRST,
|
||||
PW_IO_ClientNodePosition,
|
||||
};
|
||||
|
||||
#define PW_TYPE_BASE "PipeWire:"
|
||||
|
|
|
|||
|
|
@ -1101,9 +1101,9 @@ static bool do_node_params(struct data *data, const char *cmd, char *args, char
|
|||
return false;
|
||||
}
|
||||
if (n == 2)
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
else
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
|
||||
id = atoi(a[0]);
|
||||
global = pw_map_lookup(&rd->globals, id);
|
||||
|
|
@ -1135,9 +1135,9 @@ static bool do_port_params(struct data *data, const char *cmd, char *args, char
|
|||
return false;
|
||||
}
|
||||
if (n == 2)
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
else
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
|
||||
id = atoi(a[0]);
|
||||
global = pw_map_lookup(&rd->globals, id);
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static void node_event_info(void *object, struct pw_node_info *info)
|
|||
|
||||
if (info->change_mask & PW_NODE_CHANGE_MASK_ENUM_PARAMS) {
|
||||
pw_node_proxy_enum_params((struct pw_node_proxy*)data->proxy,
|
||||
SPA_ID_PARAM_List, 0, 0, NULL);
|
||||
SPA_PARAM_List, 0, 0, NULL);
|
||||
add_pending(data);
|
||||
}
|
||||
if (data->pending_seq == SPA_ID_INVALID)
|
||||
|
|
@ -310,7 +310,7 @@ static void port_event_info(void *object, struct pw_port_info *info)
|
|||
|
||||
if (info->change_mask & PW_PORT_CHANGE_MASK_ENUM_PARAMS) {
|
||||
pw_port_proxy_enum_params((struct pw_port_proxy*)data->proxy,
|
||||
SPA_ID_PARAM_EnumFormat, 0, 0, NULL);
|
||||
SPA_PARAM_EnumFormat, 0, 0, NULL);
|
||||
add_pending(data);
|
||||
}
|
||||
if (data->pending_seq == SPA_ID_INVALID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue