pipewire/pipewire-jack/src/statistics.c
Barnabás Pőcze 934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00

46 lines
1 KiB
C

/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#include <jack/statistics.h>
SPA_EXPORT
float jack_get_max_delayed_usecs (jack_client_t *client)
{
struct client *c = (struct client *) client;
float res = 0.0f;
spa_return_val_if_fail(c != NULL, 0.0);
if (c->driver_activation)
res = (float)c->driver_activation->max_delay / SPA_USEC_PER_SEC;
pw_log_trace("%p: max delay %f", client, res);
return res;
}
SPA_EXPORT
float jack_get_xrun_delayed_usecs (jack_client_t *client)
{
struct client *c = (struct client *) client;
float res = 0.0f;
spa_return_val_if_fail(c != NULL, 0.0);
if (c->driver_activation)
res = (float)c->driver_activation->xrun_delay / SPA_USEC_PER_SEC;
pw_log_trace("%p: xrun delay %f", client, res);
return res;
}
SPA_EXPORT
void jack_reset_max_delayed_usecs (jack_client_t *client)
{
struct client *c = (struct client *) client;
spa_return_if_fail(c != NULL);
if (c->driver_activation)
c->driver_activation->max_delay = 0;
}