Commit b69d0fae authored by Ghislain MARY's avatar Ghislain MARY

Add accessor functions.

parent aa635443
......@@ -269,6 +269,14 @@ MS2_PUBLIC const char * ice_session_remote_ufrag(const IceSession *session);
*/
MS2_PUBLIC const char * ice_session_remote_pwd(const IceSession *session);
/**
* Gte the role of the agent for an ICE session.
*
* @param session A pointer to a session
* @return The role of the agent for the session
*/
MS2_PUBLIC IceRole ice_session_role(IceSession *session);
/**
* Set the role of the agent for an ICE session.
*
......@@ -384,6 +392,14 @@ MS2_PUBLIC void ice_check_list_set_remote_credentials(IceCheckList *cl, const ch
*/
MS2_PUBLIC const IceCandidate * ice_check_list_default_local_candidate(const IceCheckList *cl);
/**
* Get the nominated valid local candidate for an ICE check list.
*
* @param cl A pointer to a check list
* @return A pointer to the nominated valid local candidate for the check list if found, NULL otherwise
*/
MS2_PUBLIC const IceCandidate * ice_check_list_nominated_valid_local_candidate(const IceCheckList *cl);
/**
* Get the candidate type as a string.
*
......
......@@ -388,6 +388,18 @@ const IceCandidate * ice_check_list_default_local_candidate(const IceCheckList *
return candidate;
}
const IceCandidate * ice_check_list_nominated_valid_local_candidate(const IceCheckList *cl)
{
IceCandidate *candidate = NULL;
uint16_t componentID = 1;
MSList *elem = ms_list_find_custom(cl->valid_list, (MSCompareFunc)ice_find_nominated_valid_pair_from_componentID, &componentID);
if (elem != NULL) {
IceValidCandidatePair *valid_pair = (IceValidCandidatePair *)elem->data;
candidate = valid_pair->valid->local;
}
return candidate;
}
static void ice_check_list_queue_triggered_check(IceCheckList *cl, IceCandidatePair *pair)
{
MSList *elem = ms_list_find(cl->triggered_checks_queue, pair);
......@@ -462,6 +474,11 @@ static void ice_session_compute_pair_priorities(IceSession *session)
ms_list_for_each(session->streams, (void (*)(void*))ice_check_list_compute_pair_priorities);
}
IceRole ice_session_role(IceSession *session)
{
return session->role;
}
void ice_session_set_role(IceSession *session, IceRole role)
{
if (session->role != role) {
......
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