mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
Reorganise SPA tree
Reorganise the SPA includes to make it more extensible later Simplify the naming of the buffer and meta params
This commit is contained in:
parent
58451d626c
commit
caaeaff223
151 changed files with 1353 additions and 964 deletions
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/format-utils.h>
|
||||
#include <spa/video/format-utils.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/lib/debug.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
|
@ -347,21 +347,21 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return SPA_RESULT_ENUM_END;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
id, t->param_alloc_buffers.Buffers,
|
||||
":", t->param_alloc_buffers.size, "i", d->stride * d->format.size.height,
|
||||
":", t->param_alloc_buffers.stride, "i", d->stride,
|
||||
":", t->param_alloc_buffers.buffers, "iru", 32,
|
||||
id, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "i", d->stride * d->format.size.height,
|
||||
":", t->param_buffers.stride, "i", d->stride,
|
||||
":", t->param_buffers.buffers, "iru", 32,
|
||||
2, 2, 32,
|
||||
":", t->param_alloc_buffers.align, "i", 16);
|
||||
":", t->param_buffers.align, "i", 16);
|
||||
}
|
||||
else if (id == t->param.idMeta) {
|
||||
if (*index != 0)
|
||||
return SPA_RESULT_ENUM_END;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
id, t->param_alloc_meta_enable.MetaEnable,
|
||||
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
|
||||
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
}
|
||||
else
|
||||
return SPA_RESULT_UNKNOWN_PARAM;
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@
|
|||
#include <math.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/format-utils.h>
|
||||
#include <spa/audio/format-utils.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/lib/debug.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
|
@ -236,32 +236,32 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return SPA_RESULT_ENUM_END;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
id, t->param_alloc_buffers.Buffers,
|
||||
":", t->param_alloc_buffers.size, "iru", 1024,
|
||||
id, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "iru", 1024,
|
||||
2, 32, 4096,
|
||||
":", t->param_alloc_buffers.stride, "i", 0,
|
||||
":", t->param_alloc_buffers.buffers, "iru", 2,
|
||||
":", t->param_buffers.stride, "i", 0,
|
||||
":", t->param_buffers.buffers, "iru", 2,
|
||||
2, 2, 32,
|
||||
":", t->param_alloc_buffers.align, "i", 16);
|
||||
":", t->param_buffers.align, "i", 16);
|
||||
}
|
||||
else if (id == t->param.idMeta) {
|
||||
switch (*index) {
|
||||
case 0:
|
||||
spa_pod_builder_object(builder,
|
||||
id, t->param_alloc_meta_enable.MetaEnable,
|
||||
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
|
||||
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
break;
|
||||
case 1:
|
||||
spa_pod_builder_object(builder,
|
||||
id, t->param_alloc_meta_enable.MetaEnable,
|
||||
":", t->param_alloc_meta_enable.type, "I", t->meta.Ringbuffer,
|
||||
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_ringbuffer),
|
||||
":", t->param_alloc_meta_enable.ringbufferSize, "ir", 1024 * 4,
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Ringbuffer,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_ringbuffer),
|
||||
":", t->param_meta.ringbufferSize, "ir", 1024 * 4,
|
||||
2, 16 * 4, INT32_MAX / 4,
|
||||
":", t->param_alloc_meta_enable.ringbufferStride, "i", 0,
|
||||
":", t->param_alloc_meta_enable.ringbufferBlocks, "i", 1,
|
||||
":", t->param_alloc_meta_enable.ringbufferAlign, "i", 16);
|
||||
":", t->param_meta.ringbufferStride, "i", 0,
|
||||
":", t->param_meta.ringbufferBlocks, "i", 1,
|
||||
":", t->param_meta.ringbufferAlign, "i", 16);
|
||||
break;
|
||||
default:
|
||||
return SPA_RESULT_ENUM_END;
|
||||
|
|
|
|||
|
|
@ -21,10 +21,11 @@
|
|||
#include <sys/mman.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/format-utils.h>
|
||||
#include <spa/video/format-utils.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
|
||||
#include <spa/lib/debug.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/format-utils.h>
|
||||
#include <spa/video/format-utils.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/lib/debug.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
|
@ -304,21 +304,21 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return SPA_RESULT_ENUM_END;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
id, t->param_alloc_buffers.Buffers,
|
||||
":", t->param_alloc_buffers.size, "i", d->stride * d->format.size.height,
|
||||
":", t->param_alloc_buffers.stride, "i", d->stride,
|
||||
":", t->param_alloc_buffers.buffers, "iru", 2,
|
||||
id, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "i", d->stride * d->format.size.height,
|
||||
":", t->param_buffers.stride, "i", d->stride,
|
||||
":", t->param_buffers.buffers, "iru", 2,
|
||||
2, 1, 32,
|
||||
":", t->param_alloc_buffers.align, "i", 16);
|
||||
":", t->param_buffers.align, "i", 16);
|
||||
}
|
||||
else if (id == t->param.idMeta) {
|
||||
if (*index > 0)
|
||||
return SPA_RESULT_ENUM_END;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
id, t->param_alloc_meta_enable.MetaEnable,
|
||||
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
|
||||
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
}
|
||||
else
|
||||
return SPA_RESULT_UNKNOWN_PARAM;
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/format-utils.h>
|
||||
#include <spa/video/format-utils.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/lib/debug.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
|
@ -267,17 +267,17 @@ on_stream_format_changed(void *_data, struct spa_pod_object *format)
|
|||
SDL_UnlockTexture(data->texture);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
t->param.idBuffers, t->param_alloc_buffers.Buffers,
|
||||
":", t->param_alloc_buffers.size, "i", data->stride * data->format.size.height,
|
||||
":", t->param_alloc_buffers.stride, "i", data->stride,
|
||||
":", t->param_alloc_buffers.buffers, "iru", 32,
|
||||
t->param.idBuffers, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "i", data->stride * data->format.size.height,
|
||||
":", t->param_buffers.stride, "i", data->stride,
|
||||
":", t->param_buffers.buffers, "iru", 32,
|
||||
2, 2, 32,
|
||||
":", t->param_alloc_buffers.align, "i", 16);
|
||||
":", t->param_buffers.align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object(&b,
|
||||
t->param.idMeta, t->param_alloc_meta_enable.MetaEnable,
|
||||
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
|
||||
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
|
||||
t->param.idMeta, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
pw_stream_finish_format(stream, SPA_RESULT_OK, 2, params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
#include <time.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/format-utils.h>
|
||||
#include <spa/video/format-utils.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/lib/debug.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
|
@ -184,17 +184,17 @@ on_stream_format_changed(void *_data, struct spa_pod_object *format)
|
|||
data->stride = SPA_ROUND_UP_N(data->format.size.width * BPP, 4);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
t->param.idBuffers, t->param_alloc_buffers.Buffers,
|
||||
":", t->param_alloc_buffers.size, "i", data->stride * data->format.size.height,
|
||||
":", t->param_alloc_buffers.stride, "i", data->stride,
|
||||
":", t->param_alloc_buffers.buffers, "iru", 2,
|
||||
t->param.idBuffers, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "i", data->stride * data->format.size.height,
|
||||
":", t->param_buffers.stride, "i", data->stride,
|
||||
":", t->param_buffers.buffers, "iru", 2,
|
||||
2, 1, 32,
|
||||
":", t->param_alloc_buffers.align, "i", 16);
|
||||
":", t->param_buffers.align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object(&b,
|
||||
t->param.idMeta, t->param_alloc_meta_enable.MetaEnable,
|
||||
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
|
||||
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
|
||||
t->param.idMeta, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
pw_stream_finish_format(stream, SPA_RESULT_OK, 2, params);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue