mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-06 16:09:43 +00:00
buffers: make alignment optional
Make the alignment parameter optional when negotiating buffers. Default to a 16 bytes alignment and adjust for the max cpu alignment. Remove the useless align buffer parameter in plugins, we always set it to 16 anyway.
This commit is contained in:
parent
30982775d9
commit
35cbe4e939
|
@ -369,8 +369,7 @@ static void on_stream_param_changed(void *data, uint32_t id, const struct spa_po
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(buffers, MIN_BUFFERS, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(pw->blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(size, size, INT_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(pw->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(pw->stride));
|
||||
|
||||
pw_stream_update_params(pw->stream, params, n_params);
|
||||
}
|
||||
|
|
|
@ -1774,8 +1774,7 @@ static int param_buffers(struct client *c, struct port *p,
|
|||
MAX_BUFFER_FRAMES * sizeof(float),
|
||||
sizeof(float)),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(p->object->port.type_id == TYPE_ID_AUDIO ?
|
||||
sizeof(float) : 1),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
sizeof(float) : 1));
|
||||
break;
|
||||
case TYPE_ID_VIDEO:
|
||||
*param = spa_pod_builder_add_object(b,
|
||||
|
@ -1786,8 +1785,7 @@ static int param_buffers(struct client *c, struct port *p,
|
|||
320 * 240 * 4 * 4,
|
||||
0,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_CHOICE_RANGE_Int(4, 4, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_CHOICE_RANGE_Int(4, 4, INT32_MAX));
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
|
@ -1128,7 +1128,6 @@ static void on_stream_param_changed(void *data, uint32_t id, const struct spa_po
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(size, 0, INT_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_CHOICE_RANGE_Int(0, 0, INT_MAX),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<<SPA_DATA_MemFd)));
|
||||
|
||||
pw_stream_update_params(file->stream, params, n_params);
|
||||
|
|
|
@ -556,8 +556,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
this->props.max_latency * this->frame_size,
|
||||
this->props.min_latency * this->frame_size,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->frame_size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->frame_size));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -503,8 +503,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
this->props.max_latency * this->frame_size,
|
||||
this->props.min_latency * this->frame_size,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->frame_size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->frame_size));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -559,8 +559,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(
|
||||
4096, 4096, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -46,6 +46,8 @@
|
|||
#define SPA_LOG_TOPIC_DEFAULT log_topic
|
||||
static struct spa_log_topic *log_topic = &SPA_LOG_TOPIC(0, "spa.audioadapter");
|
||||
|
||||
#define DEFAULT_ALIGN 16
|
||||
|
||||
#define MAX_PORTS SPA_AUDIO_MAX_CHANNELS
|
||||
|
||||
/** \cond */
|
||||
|
@ -367,13 +369,15 @@ static int negotiate_buffers(struct impl *this)
|
|||
follower_alloc = false;
|
||||
}
|
||||
|
||||
align = DEFAULT_ALIGN;
|
||||
|
||||
if ((res = spa_pod_parse_object(param,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, NULL,
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_Int(&buffers),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(&blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(&size),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(&stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(&align))) < 0)
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_OPT_Int(&align))) < 0)
|
||||
return res;
|
||||
|
||||
spa_log_debug(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
#define SPA_LOG_TOPIC_DEFAULT log_topic
|
||||
static struct spa_log_topic *log_topic = &SPA_LOG_TOPIC(0, "spa.audioconvert");
|
||||
|
||||
#define DEFAULT_ALIGN 16
|
||||
|
||||
#define MAX_PORTS SPA_AUDIO_MAX_CHANNELS
|
||||
|
||||
struct buffer {
|
||||
|
@ -361,12 +363,14 @@ static int negotiate_link_buffers(struct impl *this, struct link *link)
|
|||
in_alloc = false;
|
||||
}
|
||||
|
||||
align = DEFAULT_ALIGN;
|
||||
|
||||
if (spa_pod_parse_object(param,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, NULL,
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_Int(&buffers),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(&blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(&size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(&align)) < 0)
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_OPT_Int(&align)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
spa_log_debug(this->log, "%p: buffers %d, blocks %d, size %d, align %d %d:%d",
|
||||
|
|
|
@ -971,8 +971,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
DEFAULT_CONTROL_BUFFER_SIZE,
|
||||
1024,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1));
|
||||
} else {
|
||||
if (other->n_buffers > 0) {
|
||||
buffers = other->n_buffers;
|
||||
|
@ -990,8 +989,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
size * port->stride,
|
||||
16 * port->stride,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -533,8 +533,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(port->blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(other->size / other->stride * port->stride),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
|
||||
|
||||
} else {
|
||||
|
@ -546,8 +545,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * 2 * port->stride,
|
||||
16 * port->stride,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -872,8 +872,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * port->stride,
|
||||
16 * port->stride,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
break;
|
||||
case SPA_PARAM_Meta:
|
||||
switch (result.index) {
|
||||
|
|
|
@ -509,8 +509,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
size * port->stride,
|
||||
16 * port->stride,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -553,8 +553,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * port->stride,
|
||||
16 * port->stride,
|
||||
MAX_SAMPLES * port->stride),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -461,8 +461,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * port->stride,
|
||||
16 * port->stride,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -424,8 +424,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * this->stride,
|
||||
16 * this->stride,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->stride));
|
||||
break;
|
||||
case SPA_PARAM_Meta:
|
||||
switch (result.index) {
|
||||
|
|
|
@ -403,8 +403,7 @@ next:
|
|||
MAX_SAMPLES * this->stride,
|
||||
16 * this->stride,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->stride));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -649,8 +649,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * port->bpf,
|
||||
16 * port->bpf,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->bpf),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->bpf));
|
||||
break;
|
||||
case SPA_PARAM_Meta:
|
||||
switch (result.index) {
|
||||
|
|
|
@ -1085,8 +1085,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
this->props.min_latency * port->frame_size,
|
||||
this->props.min_latency * port->frame_size,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -995,8 +995,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
this->props.max_latency * port->frame_size,
|
||||
this->props.min_latency * port->frame_size,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -906,8 +906,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
this->props.max_latency * port->frame_size,
|
||||
this->props.min_latency * port->frame_size,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -908,8 +908,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
this->props.max_latency * port->frame_size,
|
||||
this->props.min_latency * port->frame_size,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->frame_size));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -351,8 +351,7 @@ next:
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(4096, 512, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_IO:
|
||||
|
|
|
@ -568,8 +568,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * port->stride,
|
||||
16 * port->stride,
|
||||
MAX_SAMPLES * port->stride),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_IO:
|
||||
|
|
|
@ -567,8 +567,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * port->stride,
|
||||
16 * port->stride,
|
||||
MAX_SAMPLES * port->stride),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_IO:
|
||||
|
|
|
@ -530,8 +530,7 @@ next:
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(n_buffers, n_buffers, n_buffers),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(port->streamConfig.frameSize),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->streamConfig.stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->streamConfig.stride));
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -541,8 +541,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * port->bpf,
|
||||
16 * port->bpf,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->bpf),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->bpf));
|
||||
break;
|
||||
case SPA_PARAM_IO:
|
||||
switch (result.index) {
|
||||
|
|
|
@ -482,8 +482,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, 32),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(128),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1));
|
||||
break;
|
||||
case SPA_PARAM_Meta:
|
||||
switch (result.index) {
|
||||
|
|
|
@ -494,8 +494,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(32, 2, 32),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(128),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(1));
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
|
|
|
@ -544,8 +544,7 @@ static int impl_node_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(MAX_BUFFERS, 2, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(port->fmt.fmt.pix.sizeimage),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->fmt.fmt.pix.bytesperline),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->fmt.fmt.pix.bytesperline));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include <spa/debug/format.h>
|
||||
#include <spa/debug/pod.h>
|
||||
|
||||
#define DEFAULT_ALIGN 16
|
||||
|
||||
#define NAME "videoadapter"
|
||||
|
||||
/** \cond */
|
||||
|
@ -620,12 +622,14 @@ static int negotiate_buffers(struct impl *this)
|
|||
follower_alloc = false;
|
||||
}
|
||||
|
||||
align = DEFAULT_ALIGN;
|
||||
|
||||
if ((res = spa_pod_parse_object(param,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, NULL,
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_Int(&buffers),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(&blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(&size),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(&align))) < 0)
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_OPT_Int(&align))) < 0)
|
||||
return res;
|
||||
|
||||
spa_log_debug(this->log, "%p: buffers %d, blocks %d, size %d, align %d %d:%d",
|
||||
|
|
|
@ -558,8 +558,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(port->stride * raw_info->size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride));
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -389,8 +389,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
MAX_SAMPLES * this->bpf,
|
||||
16 * this->bpf,
|
||||
INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(0),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->bpf));
|
||||
break;
|
||||
case SPA_PARAM_Meta:
|
||||
switch (result.index) {
|
||||
|
|
|
@ -600,8 +600,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(this->position->video.stride *
|
||||
this->position->video.size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->position->video.stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(this->position->video.stride));
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -240,8 +240,7 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 2, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(d->stride * d->format.size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(d->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(d->stride));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -221,8 +221,7 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(
|
||||
BUFFER_SAMPLES * sizeof(float), 32, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(sizeof(float)),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(sizeof(float)));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -172,8 +172,7 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, 32),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(d->stride * d->format.size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(d->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(d->stride));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
|
|
|
@ -358,7 +358,6 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(data->stride * data->size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<<SPA_DATA_MemPtr) | (1<<SPA_DATA_DmaBuf)));
|
||||
|
||||
/* we are done */
|
||||
|
|
|
@ -421,7 +421,6 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(size * mult),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride * mult),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<<SPA_DATA_MemPtr)));
|
||||
|
||||
/* a header metadata with timing information */
|
||||
|
|
|
@ -250,7 +250,6 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(data->stride * data->size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<<SPA_DATA_MemPtr)));
|
||||
|
||||
/* we are done */
|
||||
|
@ -318,8 +317,7 @@ static int reneg_buffers(struct data *data)
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(8, 2, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(data->stride * data->size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride));
|
||||
|
||||
pw_stream_update_params(data->stream, params, 1);
|
||||
|
||||
|
|
|
@ -369,7 +369,6 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(size * mult),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride * mult),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<<SPA_DATA_MemPtr)));
|
||||
|
||||
/* a header metadata with timing information */
|
||||
|
|
|
@ -326,7 +326,6 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(data->stride * data->format.size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(1<<SPA_DATA_MemFd));
|
||||
|
||||
params[1] = spa_pod_builder_add_object(&b,
|
||||
|
|
|
@ -462,7 +462,6 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(size),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(buffertypes));
|
||||
|
||||
params[1] = spa_pod_builder_add_object(&b,
|
||||
|
|
|
@ -341,7 +341,6 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(data->stride * data->format.size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(1<<SPA_DATA_MemFd));
|
||||
|
||||
params[1] = spa_pod_builder_add_object(&b,
|
||||
|
|
|
@ -244,8 +244,7 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(8, 2, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int(data->stride * data->format.size.height),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(data->stride));
|
||||
|
||||
params[1] = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
|
||||
|
|
|
@ -252,7 +252,6 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
SPA_MAX(MIN_BUFFERS, min_buffers),
|
||||
SPA_MAX(MIN_BUFFERS, min_buffers),
|
||||
max_buffers ? max_buffers : INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(
|
||||
(1<<SPA_DATA_MemFd) |
|
||||
(1<<SPA_DATA_MemPtr)),
|
||||
|
|
|
@ -837,7 +837,6 @@ on_param_changed (void *data, uint32_t id,
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_CHOICE_RANGE_Int(0, 1, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(0, 0, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_CHOICE_RANGE_Int(0, 0, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(
|
||||
(1<<SPA_DATA_MemFd) |
|
||||
(1<<SPA_DATA_MemPtr)));
|
||||
|
|
|
@ -1021,8 +1021,7 @@ static const struct spa_pod *get_buffers_param(struct stream *s,
|
|||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(
|
||||
size, size, maxsize),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride));
|
||||
return param;
|
||||
}
|
||||
|
||||
|
|
|
@ -1606,8 +1606,7 @@ static void add_audio_dsp_port_params(struct filter *impl, struct port *port)
|
|||
sizeof(float),
|
||||
MAX_SAMPLES * sizeof(float),
|
||||
sizeof(float)),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(4),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16)));
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(4)));
|
||||
}
|
||||
|
||||
static void add_video_dsp_port_params(struct filter *impl, struct port *port)
|
||||
|
|
Loading…
Reference in a new issue