mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
node: remove port_alloc_buffers
Remove the now obsolete port_alloc_buffer, rework to use the port_use_buffers with the ALLOC flag.
This commit is contained in:
parent
2f3351ef9b
commit
deb6c52f76
21 changed files with 60 additions and 462 deletions
|
|
@ -640,34 +640,18 @@ static int negotiate_buffers(struct impl *this)
|
|||
return -errno;
|
||||
this->n_buffers = buffers;
|
||||
|
||||
if (conv_alloc) {
|
||||
if ((res = spa_node_port_alloc_buffers(this->convert,
|
||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||
NULL, 0,
|
||||
this->buffers, &this->n_buffers)) < 0)
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
if ((res = spa_node_port_use_buffers(this->convert,
|
||||
SPA_DIRECTION_REVERSE(this->direction), 0, 0,
|
||||
this->buffers, this->n_buffers)) < 0)
|
||||
return res;
|
||||
}
|
||||
if (slave_alloc) {
|
||||
if ((res = spa_node_port_alloc_buffers(this->slave,
|
||||
this->direction, 0,
|
||||
NULL, 0,
|
||||
this->buffers, &this->n_buffers)) < 0) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((res = spa_node_port_use_buffers(this->slave,
|
||||
this->direction, 0, 0,
|
||||
this->buffers, this->n_buffers)) < 0) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
if ((res = spa_node_port_use_buffers(this->convert,
|
||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||
conv_alloc ? SPA_NODE_BUFFERS_FLAG_ALLOC : 0,
|
||||
this->buffers, this->n_buffers)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_use_buffers(this->slave,
|
||||
this->direction, 0,
|
||||
slave_alloc ? SPA_NODE_BUFFERS_FLAG_ALLOC : 0,
|
||||
this->buffers, this->n_buffers)) < 0)
|
||||
return res;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -757,26 +741,6 @@ impl_node_port_use_buffers(void *object,
|
|||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_alloc_buffers(void *object,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
{
|
||||
struct impl *this = object;
|
||||
|
||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||
|
||||
if (direction != this->direction)
|
||||
port_id++;
|
||||
|
||||
return spa_node_port_alloc_buffers(this->target, direction, port_id,
|
||||
params, n_params, buffers, n_buffers);
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id)
|
||||
{
|
||||
|
|
@ -826,7 +790,6 @@ static const struct spa_node_methods impl_node = {
|
|||
.port_enum_params = impl_node_port_enum_params,
|
||||
.port_set_param = impl_node_port_set_param,
|
||||
.port_use_buffers = impl_node_port_use_buffers,
|
||||
.port_alloc_buffers = impl_node_port_alloc_buffers,
|
||||
.port_set_io = impl_node_port_set_io,
|
||||
.port_reuse_buffer = impl_node_port_reuse_buffer,
|
||||
.process = impl_node_process,
|
||||
|
|
|
|||
|
|
@ -335,32 +335,18 @@ static int negotiate_link_buffers(struct impl *this, struct link *link)
|
|||
|
||||
link->n_buffers = buffers;
|
||||
|
||||
if (out_alloc) {
|
||||
if ((res = spa_node_port_alloc_buffers(link->out_node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
NULL, 0,
|
||||
link->buffers, &link->n_buffers)) < 0)
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
if ((res = spa_node_port_use_buffers(link->out_node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port, 0,
|
||||
link->buffers, link->n_buffers)) < 0)
|
||||
return res;
|
||||
}
|
||||
if (in_alloc) {
|
||||
if ((res = spa_node_port_alloc_buffers(link->in_node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
NULL, 0,
|
||||
link->buffers, &link->n_buffers)) < 0)
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
if ((res = spa_node_port_use_buffers(link->in_node,
|
||||
SPA_DIRECTION_INPUT, link->in_port, 0,
|
||||
link->buffers, link->n_buffers)) < 0)
|
||||
return res;
|
||||
}
|
||||
if ((res = spa_node_port_use_buffers(link->out_node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
out_alloc ? SPA_NODE_BUFFERS_FLAG_ALLOC : 0,
|
||||
link->buffers, link->n_buffers)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_use_buffers(link->in_node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
in_alloc ? SPA_NODE_BUFFERS_FLAG_ALLOC : 0,
|
||||
link->buffers, link->n_buffers)) < 0)
|
||||
return res;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -826,29 +812,6 @@ impl_node_port_use_buffers(void *object,
|
|||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_alloc_buffers(void *object,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
{
|
||||
struct impl *this = object;
|
||||
struct spa_node *target;
|
||||
|
||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||
|
||||
if (this->mode == MODE_MERGE && port_id > 0 && direction == SPA_DIRECTION_OUTPUT)
|
||||
target = this->fmt[SPA_DIRECTION_INPUT];
|
||||
else
|
||||
target = this->fmt[direction];
|
||||
|
||||
return spa_node_port_alloc_buffers(target, direction, port_id,
|
||||
params, n_params, buffers, n_buffers);
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_set_io(void *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
|
|
@ -948,7 +911,6 @@ static const struct spa_node_methods impl_node = {
|
|||
.port_enum_params = impl_node_port_enum_params,
|
||||
.port_set_param = impl_node_port_set_param,
|
||||
.port_use_buffers = impl_node_port_use_buffers,
|
||||
.port_alloc_buffers = impl_node_port_alloc_buffers,
|
||||
.port_set_io = impl_node_port_set_io,
|
||||
.port_reuse_buffer = impl_node_port_reuse_buffer,
|
||||
.process = impl_node_process,
|
||||
|
|
|
|||
|
|
@ -751,18 +751,6 @@ impl_node_port_use_buffers(void *object,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_alloc_buffers(void *object,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_set_io(void *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
|
|
@ -937,7 +925,6 @@ static const struct spa_node_methods impl_node = {
|
|||
.port_enum_params = impl_node_port_enum_params,
|
||||
.port_set_param = impl_node_port_set_param,
|
||||
.port_use_buffers = impl_node_port_use_buffers,
|
||||
.port_alloc_buffers = impl_node_port_alloc_buffers,
|
||||
.port_set_io = impl_node_port_set_io,
|
||||
.port_reuse_buffer = impl_node_port_reuse_buffer,
|
||||
.process = impl_node_process,
|
||||
|
|
|
|||
|
|
@ -715,18 +715,6 @@ impl_node_port_use_buffers(void *object,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_alloc_buffers(void *object,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_set_io(void *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
|
|
@ -897,7 +885,6 @@ static const struct spa_node_methods impl_node = {
|
|||
.port_enum_params = impl_node_port_enum_params,
|
||||
.port_set_param = impl_node_port_set_param,
|
||||
.port_use_buffers = impl_node_port_use_buffers,
|
||||
.port_alloc_buffers = impl_node_port_alloc_buffers,
|
||||
.port_set_io = impl_node_port_set_io,
|
||||
.port_reuse_buffer = impl_node_port_reuse_buffer,
|
||||
.process = impl_node_process,
|
||||
|
|
|
|||
|
|
@ -798,18 +798,6 @@ impl_node_port_use_buffers(void *object,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_alloc_buffers(void *object,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_set_io(void *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
|
|
@ -1007,7 +995,6 @@ static const struct spa_node_methods impl_node = {
|
|||
.port_enum_params = impl_node_port_enum_params,
|
||||
.port_set_param = impl_node_port_set_param,
|
||||
.port_use_buffers = impl_node_port_use_buffers,
|
||||
.port_alloc_buffers = impl_node_port_alloc_buffers,
|
||||
.port_set_io = impl_node_port_set_io,
|
||||
.port_reuse_buffer = impl_node_port_reuse_buffer,
|
||||
.process = impl_node_process,
|
||||
|
|
|
|||
|
|
@ -627,18 +627,6 @@ impl_node_port_use_buffers(void *object,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_alloc_buffers(void *object,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_set_io(void *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
|
|
@ -846,7 +834,6 @@ static const struct spa_node_methods impl_node = {
|
|||
.port_enum_params = impl_node_port_enum_params,
|
||||
.port_set_param = impl_node_port_set_param,
|
||||
.port_use_buffers = impl_node_port_use_buffers,
|
||||
.port_alloc_buffers = impl_node_port_alloc_buffers,
|
||||
.port_set_io = impl_node_port_set_io,
|
||||
.port_reuse_buffer = impl_node_port_reuse_buffer,
|
||||
.process = impl_node_process,
|
||||
|
|
|
|||
|
|
@ -763,18 +763,6 @@ impl_node_port_use_buffers(void *object,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_alloc_buffers(void *object,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int
|
||||
impl_node_port_set_io(void *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
|
|
@ -928,7 +916,6 @@ static const struct spa_node_methods impl_node = {
|
|||
.port_enum_params = impl_node_port_enum_params,
|
||||
.port_set_param = impl_node_port_set_param,
|
||||
.port_use_buffers = impl_node_port_use_buffers,
|
||||
.port_alloc_buffers = impl_node_port_alloc_buffers,
|
||||
.port_set_io = impl_node_port_set_io,
|
||||
.port_reuse_buffer = impl_node_port_reuse_buffer,
|
||||
.process = impl_node_process,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue