node: Add port_info event

Add a port_info event. With this, we get updates to ports pushed to
us, which is more convenient and also allows for better dynamic
add/remove of ports.
We don't need to the PortChanged event anymore
We can remove the get_port_ids/get_n_ports/port_get_info methods.
Update plugins
This commit is contained in:
Wim Taymans 2019-02-14 17:08:46 +01:00
parent 3c78036a97
commit 21957e9e8d
37 changed files with 1068 additions and 2288 deletions

View file

@ -913,12 +913,15 @@ static int spa_v4l2_set_format(struct impl *this, struct spa_video_info *format,
port->rate.num = framerate->denom = streamparm.parm.capture.timeperframe.numerator;
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.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);
return 0;
}