set controlling to a value reflecting who initiated the connection
Submitted by Fabrice Bellet
Assigned to Olivier Crête @ocrete
Link to original bug (#101542)
Description
Hi!
In the current implementation of tp-farstream, in got_stream_media_properties(), both peers using this same code will always be created with a controlling value of zero, which is suboptimal because this will cause some unnecessary role conflict stun requests before converging to a distinct role for both peers with the nice transmitter.
Would it be possible to make a guess based for example on the stream flow status, to find which peer initiated the connection, and set controlling=true for it?
For example testing "(self->receiving_state == TP_STREAM_FLOW_STATE_PENDING_START) " ? The difficulty (or not a difficulty maybe) is that the second stream will use the nice agent created for the first stream, so only the state of the first stream is really needed to establish the controlling/controlled role of the nice agent.
Version: git master