mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
Implement control streams
spa_io_control_range -> spa_io_range Add helpers for sequence and control pod objects Implement control properties in audiotestsrc, update test example.
This commit is contained in:
parent
90c1a95eef
commit
c9526dc2bb
21 changed files with 289 additions and 272 deletions
|
|
@ -69,10 +69,6 @@ struct link {
|
|||
struct spa_buffer **buffers;
|
||||
};
|
||||
|
||||
struct control {
|
||||
struct spa_pod_float *volume;
|
||||
};
|
||||
|
||||
struct impl {
|
||||
struct spa_handle handle;
|
||||
struct spa_node node;
|
||||
|
|
@ -80,7 +76,6 @@ struct impl {
|
|||
struct spa_log *log;
|
||||
|
||||
struct props props;
|
||||
struct control control;
|
||||
|
||||
const struct spa_node_callbacks *callbacks;
|
||||
void *user_data;
|
||||
|
|
@ -653,13 +648,14 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
spa_log_debug(this->log, "set io %d %d %d", id, direction, port_id);
|
||||
|
||||
if (id == SPA_IO_ControlRange)
|
||||
switch (id) {
|
||||
case SPA_IO_Range:
|
||||
res = spa_node_port_set_io(this->resample, direction, 0, id, data, size);
|
||||
// else if (id == t->io_prop_volume)
|
||||
// res = spa_node_port_set_io(this->channelmix, direction, 0, id, data, size);
|
||||
else
|
||||
break;
|
||||
default:
|
||||
res = spa_node_port_set_io(this->fmt[direction], direction, port_id, id, data, size);
|
||||
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ struct port {
|
|||
bool valid;
|
||||
|
||||
struct spa_io_buffers *io;
|
||||
struct spa_io_control_range *ctrl;
|
||||
struct spa_io_range *ctrl;
|
||||
|
||||
struct spa_port_info info;
|
||||
struct spa_dict info_props;
|
||||
|
|
@ -837,7 +837,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
case SPA_IO_Buffers:
|
||||
port->io = data;
|
||||
break;
|
||||
case SPA_IO_ControlRange:
|
||||
case SPA_IO_Range:
|
||||
port->ctrl = data;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ struct port {
|
|||
uint32_t id;
|
||||
|
||||
struct spa_io_buffers *io;
|
||||
struct spa_io_control_range *ctrl;
|
||||
struct spa_io_range *ctrl;
|
||||
|
||||
struct spa_port_info info;
|
||||
|
||||
|
|
@ -787,7 +787,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
case SPA_IO_Buffers:
|
||||
port->io = data;
|
||||
break;
|
||||
case SPA_IO_ControlRange:
|
||||
case SPA_IO_Range:
|
||||
port->ctrl = data;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ struct port {
|
|||
uint32_t id;
|
||||
|
||||
struct spa_io_buffers *io;
|
||||
struct spa_io_control_range *ctrl;
|
||||
struct spa_io_range *ctrl;
|
||||
struct spa_port_info info;
|
||||
|
||||
bool have_format;
|
||||
|
|
@ -623,13 +623,16 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_IO_Buffers)
|
||||
switch (id) {
|
||||
case SPA_IO_Buffers:
|
||||
port->io = data;
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
break;
|
||||
case SPA_IO_Range:
|
||||
port->ctrl = data;
|
||||
else
|
||||
break;
|
||||
default:
|
||||
return -ENOENT;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ struct port {
|
|||
uint32_t id;
|
||||
|
||||
struct spa_io_buffers *io;
|
||||
struct spa_io_control_range *ctrl;
|
||||
struct spa_io_range *ctrl;
|
||||
|
||||
struct spa_port_info info;
|
||||
|
||||
|
|
@ -785,13 +785,16 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_IO_Buffers)
|
||||
switch (id) {
|
||||
case SPA_IO_Buffers:
|
||||
port->io = data;
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
break;
|
||||
case SPA_IO_Range:
|
||||
port->ctrl = data;
|
||||
else
|
||||
break;
|
||||
default:
|
||||
return -ENOENT;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue