vulkan: Only allocate buffers when DMABUFS are used

This commit is contained in:
columbarius 2023-08-10 04:28:53 +02:00 committed by Wim Taymans
parent b8c91f7e54
commit 2456d58397
2 changed files with 16 additions and 2 deletions

View file

@ -538,6 +538,13 @@ static int port_set_format(struct impl *this, struct port *port,
modifier_fixed = true; modifier_fixed = true;
} }
if (info.info.dsp.flags & SPA_VIDEO_FLAG_MODIFIER) {
port->info.flags |= SPA_PORT_FLAG_CAN_ALLOC_BUFFERS;
} else {
port->info.flags &= ~SPA_PORT_FLAG_CAN_ALLOC_BUFFERS;
}
port->info.change_mask |= SPA_PORT_CHANGE_MASK_FLAGS;
port->current_format = info; port->current_format = info;
port->have_format = true; port->have_format = true;
@ -832,7 +839,7 @@ impl_init(const struct spa_handle_factory *factory,
SPA_PORT_CHANGE_MASK_PARAMS | SPA_PORT_CHANGE_MASK_PARAMS |
SPA_PORT_CHANGE_MASK_PROPS; SPA_PORT_CHANGE_MASK_PROPS;
port->info = SPA_PORT_INFO_INIT(); port->info = SPA_PORT_INFO_INIT();
port->info.flags = SPA_PORT_FLAG_NO_REF | SPA_PORT_FLAG_CAN_ALLOC_BUFFERS; port->info.flags = SPA_PORT_FLAG_NO_REF;
port->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ); 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[1] = SPA_PARAM_INFO(SPA_PARAM_Meta, SPA_PARAM_INFO_READ);
port->params[2] = SPA_PARAM_INFO(SPA_PARAM_IO, SPA_PARAM_INFO_READ); port->params[2] = SPA_PARAM_INFO(SPA_PARAM_IO, SPA_PARAM_INFO_READ);

View file

@ -773,6 +773,13 @@ static int port_set_format(struct impl *this, struct port *port,
modifier_fixed = true; modifier_fixed = true;
} }
if (info.info.dsp.flags & SPA_VIDEO_FLAG_MODIFIER) {
port->info.flags |= SPA_PORT_FLAG_CAN_ALLOC_BUFFERS;
} else {
port->info.flags &= ~SPA_PORT_FLAG_CAN_ALLOC_BUFFERS;
}
port->info.change_mask |= SPA_PORT_CHANGE_MASK_FLAGS;
port->current_format = info; port->current_format = info;
port->have_format = true; port->have_format = true;
spa_vulkan_prepare(&this->state); spa_vulkan_prepare(&this->state);
@ -1054,7 +1061,7 @@ impl_init(const struct spa_handle_factory *factory,
SPA_PORT_CHANGE_MASK_PARAMS | SPA_PORT_CHANGE_MASK_PARAMS |
SPA_PORT_CHANGE_MASK_PROPS; SPA_PORT_CHANGE_MASK_PROPS;
port->info = SPA_PORT_INFO_INIT(); port->info = SPA_PORT_INFO_INIT();
port->info.flags = SPA_PORT_FLAG_NO_REF | SPA_PORT_FLAG_CAN_ALLOC_BUFFERS; port->info.flags = SPA_PORT_FLAG_NO_REF;
if (this->props.live) if (this->props.live)
port->info.flags |= SPA_PORT_FLAG_LIVE; port->info.flags |= SPA_PORT_FLAG_LIVE;
port->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ); port->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ);