Add async wrapper around nice_agent_gather_candidates()
@pwithnall
Submitted by Philip Withnall Assigned to Philip Withnall @pwithnall
Description
(Migrated from Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84187)
0001-agent-Add-an-asychronous-version-of-nice_agent_gathe.patch
agent: Add an asychronous version of nice_agent_gather_candidates()
WIP patch attached to add a GIO-style asynchronous wrapper around the libnice candidate gathering and connection establishment process.
This does everything from nice_agent_gather_candidates() through to adding remote candidates and TURN servers, and establishing a TCP or UDP connection, at which point the asynchronous task completes.
It does not handle emitting local candidates or adding remote candidates (though it has API which must be notified when the final remote candidate has been added to the NiceAgent). It also does not handle local or remote credentials.
I wonder if it would be a good idea to incorporate those into the API as callbacks (which would be guaranteed to be emitted in the GTask’s main context, to avoid the g_main_context_invoke() dance which we have to do internally).
For this reason, I’m declaring the API in this patch as a work in progress, and feedback would be greatly appreciated.
Basically I hope this new API can become the default all-in-one easy way to use libnice, and the existing API can be reserved for more advanced use cases.
http://cgit.collabora.com/git/user/pwith/libnice.git/log/?h=async-gather-candidates
There are a few comments about what work still needs to be done in the commit message. I don’t currently have time to finish this off, but it’s close — the biggest remaining task is unit testing. :-(