node: clarify port_set_io and SPA_IO_Buffers

port_set_io with SPA_IO_Buffer can be used to enable/disable a port
when the node is running and so the node should make sure the io update
is synchronized with the processing loop.

Use spa_loop_invoke to make sure the mixers handle the port_io updates
correctly.

Setting buffers or a format also needs the port to be disabled so add
some checks for this in the mixers.
This commit is contained in:
Wim Taymans 2023-09-11 11:23:25 +02:00
parent 9c834427c6
commit 69d431acd4
4 changed files with 104 additions and 10 deletions

View file

@ -485,7 +485,9 @@ struct spa_node_methods {
*
* When \a param is NULL, the parameter will be unset.
*
* This function must be called from the main thread.
* This function must be called from the main thread. The node muse be paused
* or the port SPA_IO_Buffers area is NULL when this function is called with
* a param that changes the processing state (like a format change).
*
* \param node a struct \ref spa_node
* \param direction a enum \ref spa_direction
@ -540,7 +542,8 @@ struct spa_node_methods {
* When this function returns async, use the spa_node_sync operation to
* wait for completion.
*
* This function must be called from the main thread.
* This function must be called from the main thread. The node muse be paused
* or the port SPA_IO_Buffers area is NULL when this function is called.
*
* \param object an object implementing the interface
* \param direction a port direction
@ -566,6 +569,11 @@ struct spa_node_methods {
*
* This function must be called from the main thread.
*
* This function can be called when the node is running and the node
* must be prepared to handle changes in io areas while running. This
* is normally done by synchronizing the port io updates with the
* data processing loop.
*
* \param direction a spa_direction
* \param port_id a port id
* \param id the id of the io area, the available ids can be