mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
audioconvert: mark ports and buffers as DYNAMIC
Only passthrough buffer data when the buffer and ports are marked as DYNAMIC. Use extra buffer for nodes that keep a ref on buffers (resample).
This commit is contained in:
parent
df5c81e3be
commit
036ca89c0e
11 changed files with 81 additions and 39 deletions
|
|
@ -689,6 +689,9 @@ impl_node_port_use_buffers(struct spa_node *node,
|
|||
this, j, i);
|
||||
}
|
||||
b->datas[j] = d[j].data;
|
||||
if (direction == SPA_DIRECTION_OUTPUT &&
|
||||
!SPA_FLAG_CHECK(d[j].flags, SPA_DATA_FLAG_DYNAMIC))
|
||||
this->is_passthrough = false;
|
||||
}
|
||||
|
||||
if (direction == SPA_DIRECTION_OUTPUT)
|
||||
|
|
@ -925,7 +928,7 @@ static int impl_clear(struct spa_handle *handle)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int init_port(struct impl *this, enum spa_direction direction, uint32_t port_id, uint32_t flags)
|
||||
static int init_port(struct impl *this, enum spa_direction direction, uint32_t port_id)
|
||||
{
|
||||
struct port *port;
|
||||
|
||||
|
|
@ -936,7 +939,9 @@ static int init_port(struct impl *this, enum spa_direction direction, uint32_t p
|
|||
spa_list_init(&port->queue);
|
||||
port->info_all = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_PROPS;
|
||||
port->info = SPA_PORT_INFO_INIT();
|
||||
port->info.flags = flags;
|
||||
port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS |
|
||||
SPA_PORT_FLAG_NO_REF |
|
||||
SPA_PORT_FLAG_DYNAMIC_DATA;
|
||||
port->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ);
|
||||
port->params[1] = SPA_PARAM_INFO(SPA_PARAM_Meta, SPA_PARAM_INFO_READ);
|
||||
port->params[2] = SPA_PARAM_INFO(SPA_PARAM_IO, SPA_PARAM_INFO_READ);
|
||||
|
|
@ -997,8 +1002,8 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
this->info.n_params = 0;
|
||||
props_reset(&this->props);
|
||||
|
||||
init_port(this, SPA_DIRECTION_OUTPUT, 0, SPA_PORT_FLAG_CAN_USE_BUFFERS);
|
||||
init_port(this, SPA_DIRECTION_INPUT, 0, SPA_PORT_FLAG_CAN_USE_BUFFERS);
|
||||
init_port(this, SPA_DIRECTION_OUTPUT, 0);
|
||||
init_port(this, SPA_DIRECTION_INPUT, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue