Commit af0fea01 authored by Ghislain MARY's avatar Ghislain MARY

Add function to know if at least one check list of an ICE session has completed successfully.

parent b0f39463
...@@ -372,6 +372,14 @@ MS2_PUBLIC void ice_session_set_keepalive_timeout(IceSession *session, uint8_t t ...@@ -372,6 +372,14 @@ MS2_PUBLIC void ice_session_set_keepalive_timeout(IceSession *session, uint8_t t
*/ */
MS2_PUBLIC int ice_session_nb_check_lists(IceSession *session); MS2_PUBLIC int ice_session_nb_check_lists(IceSession *session);
/**
* Tell whether an ICE session has at least one completed check list.
*
* @param session A pointer to a session
* @return TRUE if the session has at least one completed check list, FALSE otherwise
*/
MS2_PUBLIC bool_t ice_session_has_completed_check_list(const IceSession *session);
/** /**
* Add an ICE check list to an ICE session. * Add an ICE check list to an ICE session.
* *
......
...@@ -704,6 +704,18 @@ int ice_session_nb_check_lists(IceSession *session) ...@@ -704,6 +704,18 @@ int ice_session_nb_check_lists(IceSession *session)
return ms_list_size(session->streams); return ms_list_size(session->streams);
} }
static int ice_find_completed_check_list(const IceCheckList *cl, const void *dummy)
{
return (cl->state != ICL_Completed);
}
bool_t ice_session_has_completed_check_list(const IceSession *session)
{
MSList *elem = ms_list_find_custom(session->streams, (MSCompareFunc)ice_find_completed_check_list, NULL);
if (elem == NULL) return FALSE;
else return TRUE;
}
void ice_session_add_check_list(IceSession *session, IceCheckList *cl) void ice_session_add_check_list(IceSession *session, IceCheckList *cl)
{ {
session->streams = ms_list_append(session->streams, cl); session->streams = ms_list_append(session->streams, cl);
......
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