mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
alsa-seq: add port latency reporting
This commit is contained in:
parent
cd32404e92
commit
0779862cda
2 changed files with 18 additions and 1 deletions
|
|
@ -411,6 +411,7 @@ static void init_port(struct seq_state *state, struct seq_port *port, const snd_
|
|||
port->params[IDX_IO] = SPA_PARAM_INFO(SPA_PARAM_IO, SPA_PARAM_INFO_READ);
|
||||
port->params[IDX_Format] = SPA_PARAM_INFO(SPA_PARAM_Format, SPA_PARAM_INFO_WRITE);
|
||||
port->params[IDX_Buffers] = SPA_PARAM_INFO(SPA_PARAM_Buffers, 0);
|
||||
port->params[IDX_Latency] = SPA_PARAM_INFO(SPA_PARAM_Latency, SPA_PARAM_INFO_READWRITE);
|
||||
|
||||
port->info.params = port->params;
|
||||
port->info.n_params = N_PORT_PARAMS;
|
||||
|
|
@ -574,6 +575,21 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Latency:
|
||||
switch (result.index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamLatency, id,
|
||||
SPA_PARAM_LATENCY_direction, SPA_POD_Id(direction),
|
||||
SPA_PARAM_LATENCY_quantum, SPA_POD_Float(1.0f),
|
||||
SPA_PARAM_LATENCY_min, SPA_POD_Int(0),
|
||||
SPA_PARAM_LATENCY_max, SPA_POD_Int(0));
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return -ENOENT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ struct seq_port {
|
|||
#define IDX_IO 2
|
||||
#define IDX_Format 3
|
||||
#define IDX_Buffers 4
|
||||
#define N_PORT_PARAMS 5
|
||||
#define IDX_Latency 5
|
||||
#define N_PORT_PARAMS 6
|
||||
struct spa_param_info params[N_PORT_PARAMS];
|
||||
|
||||
struct spa_io_buffers *io;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue