mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
node: Add id to set_io
Make it possible to configure multiple io areas on a port by giving an id to set_io. Add some types to enumerate the supported ids Make an area to exchange buffers and one to specify pull ranges. The idea is to make more area types for controlable properties. Implement enumeration of IO areas in volume.
This commit is contained in:
parent
4288a634f4
commit
8efea3e1ea
40 changed files with 583 additions and 208 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include <spa/support/loop.h>
|
||||
#include <spa/support/type-map-impl.h>
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
|
|
@ -49,6 +50,7 @@ struct type {
|
|||
uint32_t props_volume;
|
||||
uint32_t props_min_latency;
|
||||
uint32_t props_live;
|
||||
struct spa_type_io io;
|
||||
struct spa_type_param param;
|
||||
struct spa_type_meta meta;
|
||||
struct spa_type_data data;
|
||||
|
|
@ -70,6 +72,7 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
|
|||
type->props_volume = spa_type_map_get_id(map, SPA_TYPE_PROPS__volume);
|
||||
type->props_min_latency = spa_type_map_get_id(map, SPA_TYPE_PROPS__minLatency);
|
||||
type->props_live = spa_type_map_get_id(map, SPA_TYPE_PROPS__live);
|
||||
spa_type_io_map(map, &type->io);
|
||||
spa_type_param_map(map, &type->param);
|
||||
spa_type_meta_map(map, &type->meta);
|
||||
spa_type_data_map(map, &type->data);
|
||||
|
|
@ -99,7 +102,7 @@ struct data {
|
|||
uint32_t n_support;
|
||||
|
||||
struct spa_node *sink;
|
||||
struct spa_port_io source_sink_io[1];
|
||||
struct spa_io_buffers source_sink_io[1];
|
||||
|
||||
struct spa_node *source;
|
||||
struct spa_buffer *source_buffers[1];
|
||||
|
|
@ -339,10 +342,14 @@ static int negotiate_formats(struct data *data)
|
|||
format)) < 0)
|
||||
return res;
|
||||
|
||||
data->source_sink_io[0] = SPA_PORT_IO_INIT;
|
||||
data->source_sink_io[0] = SPA_IO_BUFFERS_INIT;
|
||||
|
||||
spa_node_port_set_io(data->source, SPA_DIRECTION_OUTPUT, 0, &data->source_sink_io[0]);
|
||||
spa_node_port_set_io(data->sink, SPA_DIRECTION_INPUT, 0, &data->source_sink_io[0]);
|
||||
spa_node_port_set_io(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
data->type.io.Buffers, &data->source_sink_io[0]);
|
||||
spa_node_port_set_io(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
data->type.io.Buffers, &data->source_sink_io[0]);
|
||||
|
||||
if ((res = spa_node_port_set_param(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue