Commit 23b6d2de authored by Ghislain MARY's avatar Ghislain MARY

Add function to know if ICE candidates have been gathered or not.

parent 88f44f13
......@@ -388,6 +388,14 @@ MS2_PUBLIC void ice_session_add_check_list(IceSession *session, IceCheckList *cl
*/
MS2_PUBLIC void ice_session_remove_check_list(IceSession *session, IceCheckList *cl);
/**
* Tell whether ICE local candidates have been gathered for an ICE session or not.
*
* @param session A pointer to a session
* @return TRUE if local candidates have been gathered for the session, FALSE otherwise.
*/
MS2_PUBLIC bool_t ice_session_candidates_gathered(const IceSession *session);
/**
* Gather ICE local candidates for an ICE session.
*
......
......@@ -730,6 +730,18 @@ void ice_session_check_mismatch(IceSession *session)
* CANDIDATES GATHERING *
*****************************************************************************/
static void ice_check_list_candidates_gathered(const IceCheckList *cl, bool_t *result)
{
if (ms_list_size(cl->local_candidates) == 0) *result = FALSE;
}
bool_t ice_session_candidates_gathered(const IceSession *session)
{
bool_t result = TRUE;
ms_list_for_each2(session->streams, (void (*)(void*,void*))ice_check_list_candidates_gathered, &result);
return result;
}
static void ice_check_list_gather_candidates(IceCheckList *cl, Session_Index *si)
{
IceStunServerCheck *check;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment