diff --git a/pipewire-jack b/pipewire-jack index eef8bc593..1108c5d83 160000 --- a/pipewire-jack +++ b/pipewire-jack @@ -1 +1 @@ -Subproject commit eef8bc593c69a5d53e91e7f03a25debff332887d +Subproject commit 1108c5d83d2f105f6976a6edd79efa348b688d23 diff --git a/spa/include/spa/node/node.h b/spa/include/spa/node/node.h index 92f7432f3..be1bd9d9d 100644 --- a/spa/include/spa/node/node.h +++ b/spa/include/spa/node/node.h @@ -47,8 +47,15 @@ struct spa_node; * Contains the basic node information. */ struct spa_node_info { -#define SPA_NODE_CHANGE_MASK_PROPS (1<<0) + uint32_t max_input_ports; + uint32_t max_output_ports; +#define SPA_NODE_CHANGE_MASK_FLAGS (1u<<0) +#define SPA_NODE_CHANGE_MASK_PROPS (1u<<1) uint64_t change_mask; +#define SPA_NODE_FLAG_DYNAMIC_INPUT_PORTS (1u<<0) /**< input ports can be added/removed */ +#define SPA_NODE_FLAG_DYNAMIC_OUTPUT_PORTS (1u<<1) /**< output ports can be added/removed */ +#define SPA_NODE_FLAG_RT (1u<<2) /**< node can do real-time processing */ + uint32_t flags; struct spa_dict *props; }; @@ -60,25 +67,25 @@ struct spa_node_info { * Contains the basic port information. */ struct spa_port_info { -#define SPA_PORT_CHANGE_MASK_FLAGS (1<<0) -#define SPA_PORT_CHANGE_MASK_RATE (1<<1) -#define SPA_PORT_CHANGE_MASK_PROPS (1<<2) +#define SPA_PORT_CHANGE_MASK_FLAGS (1u<<0) +#define SPA_PORT_CHANGE_MASK_RATE (1u<<1) +#define SPA_PORT_CHANGE_MASK_PROPS (1u<<2) uint64_t change_mask; -#define SPA_PORT_INFO_FLAG_REMOVABLE (1<<0) /**< port can be removed */ -#define SPA_PORT_INFO_FLAG_OPTIONAL (1<<1) /**< processing on port is optional */ -#define SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS (1<<2) /**< the port can allocate buffer data */ -#define SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS (1<<3) /**< the port can use a provided buffer */ -#define SPA_PORT_INFO_FLAG_IN_PLACE (1<<4) /**< the port can process data in-place and +#define SPA_PORT_FLAG_REMOVABLE (1u<<0) /**< port can be removed */ +#define SPA_PORT_FLAG_OPTIONAL (1u<<1) /**< processing on port is optional */ +#define SPA_PORT_FLAG_CAN_ALLOC_BUFFERS (1u<<2) /**< the port can allocate buffer data */ +#define SPA_PORT_FLAG_CAN_USE_BUFFERS (1u<<3) /**< the port can use a provided buffer */ +#define SPA_PORT_FLAG_IN_PLACE (1u<<4) /**< the port can process data in-place and * will need a writable input buffer */ -#define SPA_PORT_INFO_FLAG_NO_REF (1<<5) /**< the port does not keep a ref on the buffer */ -#define SPA_PORT_INFO_FLAG_LIVE (1<<6) /**< output buffers from this port are +#define SPA_PORT_FLAG_NO_REF (1u<<5) /**< the port does not keep a ref on the buffer */ +#define SPA_PORT_FLAG_LIVE (1u<<6) /**< output buffers from this port are * timestamped against a live clock. */ -#define SPA_PORT_INFO_FLAG_PHYSICAL (1<<7) /**< connects to some device */ -#define SPA_PORT_INFO_FLAG_TERMINAL (1<<8) /**< data was not created from this port +#define SPA_PORT_FLAG_PHYSICAL (1u<<7) /**< connects to some device */ +#define SPA_PORT_FLAG_TERMINAL (1u<<8) /**< data was not created from this port * or will not be made available on another * port */ -#define SPA_PORT_INFO_FLAG_DYNAMIC_DATA (1<<9) /**< data pointer on buffers can be changed */ +#define SPA_PORT_FLAG_DYNAMIC_DATA (1u<<9) /**< data pointer on buffers can be changed */ uint32_t flags; /**< port flags */ uint32_t rate; /**< rate of sequence numbers on port */ const struct spa_dict *props; /**< extra port properties */ diff --git a/spa/plugins/alsa/alsa-sink.c b/spa/plugins/alsa/alsa-sink.c index 0e64b7432..6d5d8fcfa 100644 --- a/spa/plugins/alsa/alsa-sink.c +++ b/spa/plugins/alsa/alsa-sink.c @@ -248,6 +248,7 @@ static void emit_node_info(struct state *this) struct spa_node_info info; info = SPA_NODE_INFO_INIT(); + info.max_input_ports = 1; info.change_mask = SPA_NODE_CHANGE_MASK_PROPS; info.props = &SPA_DICT_INIT_ARRAY(node_info_items); @@ -718,10 +719,10 @@ impl_init(const struct spa_handle_factory *factory, this->info = SPA_PORT_INFO_INIT(); this->info.change_mask |= SPA_PORT_CHANGE_MASK_FLAGS; - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_LIVE | - SPA_PORT_INFO_FLAG_PHYSICAL | - SPA_PORT_INFO_FLAG_TERMINAL; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_LIVE | + SPA_PORT_FLAG_PHYSICAL | + SPA_PORT_FLAG_TERMINAL; spa_list_init(&this->ready); diff --git a/spa/plugins/alsa/alsa-source.c b/spa/plugins/alsa/alsa-source.c index 33e451a58..6e3f6707f 100644 --- a/spa/plugins/alsa/alsa-source.c +++ b/spa/plugins/alsa/alsa-source.c @@ -249,6 +249,7 @@ static void emit_node_info(struct state *this) struct spa_node_info info; info = SPA_NODE_INFO_INIT(); + info.max_output_ports = 1; info.change_mask = SPA_NODE_CHANGE_MASK_PROPS; info.props = &SPA_DICT_INIT_ARRAY(node_info_items); @@ -731,10 +732,10 @@ impl_init(const struct spa_handle_factory *factory, this->info = SPA_PORT_INFO_INIT(); this->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_LIVE | - SPA_PORT_INFO_FLAG_PHYSICAL | - SPA_PORT_INFO_FLAG_TERMINAL; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_LIVE | + SPA_PORT_FLAG_PHYSICAL | + SPA_PORT_FLAG_TERMINAL; spa_list_init(&this->free); spa_list_init(&this->ready); diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 377c1576f..ab18d5feb 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -284,9 +284,9 @@ static int negotiate_link_buffers(struct impl *this, struct link *link) spa_pod_fixate(param); in_alloc = SPA_FLAG_CHECK(link->in_flags, - SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS); + SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); out_alloc = SPA_FLAG_CHECK(link->out_flags, - SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS); + SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); flags = 0; if (out_alloc || in_alloc) { diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index b5682f996..40069a73f 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -1193,7 +1193,7 @@ impl_init(const struct spa_handle_factory *factory, port->id = 0; port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; spa_list_init(&port->queue); port = GET_IN_PORT(this, 0); @@ -1201,7 +1201,7 @@ impl_init(const struct spa_handle_factory *factory, port->id = 0; port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; spa_list_init(&port->queue); props_reset(&this->props); diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index 288aac568..b67837188 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -951,8 +951,8 @@ impl_init(const struct spa_handle_factory *factory, if (this->cpu) this->cpu_flags = spa_cpu_get_flags(this->cpu); - init_port(this, SPA_DIRECTION_OUTPUT, 0, SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS); - init_port(this, SPA_DIRECTION_INPUT, 0, SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS); + init_port(this, SPA_DIRECTION_OUTPUT, 0, SPA_PORT_FLAG_CAN_USE_BUFFERS); + init_port(this, SPA_DIRECTION_INPUT, 0, SPA_PORT_FLAG_CAN_USE_BUFFERS); props_reset(&this->props); diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index 33fc14ac8..fa8316c65 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -117,6 +117,8 @@ static void emit_node_info(struct impl *this) { if (this->callbacks && this->callbacks->info) { struct spa_node_info info = SPA_NODE_INFO_INIT(); + info.max_input_ports = MAX_PORTS; + info.max_output_ports = MAX_PORTS+1; info.change_mask = 0; this->callbacks->info(this->user_data, &info); } @@ -142,7 +144,7 @@ static int init_port(struct impl *this, enum spa_direction direction, uint32_t p port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_PROPS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; port->info_props_items[n_items++] = SPA_DICT_ITEM_INIT("port.dsp", "32 bit float mono audio"); port->info_props_items[n_items++] = SPA_DICT_ITEM_INIT("port.channel", port->position); if (direction == SPA_DIRECTION_OUTPUT) @@ -1043,7 +1045,7 @@ impl_init(const struct spa_handle_factory *factory, port->id = 0; port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; spa_list_init(&port->queue); return 0; diff --git a/spa/plugins/audioconvert/resample.c b/spa/plugins/audioconvert/resample.c index 65994f5a3..1b70fa6ca 100644 --- a/spa/plugins/audioconvert/resample.c +++ b/spa/plugins/audioconvert/resample.c @@ -885,7 +885,7 @@ impl_init(const struct spa_handle_factory *factory, port->id = 0; port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; spa_list_init(&port->queue); port = GET_IN_PORT(this, 0); @@ -893,7 +893,7 @@ impl_init(const struct spa_handle_factory *factory, port->id = 0; port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; spa_list_init(&port->queue); props_reset(&this->props); diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index ce91830c7..254a03209 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -115,6 +115,8 @@ static void emit_node_info(struct impl *this) { if (this->callbacks && this->callbacks->info) { struct spa_node_info info = SPA_NODE_INFO_INIT(); + info.max_input_ports = 1; + info.max_output_ports = MAX_PORTS; info.change_mask = 0; this->callbacks->info(this->user_data, &info); } @@ -139,7 +141,7 @@ static int init_port(struct impl *this, enum spa_direction direction, port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_PROPS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; port->info_props_items[0] = SPA_DICT_ITEM_INIT("port.dsp", "32 bit float mono audio"); port->info_props_items[1] = SPA_DICT_ITEM_INIT("port.channel", port->position); port->info_props = SPA_DICT_INIT(port->info_props_items, 2); @@ -972,7 +974,7 @@ impl_init(const struct spa_handle_factory *factory, port->id = 0; port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; return 0; } diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index f86cd63ad..e94ed657f 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -223,10 +223,10 @@ static int impl_node_add_port(struct spa_node *node, enum spa_direction directio spa_list_init(&port->queue); port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_REMOVABLE | - SPA_PORT_INFO_FLAG_OPTIONAL | - SPA_PORT_INFO_FLAG_IN_PLACE; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_REMOVABLE | + SPA_PORT_FLAG_OPTIONAL | + SPA_PORT_FLAG_IN_PLACE; this->port_count++; if (this->last_port <= port_id) @@ -926,8 +926,8 @@ impl_init(const struct spa_handle_factory *factory, port->valid = true; port->direction = SPA_DIRECTION_OUTPUT; port->id = 0; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_NO_REF; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_NO_REF; spa_list_init(&port->queue); spa_audiomixer_get_ops(&this->ops); diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index 3da2686b4..5d94dc8a0 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -261,9 +261,9 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag SPA_PROP_volume, SPA_POD_OPT_Float(&p->volume)); if (p->live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; else - this->info.flags &= ~SPA_PORT_INFO_FLAG_LIVE; + this->info.flags &= ~SPA_PORT_FLAG_LIVE; } else return -ENOENT; @@ -454,6 +454,7 @@ static void emit_node_info(struct impl *this) struct spa_node_info info; info = SPA_NODE_INFO_INIT(); + info.max_output_ports = 1; info.change_mask = SPA_NODE_CHANGE_MASK_PROPS; info.props = &SPA_DICT_INIT_ARRAY(node_info_items); @@ -1021,9 +1022,9 @@ impl_init(const struct spa_handle_factory *factory, this->info = SPA_PORT_INFO_INIT(); this->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | SPA_PORT_INFO_FLAG_NO_REF; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | SPA_PORT_FLAG_NO_REF; if (this->props.live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; spa_log_info(this->log, NAME " %p: initialized", this); diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index 7006c0a5c..9ba8f2e37 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -852,6 +852,7 @@ static void emit_node_info(struct impl *this) struct spa_node_info info; info = SPA_NODE_INFO_INIT(); + info.max_input_ports = 1; info.change_mask = SPA_NODE_CHANGE_MASK_PROPS; info.props = &SPA_DICT_INIT_ARRAY(node_info_items); @@ -1079,7 +1080,7 @@ static int port_set_format(struct spa_node *node, } if (this->have_format) { - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | SPA_PORT_INFO_FLAG_LIVE; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | SPA_PORT_FLAG_LIVE; this->info.rate = this->current_format.info.raw.rate; } @@ -1329,7 +1330,9 @@ impl_init(const struct spa_handle_factory *factory, this->node = impl_node; reset_props(&this->props); - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + this->info = SPA_PORT_INFO_INIT(); + this->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; spa_list_init(&this->ready); diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index 8bdc7d84c..ec1098638 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -170,9 +170,9 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag SPA_PROP_live, SPA_POD_OPT_Bool(&this->props.live)); if (this->props.live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; else - this->info.flags &= ~SPA_PORT_INFO_FLAG_LIVE; + this->info.flags &= ~SPA_PORT_FLAG_LIVE; break; default: @@ -756,9 +756,9 @@ impl_init(const struct spa_handle_factory *factory, this->info = SPA_PORT_INFO_INIT(); this->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | SPA_PORT_INFO_FLAG_NO_REF; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | SPA_PORT_FLAG_NO_REF; if (this->props.live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; spa_log_info(this->log, NAME " %p: initialized", this); diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index a8786228d..719603e16 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -185,9 +185,9 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag SPA_PROP_patternType, SPA_POD_OPT_Id(&p->pattern)); if (p->live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; else - this->info.flags &= ~SPA_PORT_INFO_FLAG_LIVE; + this->info.flags &= ~SPA_PORT_FLAG_LIVE; break; } default: @@ -791,9 +791,9 @@ impl_init(const struct spa_handle_factory *factory, this->info = SPA_PORT_INFO_INIT(); this->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | SPA_PORT_INFO_FLAG_NO_REF; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | SPA_PORT_FLAG_NO_REF; if (this->props.live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; spa_log_info(this->log, NAME " %p: initialized", this); diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index e995620dd..626dbd9fe 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -338,6 +338,7 @@ static void emit_node_info(struct impl *this) struct spa_node_info info; info = SPA_NODE_INFO_INIT(); + info.max_output_ports = 1; info.change_mask = SPA_NODE_CHANGE_MASK_PROPS; info.props = &SPA_DICT_INIT_ARRAY(info_items); @@ -968,9 +969,9 @@ impl_init(const struct spa_handle_factory *factory, spa_list_init(&port->queue); port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_LIVE | - SPA_PORT_INFO_FLAG_PHYSICAL | - SPA_PORT_INFO_FLAG_TERMINAL; + port->info.flags = SPA_PORT_FLAG_LIVE | + SPA_PORT_FLAG_PHYSICAL | + SPA_PORT_FLAG_TERMINAL; port->export_buf = true; port->have_query_ext_ctrl = true; diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index 46b41c5d6..637e798ac 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -914,11 +914,11 @@ static int spa_v4l2_set_format(struct impl *this, struct spa_video_info *format, port->fmt = fmt; port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_RATE; - port->info.flags = (port->export_buf ? SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS : 0) | - SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_LIVE | - SPA_PORT_INFO_FLAG_PHYSICAL | - SPA_PORT_INFO_FLAG_TERMINAL; + port->info.flags = (port->export_buf ? SPA_PORT_FLAG_CAN_ALLOC_BUFFERS : 0) | + SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_LIVE | + SPA_PORT_FLAG_PHYSICAL | + SPA_PORT_FLAG_TERMINAL; port->info.rate = streamparm.parm.capture.timeperframe.denominator; if (this->callbacks && this->callbacks->port_info) this->callbacks->port_info(this->callbacks_data, SPA_DIRECTION_OUTPUT, 0, &port->info); diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index 4f1318363..851fd6c81 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -234,9 +234,9 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag SPA_PROP_patternType, SPA_POD_OPT_Int(&p->pattern)); if (p->live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; else - this->info.flags &= ~SPA_PORT_INFO_FLAG_LIVE; + this->info.flags &= ~SPA_PORT_FLAG_LIVE; break; } default: @@ -398,6 +398,7 @@ static void emit_node_info(struct impl *this) struct spa_node_info info; info = SPA_NODE_INFO_INIT(); + info.max_output_ports = 1; info.change_mask = SPA_NODE_CHANGE_MASK_PROPS; info.props = &SPA_DICT_INIT_ARRAY(node_info_items); @@ -897,9 +898,9 @@ impl_init(const struct spa_handle_factory *factory, this->info = SPA_PORT_INFO_INIT(); this->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - this->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | SPA_PORT_INFO_FLAG_NO_REF; + this->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | SPA_PORT_FLAG_NO_REF; if (this->props.live) - this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; + this->info.flags |= SPA_PORT_FLAG_LIVE; spa_log_info(this->log, NAME " %p: initialized", this); diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index a3625a88f..cb5ca6d24 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -811,15 +811,15 @@ impl_init(const struct spa_handle_factory *factory, port = GET_IN_PORT(this, 0); port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_IN_PLACE; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_IN_PLACE; spa_list_init(&port->empty); port = GET_OUT_PORT(this, 0); port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_NO_REF; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_NO_REF; spa_list_init(&port->empty); return 0; diff --git a/spa/tools/spa-inspect.c b/spa/tools/spa-inspect.c index 7f7a71e84..0520bfeb3 100644 --- a/spa/tools/spa-inspect.c +++ b/spa/tools/spa-inspect.c @@ -139,6 +139,10 @@ inspect_port_params(struct data *data, struct spa_node *node, static void node_info(void *_data, const struct spa_node_info *info) { struct data *data = _data; + + printf("max input ports: %u\n", info->max_input_ports); + printf("max output ports: %u\n", info->max_output_ports); + if (info->change_mask & SPA_NODE_CHANGE_MASK_PROPS) { printf("node properties:\n"); spa_debug_dict(2, info->props); diff --git a/src/examples/export-sink.c b/src/examples/export-sink.c index 164e8df38..0f65dcc8d 100644 --- a/src/examples/export-sink.c +++ b/src/examples/export-sink.c @@ -146,7 +146,7 @@ static int impl_set_callbacks(struct spa_node *node, info = SPA_PORT_INFO_INIT(); info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; d->callbacks->port_info(d->callbacks_data, SPA_DIRECTION_INPUT, 0, &info); } diff --git a/src/examples/export-source.c b/src/examples/export-source.c index b283d34fc..e033a5307 100644 --- a/src/examples/export-source.c +++ b/src/examples/export-source.c @@ -113,7 +113,7 @@ static int impl_set_callbacks(struct spa_node *node, info = SPA_PORT_INFO_INIT(); info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_PROPS; - info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; port_items[0] = SPA_DICT_ITEM_INIT("port.dsp", "32 bit float mono audio"); info.props = &SPA_DICT_INIT_ARRAY(port_items); diff --git a/src/examples/local-v4l2.c b/src/examples/local-v4l2.c index 9465d6f5a..c2c66d611 100644 --- a/src/examples/local-v4l2.c +++ b/src/examples/local-v4l2.c @@ -101,7 +101,7 @@ static int impl_set_callbacks(struct spa_node *node, info = SPA_PORT_INFO_INIT(); info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; d->callbacks->port_info(d->callbacks_data, SPA_DIRECTION_INPUT, 0, &info); } diff --git a/src/modules/module-audio-dsp/floatmix.c b/src/modules/module-audio-dsp/floatmix.c index 4b58c88b5..87ba1839f 100644 --- a/src/modules/module-audio-dsp/floatmix.c +++ b/src/modules/module-audio-dsp/floatmix.c @@ -216,10 +216,10 @@ static int impl_node_add_port(struct spa_node *node, enum spa_direction directio spa_list_init(&port->queue); port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_REMOVABLE | - SPA_PORT_INFO_FLAG_OPTIONAL | - SPA_PORT_INFO_FLAG_IN_PLACE; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_REMOVABLE | + SPA_PORT_FLAG_OPTIONAL | + SPA_PORT_FLAG_IN_PLACE; this->port_count++; if (this->last_port <= port_id) @@ -891,8 +891,8 @@ impl_init(const struct spa_handle_factory *factory, port->id = 0; port->info = SPA_PORT_INFO_INIT(); port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - port->info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS | - SPA_PORT_INFO_FLAG_NO_REF; + port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | + SPA_PORT_FLAG_NO_REF; spa_list_init(&port->queue); return 0; diff --git a/src/modules/module-client-node/client-stream.c b/src/modules/module-client-node/client-stream.c index 3c79df91a..6edc10a7b 100644 --- a/src/modules/module-client-node/client-stream.c +++ b/src/modules/module-client-node/client-stream.c @@ -538,8 +538,8 @@ static int negotiate_buffers(struct impl *impl) in_flags = impl->client_port->spa_flags; out_flags = impl->adapter_mix_flags; - in_alloc = SPA_FLAG_CHECK(in_flags, SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS); - out_alloc = SPA_FLAG_CHECK(out_flags, SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS); + in_alloc = SPA_FLAG_CHECK(in_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); + out_alloc = SPA_FLAG_CHECK(out_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); flags = 0; if (out_alloc || in_alloc) { diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index 48913bef8..1fd94dcce 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -443,7 +443,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32 pi.flags = port->spa_flags; pi.rate = 0; pi.props = &port->properties->dict; - pi.flags &= ~SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS; + pi.flags &= ~SPA_PORT_FLAG_CAN_ALLOC_BUFFERS; } pw_client_node_proxy_port_update(data->node_proxy, diff --git a/src/pipewire/link.c b/src/pipewire/link.c index e4d61adf2..fd3dd4c77 100644 --- a/src/pipewire/link.c +++ b/src/pipewire/link.c @@ -564,23 +564,23 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s in_flags = input->spa_flags; out_flags = output->spa_flags; - if (out_flags & SPA_PORT_INFO_FLAG_LIVE) { + if (out_flags & SPA_PORT_FLAG_LIVE) { pw_log_debug("setting link as live"); output->node->live = true; input->node->live = true; } if (output->allocation.n_buffers) { - out_flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; - in_flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + out_flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; + in_flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; move_allocation(&output->allocation, &allocation); pw_log_debug("link %p: reusing %d output buffers %p", this, allocation.n_buffers, allocation.buffers); } else if (input->allocation.n_buffers && input->mix == NULL) { - out_flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; - in_flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + out_flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; + in_flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; move_allocation(&input->allocation, &allocation); @@ -643,8 +643,8 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s /* when one of the ports can allocate buffer memory, set the minsize to * 0 to make sure we don't allocate memory in the shared memory */ - if ((in_flags & SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS) || - (out_flags & SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS)) { + if ((in_flags & SPA_PORT_FLAG_CAN_ALLOC_BUFFERS) || + (out_flags & SPA_PORT_FLAG_CAN_ALLOC_BUFFERS)) { minsize = 0; } @@ -667,7 +667,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s pw_log_debug("link %p: allocating %d buffers %p %zd %zd", this, allocation.n_buffers, allocation.buffers, minsize, stride); - if (out_flags & SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS) { + if (out_flags & SPA_PORT_FLAG_CAN_ALLOC_BUFFERS) { if ((res = pw_port_alloc_buffers(output, this->rt.out_mix.port.port_id, params, n_params, @@ -680,12 +680,12 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s pw_work_queue_add(impl->work, output->node, res, complete_paused, &this->rt.out_mix); - out_flags &= ~SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + out_flags &= ~SPA_PORT_FLAG_CAN_USE_BUFFERS; move_allocation(&allocation, &output->allocation); pw_log_debug("link %p: allocated %d buffers %p from output port", this, allocation.n_buffers, allocation.buffers); - } else if (in_flags & SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS) { + } else if (in_flags & SPA_PORT_FLAG_CAN_ALLOC_BUFFERS) { if ((res = pw_port_alloc_buffers(input, this->rt.in_mix.port.port_id, params, n_params, @@ -698,13 +698,13 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s pw_work_queue_add(impl->work, input->node, res, complete_paused, &this->rt.in_mix); - in_flags &= ~SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + in_flags &= ~SPA_PORT_FLAG_CAN_USE_BUFFERS; pw_log_debug("link %p: allocated %d buffers %p from input port", this, allocation.n_buffers, allocation.buffers); } } - if (out_flags & SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS) { + if (out_flags & SPA_PORT_FLAG_CAN_USE_BUFFERS) { pw_log_debug("link %p: using %d buffers %p on output port", this, allocation.n_buffers, allocation.buffers); if ((res = pw_port_use_buffers(output, @@ -722,7 +722,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s move_allocation(&allocation, &output->allocation); } - if (in_flags & SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS) { + if (in_flags & SPA_PORT_FLAG_CAN_USE_BUFFERS) { pw_log_debug("link %p: using %d buffers %p on input port", this, allocation.n_buffers, allocation.buffers); if ((res = pw_port_use_buffers(input, diff --git a/src/pipewire/node.c b/src/pipewire/node.c index 3fc527822..b4503292f 100644 --- a/src/pipewire/node.c +++ b/src/pipewire/node.c @@ -780,6 +780,8 @@ int pw_node_update_properties(struct pw_node *node, const struct spa_dict *dict) static void node_info(void *data, const struct spa_node_info *info) { struct pw_node *node = data; + node->info.max_input_ports = info->max_input_ports; + node->info.max_output_ports = info->max_output_ports; if (info->change_mask & SPA_NODE_CHANGE_MASK_PROPS) pw_node_update_properties(node, info->props); } diff --git a/src/pipewire/port.c b/src/pipewire/port.c index d53c05360..fe1f9344f 100644 --- a/src/pipewire/port.c +++ b/src/pipewire/port.c @@ -264,9 +264,9 @@ struct pw_port *pw_port_new(enum pw_direction direction, if (properties == NULL) goto no_mem; - if (SPA_FLAG_CHECK(spa_flags, SPA_PORT_INFO_FLAG_PHYSICAL)) + if (SPA_FLAG_CHECK(spa_flags, SPA_PORT_FLAG_PHYSICAL)) pw_properties_set(properties, "port.physical", "1"); - if (SPA_FLAG_CHECK(spa_flags, SPA_PORT_INFO_FLAG_TERMINAL)) + if (SPA_FLAG_CHECK(spa_flags, SPA_PORT_FLAG_TERMINAL)) pw_properties_set(properties, "port.terminal", "1"); this->direction = direction; diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 9e66bb4b5..da9fb1c88 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -319,7 +319,7 @@ static void emit_port_info(struct stream *d) struct spa_port_info info; info = SPA_PORT_INFO_INIT(); info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; - info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS; + info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS; d->callbacks->port_info(d->callbacks_data, d->direction, 0, &info); } }