mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
filter: Add mappable dataTypes to SPA_PARAM_BUFFERS_dataType if PW_FILTER_PORT_MAP_BUFFERS is set for inputs
This lets consumer just set SPA_DATA_MemPtr as their supported dataType and will add all by PW_STREAM_MAP_BUFFERS supported dataTypes, which are made available with the MemPtr API to the param
This commit is contained in:
parent
9b7aa168cb
commit
f1ad7e2486
1 changed files with 22 additions and 0 deletions
|
|
@ -188,6 +188,28 @@ static struct param *add_param(struct filter *impl, struct port *port,
|
|||
if (p == NULL)
|
||||
return NULL;
|
||||
|
||||
if (id == SPA_PARAM_Buffers && SPA_FLAG_IS_SET(port->flags, PW_FILTER_PORT_FLAG_MAP_BUFFERS) &&
|
||||
port->direction == SPA_DIRECTION_INPUT)
|
||||
{
|
||||
const struct spa_pod_prop *pod_param;
|
||||
uint32_t dataType = 0;
|
||||
|
||||
pod_param = spa_pod_find_prop(param, NULL, SPA_PARAM_BUFFERS_dataType);
|
||||
if (pod_param != NULL)
|
||||
{
|
||||
spa_pod_get_int(&pod_param->value, (int32_t*)&dataType);
|
||||
pw_log_debug(NAME" dataType: %d", dataType);
|
||||
if ((dataType & (1<<SPA_DATA_MemPtr)) > 0)
|
||||
{
|
||||
pw_log_debug(NAME" Change dataType");
|
||||
struct spa_pod_int *int_pod = (struct spa_pod_int*)&pod_param->value;
|
||||
dataType = dataType | mappable_dataTypes;
|
||||
pw_log_debug(NAME" dataType: %d", dataType);
|
||||
int_pod->value = dataType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p->id = id;
|
||||
p->flags = flags;
|
||||
p->param = SPA_MEMBER(p, sizeof(struct param), struct spa_pod);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue