WpSiAdapter
This MR delays the configuration of port format until 2 nodes are linked. The following changes have been done:
- Renamed
WpPortInfo
interface toWpLinkable
- Added new
WpSiAdapter
interface with an API to set and get the session item port format - Implemented such
WpSiAdapter
interface in bothsi-audio-adapter
andsi-audio-endpoint
session items. Thesi-node
session item does not implement the interface because it is not possible to set format in video nodes. - There is a
wp_si_adapter_is_format_activable()
API inWpSiAdapter
, which is used bysi-standard-link
to determine which linkable item needs to be configured with a different/new format. - The
si-audio-endpoint
always return FALSE whenwp_si_adapter_is_format_activable()
is called, and never sets the format when the endpoint is activated. On the other hand, if using asi-audio-adapter
, it will return TRUE if the node is a device node (and the item will automatically configure the ports with a sensible audio format on activation), or FALSE if the node is a client node (and the item won't configure ports on activation). - The linking logic in
si-standard-link
has been improved in the following way:- If both
In
andOut
items are not adapters, just get the ports and create links like before (Used for video nodes) - If both
In
andOut
items areWpSiAdapter
, checkwp_si_adapter_is_format_activable()
return value in both items:- If value is FALSE in
In
item, and TRUE inOut
item, configureIn
format usingOut
format, and then create the links (used for audio capture cases between client node and device node). - If value is FALSE in
Out
item, and TRUE inIn
item, configureOut
format usingIn
format, and then create the links (used for audio playback cases between client node and device node) - If both
In
andOut
item values are TRUE, check if both formats are the same:- If both formats are the same, don't configure anything and just link nodes (used when linking 2 device nodes with same format)
- If formats are not the same, configure
In
item withOut
format, and then create the links (usually used when linking 2 device nodes with different format)
- If both values are FALSE, configure
Out
andIn
node withOut
default format, and create links (usually used when linking 2 client nodes)
- If value is FALSE in
- If one item is an adapter, and the other item is not an adapter, throw an activation error and don't link anything
- If both
Edited by Julian Bouzas