mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-28 07:58:08 -04:00
adapter: negotiate from target to follower
Now that the filter functions prefer the filter default value, use the target object as a filter for buffer allocation as well.
This commit is contained in:
parent
96007dc576
commit
417a72365e
2 changed files with 28 additions and 28 deletions
|
|
@ -449,27 +449,27 @@ static int negotiate_buffers(struct impl *this)
|
||||||
|
|
||||||
state = 0;
|
state = 0;
|
||||||
param = NULL;
|
param = NULL;
|
||||||
if ((res = node_port_enum_params_sync(this, this->follower,
|
if ((res = node_port_enum_params_sync(this, this->target,
|
||||||
this->direction, 0,
|
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||||
SPA_PARAM_Buffers, &state,
|
SPA_PARAM_Buffers, &state,
|
||||||
param, ¶m, &b)) < 0) {
|
param, ¶m, &b)) < 0) {
|
||||||
if (res == -ENOENT)
|
if (res == -ENOENT)
|
||||||
param = NULL;
|
param = NULL;
|
||||||
else {
|
else {
|
||||||
debug_params(this, this->follower, this->direction, 0,
|
debug_params(this, this->target,
|
||||||
SPA_PARAM_Buffers, param, "follower buffers", res);
|
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||||
|
SPA_PARAM_Buffers, param, "target buffers", res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state = 0;
|
state = 0;
|
||||||
if ((res = node_port_enum_params_sync(this, this->target,
|
if ((res = node_port_enum_params_sync(this, this->follower,
|
||||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
this->direction, 0,
|
||||||
SPA_PARAM_Buffers, &state,
|
SPA_PARAM_Buffers, &state,
|
||||||
param, ¶m, &b)) != 1) {
|
param, ¶m, &b)) != 1) {
|
||||||
debug_params(this, this->target,
|
debug_params(this, this->follower, this->direction, 0,
|
||||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
SPA_PARAM_Buffers, param, "follower buffers", res);
|
||||||
SPA_PARAM_Buffers, param, "convert buffers", res);
|
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
|
|
@ -503,7 +503,7 @@ static int negotiate_buffers(struct impl *this)
|
||||||
if (this->async)
|
if (this->async)
|
||||||
buffers = SPA_MAX(2u, buffers);
|
buffers = SPA_MAX(2u, buffers);
|
||||||
|
|
||||||
spa_log_debug(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
|
spa_log_info(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
|
||||||
this, buffers, blocks, size, stride, align, follower_alloc, conv_alloc);
|
this, buffers, blocks, size, stride, align, follower_alloc, conv_alloc);
|
||||||
|
|
||||||
align = SPA_MAX(align, this->max_align);
|
align = SPA_MAX(align, this->max_align);
|
||||||
|
|
@ -966,11 +966,11 @@ static int negotiate_format(struct impl *this)
|
||||||
/* The target has been negotiated on its other ports and so it can propose
|
/* The target has been negotiated on its other ports and so it can propose
|
||||||
* a passthrough format or an ideal conversion. We use the suggestions of the
|
* a passthrough format or an ideal conversion. We use the suggestions of the
|
||||||
* target to find the best follower format */
|
* target to find the best follower format */
|
||||||
for (fstate = 0;;) {
|
for (tstate = 0;;) {
|
||||||
format = NULL;
|
format = NULL;
|
||||||
res = node_port_enum_params_sync(this, this->target,
|
res = node_port_enum_params_sync(this, this->target,
|
||||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||||
SPA_PARAM_EnumFormat, &fstate,
|
SPA_PARAM_EnumFormat, &tstate,
|
||||||
NULL, &format, &b);
|
NULL, &format, &b);
|
||||||
|
|
||||||
if (res == -ENOENT)
|
if (res == -ENOENT)
|
||||||
|
|
@ -981,10 +981,10 @@ static int negotiate_format(struct impl *this)
|
||||||
if (format != NULL)
|
if (format != NULL)
|
||||||
spa_debug_log_pod(this->log, SPA_LOG_LEVEL_DEBUG, 0, NULL, format);
|
spa_debug_log_pod(this->log, SPA_LOG_LEVEL_DEBUG, 0, NULL, format);
|
||||||
|
|
||||||
tstate = 0;
|
fstate = 0;
|
||||||
fres = node_port_enum_params_sync(this, this->follower,
|
fres = node_port_enum_params_sync(this, this->follower,
|
||||||
this->direction, 0,
|
this->direction, 0,
|
||||||
SPA_PARAM_EnumFormat, &tstate,
|
SPA_PARAM_EnumFormat, &fstate,
|
||||||
format, &format, &b);
|
format, &format, &b);
|
||||||
if (fres == 0 && res == 1)
|
if (fres == 0 && res == 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -451,27 +451,27 @@ static int negotiate_buffers(struct impl *this)
|
||||||
|
|
||||||
state = 0;
|
state = 0;
|
||||||
param = NULL;
|
param = NULL;
|
||||||
if ((res = node_port_enum_params_sync(this, this->follower,
|
if ((res = node_port_enum_params_sync(this, this->target,
|
||||||
this->direction, 0,
|
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||||
SPA_PARAM_Buffers, &state,
|
SPA_PARAM_Buffers, &state,
|
||||||
param, ¶m, &b)) < 0) {
|
param, ¶m, &b)) < 0) {
|
||||||
if (res == -ENOENT)
|
if (res == -ENOENT)
|
||||||
param = NULL;
|
param = NULL;
|
||||||
else {
|
else {
|
||||||
debug_params(this, this->follower, this->direction, 0,
|
debug_params(this, this->target,
|
||||||
SPA_PARAM_Buffers, param, "follower buffers", res);
|
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||||
|
SPA_PARAM_Buffers, param, "target buffers", res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state = 0;
|
state = 0;
|
||||||
if ((res = node_port_enum_params_sync(this, this->target,
|
if ((res = node_port_enum_params_sync(this, this->follower,
|
||||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
this->direction, 0,
|
||||||
SPA_PARAM_Buffers, &state,
|
SPA_PARAM_Buffers, &state,
|
||||||
param, ¶m, &b)) != 1) {
|
param, ¶m, &b)) != 1) {
|
||||||
debug_params(this, this->target,
|
debug_params(this, this->follower, this->direction, 0,
|
||||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
SPA_PARAM_Buffers, param, "follower buffers", res);
|
||||||
SPA_PARAM_Buffers, param, "convert buffers", res);
|
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
|
|
@ -507,7 +507,7 @@ static int negotiate_buffers(struct impl *this)
|
||||||
if (this->async)
|
if (this->async)
|
||||||
buffers = SPA_MAX(2u, buffers);
|
buffers = SPA_MAX(2u, buffers);
|
||||||
|
|
||||||
spa_log_debug(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
|
spa_log_info(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
|
||||||
this, buffers, blocks, size, stride, align, follower_alloc, conv_alloc);
|
this, buffers, blocks, size, stride, align, follower_alloc, conv_alloc);
|
||||||
|
|
||||||
align = SPA_MAX(align, this->max_align);
|
align = SPA_MAX(align, this->max_align);
|
||||||
|
|
@ -1017,11 +1017,11 @@ static int negotiate_format(struct impl *this)
|
||||||
/* The target has been negotiated on its other ports and so it can propose
|
/* The target has been negotiated on its other ports and so it can propose
|
||||||
* a passthrough format or an ideal conversion. We use the suggestions of the
|
* a passthrough format or an ideal conversion. We use the suggestions of the
|
||||||
* target to find the best follower format */
|
* target to find the best follower format */
|
||||||
for (fstate = 0;;) {
|
for (tstate = 0;;) {
|
||||||
format = NULL;
|
format = NULL;
|
||||||
res = node_port_enum_params_sync(this, this->target,
|
res = node_port_enum_params_sync(this, this->target,
|
||||||
SPA_DIRECTION_REVERSE(this->direction), 0,
|
SPA_DIRECTION_REVERSE(this->direction), 0,
|
||||||
SPA_PARAM_EnumFormat, &fstate,
|
SPA_PARAM_EnumFormat, &tstate,
|
||||||
NULL, &format, &b);
|
NULL, &format, &b);
|
||||||
|
|
||||||
if (res == -ENOENT)
|
if (res == -ENOENT)
|
||||||
|
|
@ -1032,10 +1032,10 @@ static int negotiate_format(struct impl *this)
|
||||||
if (format != NULL)
|
if (format != NULL)
|
||||||
spa_debug_log_pod(this->log, SPA_LOG_LEVEL_DEBUG, 0, NULL, format);
|
spa_debug_log_pod(this->log, SPA_LOG_LEVEL_DEBUG, 0, NULL, format);
|
||||||
|
|
||||||
tstate = 0;
|
fstate = 0;
|
||||||
fres = node_port_enum_params_sync(this, this->follower,
|
fres = node_port_enum_params_sync(this, this->follower,
|
||||||
this->direction, 0,
|
this->direction, 0,
|
||||||
SPA_PARAM_EnumFormat, &tstate,
|
SPA_PARAM_EnumFormat, &fstate,
|
||||||
format, &format, &b);
|
format, &format, &b);
|
||||||
if (fres == 0 && res == 1)
|
if (fres == 0 && res == 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue