mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
port: implement latency reporting some more
Implement a port recalculate latency method that takes the min and max latency of all peer ports and sets that as the new port latency. When a link is made, let the output and input port recalculate latencies. Pass latency param in audioconvert.
This commit is contained in:
parent
b588cc6b03
commit
cd32404e92
6 changed files with 125 additions and 3 deletions
|
|
@ -958,6 +958,12 @@ impl_node_port_set_param(void *object,
|
|||
flags, param)) < 0)
|
||||
return res;
|
||||
|
||||
if (id == SPA_PARAM_Latency && direction == this->direction) {
|
||||
if ((res = spa_node_port_set_param(this->follower, direction, 0, id,
|
||||
flags, param)) < 0)
|
||||
return res;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1044,6 +1044,7 @@ impl_node_port_set_param(void *object,
|
|||
switch (id) {
|
||||
case SPA_PARAM_Latency:
|
||||
target = this->fmt[SPA_DIRECTION_REVERSE(direction)];
|
||||
port_id = 0;
|
||||
break;
|
||||
default:
|
||||
is_monitor = IS_MONITOR_PORT(this, direction, port_id);
|
||||
|
|
|
|||
|
|
@ -683,6 +683,8 @@ impl_node_port_set_param(void *object,
|
|||
this, id, direction, port_id, param);
|
||||
|
||||
switch (id) {
|
||||
case SPA_PARAM_Latency:
|
||||
return 0;
|
||||
case SPA_PARAM_Format:
|
||||
return port_set_format(object, direction, port_id, flags, param);
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue