mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-20 08:56:56 -05:00
impl-port/audioconvert: add PORT_IGNORE_LATENCY
Add port.ignore-latency prop, which if true causes peer ports to ignore the latency of the given port. This is useful for ports that are not intended to affect latency calculations of other ports, such as ports in monitor streams.
This commit is contained in:
parent
85d2933268
commit
6e17962ad0
5 changed files with 22 additions and 1 deletions
|
|
@ -914,6 +914,7 @@ int pw_impl_port_register(struct pw_impl_port *port,
|
|||
PW_KEY_PORT_CONTROL,
|
||||
PW_KEY_PORT_ALIAS,
|
||||
PW_KEY_PORT_EXTRA,
|
||||
PW_KEY_PORT_IGNORE_LATENCY,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -992,6 +993,8 @@ int pw_impl_port_add(struct pw_impl_port *port, struct pw_impl_node *node)
|
|||
|
||||
is_monitor = pw_properties_get_bool(port->properties, PW_KEY_PORT_MONITOR, false);
|
||||
|
||||
port->ignore_latency = pw_properties_get_bool(port->properties, PW_KEY_PORT_IGNORE_LATENCY, false);
|
||||
|
||||
is_control = PW_IMPL_PORT_IS_CONTROL(port);
|
||||
if (is_control) {
|
||||
dir = port->direction == PW_DIRECTION_INPUT ? "control" : "notify";
|
||||
|
|
@ -1440,6 +1443,11 @@ int pw_impl_port_recalc_latency(struct pw_impl_port *port)
|
|||
if (port->direction == PW_DIRECTION_OUTPUT) {
|
||||
spa_list_for_each(l, &port->links, output_link) {
|
||||
other = l->input;
|
||||
if (other->ignore_latency) {
|
||||
pw_log_debug("port %d: peer %d: peer latency ignored",
|
||||
port->info.id, other->info.id);
|
||||
continue;
|
||||
}
|
||||
spa_latency_info_combine(&latency, &other->latency[other->direction]);
|
||||
pw_log_debug("port %d: peer %d: latency %f-%f %d-%d %"PRIu64"-%"PRIu64,
|
||||
port->info.id, other->info.id,
|
||||
|
|
@ -1450,6 +1458,11 @@ int pw_impl_port_recalc_latency(struct pw_impl_port *port)
|
|||
} else {
|
||||
spa_list_for_each(l, &port->links, input_link) {
|
||||
other = l->output;
|
||||
if (other->ignore_latency) {
|
||||
pw_log_debug("port %d: peer %d: peer latency ignored",
|
||||
port->info.id, other->info.id);
|
||||
continue;
|
||||
}
|
||||
spa_latency_info_combine(&latency, &other->latency[other->direction]);
|
||||
pw_log_debug("port %d: peer %d: latency %f-%f %d-%d %"PRIu64"-%"PRIu64,
|
||||
port->info.id, other->info.id,
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@ extern "C" {
|
|||
#define PW_KEY_PORT_EXTRA "port.extra" /**< api specific extra port info, API name
|
||||
* should be prefixed. "jack:flags:56" */
|
||||
#define PW_KEY_PORT_PASSIVE "port.passive" /**< the ports wants passive links, since 0.3.67 */
|
||||
#define PW_KEY_PORT_IGNORE_LATENCY "port.ignore-latency" /**< latency ignored by peers, since 0.3.71 */
|
||||
|
||||
/** link properties */
|
||||
#define PW_KEY_LINK_ID "link.id" /**< a link id */
|
||||
|
|
|
|||
|
|
@ -893,6 +893,7 @@ struct pw_impl_port {
|
|||
|
||||
struct spa_latency_info latency[2]; /**< latencies */
|
||||
unsigned int have_latency_param:1;
|
||||
unsigned int ignore_latency:1;
|
||||
|
||||
void *owner_data; /**< extra owner data */
|
||||
void *user_data; /**< extra user data */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue