mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/param-alloc.h>
|
||||
#include <spa/node.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/node/node.h>
|
||||
|
||||
#include <pipewire/proxy.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,11 +24,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/param-alloc.h>
|
||||
#include <spa/node.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/node/node.h>
|
||||
|
||||
#define PW_TYPE_PROTOCOL__Native PW_TYPE_PROTOCOL_BASE "Native"
|
||||
#define PW_TYPE_PROTOCOL_NATIVE_BASE PW_TYPE_PROTOCOL__Native ":"
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@
|
|||
#include <gst/video/video.h>
|
||||
#include <gst/audio/audio.h>
|
||||
|
||||
#include <spa/pod-builder.h>
|
||||
#include <spa/video/format-utils.h>
|
||||
#include <spa/audio/format-utils.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/pod/builder.h>
|
||||
|
||||
#include "gstpipewireformat.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/pod/pod.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -39,11 +39,7 @@
|
|||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <gio/gunixfdmessage.h>
|
||||
#include <gst/allocators/gstfdmemory.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include <spa/buffer.h>
|
||||
|
||||
#include "gstpipewireformat.h"
|
||||
|
||||
|
|
@ -236,37 +232,37 @@ 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, t->param.idBuffers, t->param_alloc_buffers.Buffers);
|
||||
spa_pod_builder_push_object (&b, t->param.idBuffers, t->param_buffers.Buffers);
|
||||
if (size == 0)
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_alloc_buffers.size, "iru", 0, SPA_PROP_RANGE(0, INT32_MAX), NULL);
|
||||
":", t->param_buffers.size, "iru", 0, SPA_PROP_RANGE(0, INT32_MAX), NULL);
|
||||
else
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_alloc_buffers.size, "ir", size, SPA_PROP_RANGE(size, INT32_MAX), NULL);
|
||||
":", t->param_buffers.size, "ir", size, SPA_PROP_RANGE(size, INT32_MAX), NULL);
|
||||
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_alloc_buffers.stride, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_alloc_buffers.buffers, "iru", min_buffers,
|
||||
":", t->param_buffers.stride, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_buffers.buffers, "iru", min_buffers,
|
||||
SPA_PROP_RANGE(min_buffers,
|
||||
max_buffers ? max_buffers : INT32_MAX),
|
||||
":", t->param_alloc_buffers.align, "i", 16,
|
||||
":", t->param_buffers.align, "i", 16,
|
||||
NULL);
|
||||
port_params[0] = spa_pod_builder_pop_deref (&b);
|
||||
|
||||
port_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));
|
||||
|
||||
port_params[2] = spa_pod_builder_object (&b,
|
||||
t->param.idMeta, 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, "i", size * SPA_MAX (4,
|
||||
t->param.idMeta, 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, "i", size * SPA_MAX (4,
|
||||
SPA_MAX (min_buffers, max_buffers)),
|
||||
":", 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);
|
||||
|
||||
pw_thread_loop_lock (sink->main_loop);
|
||||
pw_stream_finish_format (sink->stream, SPA_RESULT_OK, 2, port_params);
|
||||
|
|
|
|||
|
|
@ -40,13 +40,10 @@
|
|||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <gio/gunixfdmessage.h>
|
||||
#include <gst/net/gstnetclientclock.h>
|
||||
#include <gst/allocators/gstfdmemory.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include <spa/buffer.h>
|
||||
|
||||
#include "gstpipewireclock.h"
|
||||
|
||||
static GQuark process_mem_data_quark;
|
||||
|
|
@ -755,16 +752,16 @@ on_format_changed (void *data,
|
|||
|
||||
spa_pod_builder_init (&b, buffer, sizeof (buffer));
|
||||
params[0] = spa_pod_builder_object (&b,
|
||||
0, t->param_alloc_buffers.Buffers,
|
||||
":", t->param_alloc_buffers.size, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_alloc_buffers.stride, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_alloc_buffers.buffers, "ir", 16, SPA_PROP_RANGE(1, INT32_MAX),
|
||||
":", t->param_alloc_buffers.align, "i", 16);
|
||||
0, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_buffers.stride, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_buffers.buffers, "ir", 16, SPA_PROP_RANGE(1, INT32_MAX),
|
||||
":", t->param_buffers.align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object (&b,
|
||||
0, 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));
|
||||
0, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
GST_DEBUG_OBJECT (pwsrc, "doing finish format");
|
||||
pw_stream_finish_format (pwsrc->stream, SPA_RESULT_OK, 2, params);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
#include <sys/mman.h>
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
#include "spa/node.h"
|
||||
#include "spa/lib/pod.h"
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/lib/pod.h>
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
#include "pipewire/interfaces.h"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include <errno.h>
|
||||
|
||||
#include "spa/pod-parser.h"
|
||||
#include <spa/pod/parser.h>
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
#include "pipewire/interfaces.h"
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ extern "C" {
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/node.h>
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
#include <pipewire/mem.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@
|
|||
#include <sys/file.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/pod/parser.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
#include <sys/mman.h>
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
#include <spa/node.h>
|
||||
#include <spa/hook.h>
|
||||
#include <spa/audio/format-utils.h>
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/utils/hook.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
|
||||
#include <spa/lib/pod.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
#ifndef __PIPEWIRE_JACK_NODE_H__
|
||||
#define __PIPEWIRE_JACK_NODE_H__
|
||||
|
||||
#include <spa/buffer.h>
|
||||
|
||||
#include <pipewire/node.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/file.h>
|
||||
|
||||
#include <spa/pod/iter.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/hook.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
struct pw_protocol_native_connection_events {
|
||||
#define PW_VERSION_PROTOCOL_NATIVE_CONNECTION_EVENTS 0
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "spa/pod-parser.h"
|
||||
#include "spa/pod/parser.h"
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
#include "pipewire/protocol.h"
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <spa/node.h>
|
||||
#include <spa/monitor.h>
|
||||
#include <spa/pod-parser.h>
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/monitor/monitor.h>
|
||||
#include <spa/pod/parser.h>
|
||||
|
||||
#include <pipewire/log.h>
|
||||
#include <pipewire/type.h>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef __PIPEWIRE_SPA_MONITOR_H__
|
||||
#define __PIPEWIRE_SPA_MONITOR_H__
|
||||
|
||||
#include <spa/monitor.h>
|
||||
#include <spa/monitor/monitor.h>
|
||||
|
||||
#include <pipewire/core.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,9 @@
|
|||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <spa/node.h>
|
||||
#include <spa/graph.h>
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/pod/iter.h>
|
||||
|
||||
#include "spa-node.h"
|
||||
#include "pipewire/node.h"
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
#ifndef __PIPEWIRE_SPA_NODE_H__
|
||||
#define __PIPEWIRE_SPA_NODE_H__
|
||||
|
||||
#include <spa/clock.h>
|
||||
#include <spa/node.h>
|
||||
#include <spa/clock/clock.h>
|
||||
#include <spa/node/node.h>
|
||||
|
||||
#include <pipewire/core.h>
|
||||
#include <pipewire/node.h>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
/** \class pw_array
|
||||
*
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
/** \class pw_client
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#define spa_debug pw_log_trace
|
||||
|
||||
#include <spa/lib/debug.h>
|
||||
#include <spa/format-utils.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <pipewire/private.h>
|
||||
|
|
@ -32,7 +31,7 @@
|
|||
#include <pipewire/core.h>
|
||||
#include <pipewire/data-loop.h>
|
||||
|
||||
#include <spa/graph-scheduler6.h>
|
||||
#include <spa/graph/graph-scheduler6.h>
|
||||
|
||||
/** \cond */
|
||||
struct resource_data {
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
/** \class pw_core
|
||||
*
|
||||
|
|
@ -37,6 +37,7 @@ extern "C" {
|
|||
*/
|
||||
struct pw_core;
|
||||
|
||||
#include <pipewire/type.h>
|
||||
#include <pipewire/client.h>
|
||||
#include <pipewire/global.h>
|
||||
#include <pipewire/introspect.h>
|
||||
|
|
@ -44,7 +45,6 @@ struct pw_core;
|
|||
#include <pipewire/factory.h>
|
||||
#include <pipewire/port.h>
|
||||
#include <pipewire/properties.h>
|
||||
#include <pipewire/type.h>
|
||||
|
||||
/** \page page_core_api Core API
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
/** \class pw_data_loop
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,11 +24,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/props.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/param-alloc.h>
|
||||
#include <spa/node.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/node/node.h>
|
||||
|
||||
#include <pipewire/introspect.h>
|
||||
#include <pipewire/proxy.h>
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
#ifndef __PIPEWIRE_INTROSPECT_H__
|
||||
#define __PIPEWIRE_INTROSPECT_H__
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <spa/lib/debug.h>
|
||||
#include <spa/video/format.h>
|
||||
#include <spa/pod-utils.h>
|
||||
#include <spa/pod/parser.h>
|
||||
#include <spa/param/param.h>
|
||||
|
||||
#include <spa/lib/debug.h>
|
||||
#include <spa/lib/pod.h>
|
||||
|
||||
#include "pipewire.h"
|
||||
|
|
@ -239,18 +239,18 @@ static struct spa_pod_object *find_param(struct spa_pod_object **params, int n_p
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static struct spa_pod_object *find_meta_enable(struct pw_core *core, struct spa_pod_object **params,
|
||||
static struct spa_pod_object *find_meta(struct pw_core *core, struct spa_pod_object **params,
|
||||
int n_params, uint32_t type)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < n_params; i++) {
|
||||
if (spa_pod_is_object_type
|
||||
(¶ms[i]->pod, core->type.param_alloc_meta_enable.MetaEnable)) {
|
||||
(¶ms[i]->pod, core->type.param_meta.Meta)) {
|
||||
uint32_t qtype;
|
||||
|
||||
if (spa_pod_object_parse(params[i],
|
||||
":", core->type.param_alloc_meta_enable.type, "I", &qtype, NULL) < 0)
|
||||
":", core->type.param_meta.type, "I", &qtype, NULL) < 0)
|
||||
continue;
|
||||
|
||||
if (qtype == type)
|
||||
|
|
@ -294,12 +294,12 @@ static struct spa_buffer **alloc_buffers(struct pw_link *this,
|
|||
/* collect metadata */
|
||||
for (i = 0; i < n_params; i++) {
|
||||
if (spa_pod_is_object_type
|
||||
(¶ms[i]->pod, this->core->type.param_alloc_meta_enable.MetaEnable)) {
|
||||
(¶ms[i]->pod, this->core->type.param_meta.Meta)) {
|
||||
uint32_t type, size;
|
||||
|
||||
if (spa_pod_object_parse(params[i],
|
||||
":", this->core->type.param_alloc_meta_enable.type, "I", &type,
|
||||
":", this->core->type.param_alloc_meta_enable.size, "i", &size, NULL) < 0)
|
||||
":", this->core->type.param_meta.type, "I", &type,
|
||||
":", this->core->type.param_meta.size, "i", &size, NULL) < 0)
|
||||
continue;
|
||||
|
||||
pw_log_debug("link %p: enable meta %d %d", this, type, size);
|
||||
|
|
@ -398,8 +398,8 @@ param_filter(struct pw_link *this,
|
|||
uint32_t id,
|
||||
struct spa_pod_builder *result)
|
||||
{
|
||||
uint8_t ibuf[2048], obuf[2048];
|
||||
struct spa_pod_builder ib = { 0 }, ob = { 0 };
|
||||
uint8_t ibuf[4096];
|
||||
struct spa_pod_builder ib = { 0 };
|
||||
struct spa_pod_object *oparam, *iparam;
|
||||
uint32_t iidx, oidx, num = 0;
|
||||
|
||||
|
|
@ -411,15 +411,12 @@ param_filter(struct pw_link *this,
|
|||
break;
|
||||
iparam = spa_pod_builder_deref(&ib, 0);
|
||||
|
||||
pw_log_debug("iparam %d", iidx);
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(&iparam->pod, 0);
|
||||
|
||||
for (oidx = 0;;) {
|
||||
uint32_t offset;
|
||||
|
||||
spa_pod_builder_init(&ob, obuf, sizeof(obuf));
|
||||
|
||||
offset = result->offset;
|
||||
|
||||
pw_log_debug("oparam %d %d", oidx, offset);
|
||||
|
|
@ -430,7 +427,6 @@ param_filter(struct pw_link *this,
|
|||
}
|
||||
oparam = spa_pod_builder_deref(result, offset);
|
||||
|
||||
pw_log_debug("oparam %d", oidx);
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(&oparam->pod, 0);
|
||||
|
||||
|
|
@ -539,15 +535,14 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
offset += SPA_ROUND_UP_N(SPA_POD_SIZE(params[i]), 8);
|
||||
}
|
||||
|
||||
param = find_meta_enable(this->core, params, n_params,
|
||||
t->meta.Ringbuffer);
|
||||
param = find_meta(this->core, params, n_params, t->meta.Ringbuffer);
|
||||
if (param) {
|
||||
uint32_t ms, s;
|
||||
max_buffers = 1;
|
||||
|
||||
if (spa_pod_object_parse(param,
|
||||
":", t->param_alloc_meta_enable.ringbufferSize, "i", &ms,
|
||||
":", t->param_alloc_meta_enable.ringbufferStride, "i", &s, NULL) >= 0) {
|
||||
":", t->param_meta.ringbufferSize, "i", &ms,
|
||||
":", t->param_meta.ringbufferStride, "i", &s, NULL) >= 0) {
|
||||
minsize = ms;
|
||||
stride = s;
|
||||
}
|
||||
|
|
@ -555,15 +550,15 @@ 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,
|
||||
t->param_alloc_buffers.Buffers);
|
||||
t->param_buffers.Buffers);
|
||||
if (param) {
|
||||
uint32_t qmax_buffers = max_buffers,
|
||||
qminsize = minsize, qstride = stride;
|
||||
|
||||
spa_pod_object_parse(param,
|
||||
":", t->param_alloc_buffers.size, "i", &qminsize,
|
||||
":", t->param_alloc_buffers.stride, "i", &qstride,
|
||||
":", t->param_alloc_buffers.buffers, "i", &qmax_buffers, NULL);
|
||||
":", t->param_buffers.size, "i", &qminsize,
|
||||
":", t->param_buffers.stride, "i", &qstride,
|
||||
":", t->param_buffers.buffers, "i", &qmax_buffers, NULL);
|
||||
|
||||
max_buffers =
|
||||
qmax_buffers == 0 ? max_buffers : SPA_MIN(qmax_buffers,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef __PIPEWIRE_LOG_H__
|
||||
#define __PIPEWIRE_LOG_H__
|
||||
|
||||
#include <spa/log.h>
|
||||
#include <spa/support/log.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <spa/loop.h>
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/support/loop.h>
|
||||
#include <spa/support/type-map.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <pipewire/loop.h>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/loop.h>
|
||||
#include <spa/support/loop.h>
|
||||
|
||||
#include <pipewire/properties.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ extern "C" {
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <pipewire/array.h>
|
||||
|
||||
/** \class pw_map
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef __PIPEWIRE_MEM_H__
|
||||
#define __PIPEWIRE_MEM_H__
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
#include <pipewire/core.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <spa/clock.h>
|
||||
#include <spa/clock/clock.h>
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
#include "pipewire/interfaces.h"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/plugin.h>
|
||||
#include <spa/support/plugin.h>
|
||||
|
||||
#include <pipewire/client.h>
|
||||
#include <pipewire/core.h>
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ extern "C" {
|
|||
#define PW_TYPE__Port "PipeWire:Object:Port"
|
||||
#define PW_TYPE_PORT_BASE PW_TYPE__Port ":"
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/node.h>
|
||||
#include <spa/buffer.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
/** \page page_port Port
|
||||
*
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
#define spa_debug pw_log_trace
|
||||
#endif
|
||||
|
||||
#include <spa/graph.h>
|
||||
#include <spa/graph/graph.h>
|
||||
|
||||
struct pw_command;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
//extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/dict.h>
|
||||
#include <spa/utils/dict.h>
|
||||
|
||||
/** \class pw_properties
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/list.h>
|
||||
#include <spa/utils/list.h>
|
||||
|
||||
struct pw_protocol;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
/** \page page_proxy Proxy
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <spa/pod/parser.h>
|
||||
#include <spa/lib/debug.h>
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
/** \page page_remote_api Remote API
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ extern "C" {
|
|||
#define PW_TYPE__Resource "PipeWire:Object:Resource"
|
||||
#define PW_TYPE_RESOURCE_BASE PW_TYPE__Resource ":"
|
||||
|
||||
#include <spa/hook.h>
|
||||
#include <spa/utils/hook.h>
|
||||
|
||||
/** \page page_resource Resource
|
||||
*
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ extern "C" {
|
|||
*/
|
||||
struct pw_stream;
|
||||
|
||||
#include <spa/buffer.h>
|
||||
#include <spa/format.h>
|
||||
#include <spa/buffer/buffer.h>
|
||||
#include <spa/param/param.h>
|
||||
|
||||
#include <pipewire/remote.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,12 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "spa/defs.h"
|
||||
#include "spa/clock.h"
|
||||
#include "spa/type-map.h"
|
||||
#include "spa/monitor.h"
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/clock/clock.h>
|
||||
#include <spa/param/format.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/monitor/monitor.h>
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
#include "pipewire/type.h"
|
||||
|
|
@ -58,7 +60,6 @@ void pw_type_init(struct pw_type *type)
|
|||
spa_type_event_node_map(type->map, &type->event_node);
|
||||
spa_type_command_node_map(type->map, &type->command_node);
|
||||
spa_type_monitor_map(type->map, &type->monitor);
|
||||
spa_type_param_alloc_buffers_map(type->map, &type->param_alloc_buffers);
|
||||
spa_type_param_alloc_meta_enable_map(type->map, &type->param_alloc_meta_enable);
|
||||
spa_type_param_alloc_video_padding_map(type->map, &type->param_alloc_video_padding);
|
||||
spa_type_param_buffers_map(type->map, &type->param_buffers);
|
||||
spa_type_param_meta_map(type->map, &type->param_meta);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,12 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/type-map.h>
|
||||
#include <spa/event-node.h>
|
||||
#include <spa/command-node.h>
|
||||
#include <spa/monitor.h>
|
||||
#include <spa/param-alloc.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#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 <pipewire/map.h>
|
||||
|
||||
|
|
@ -69,9 +70,8 @@ struct pw_type {
|
|||
struct spa_type_event_node event_node;
|
||||
struct spa_type_command_node command_node;
|
||||
struct spa_type_monitor monitor;
|
||||
struct spa_type_param_alloc_buffers param_alloc_buffers;
|
||||
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
|
||||
struct spa_type_param_alloc_video_padding param_alloc_video_padding;
|
||||
struct spa_type_param_buffers param_buffers;
|
||||
struct spa_type_param_meta param_meta;
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <spa/pod-utils.h>
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/pod/pod.h>
|
||||
|
||||
/** \class pw_utils
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue