Commit 97187262 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Specify if an ICE remote candidate is the default one when adding it.

parent 4ddad2d7
......@@ -463,10 +463,11 @@ MS2_PUBLIC IceCandidate * ice_add_local_candidate(IceCheckList *cl, const char *
* @param componentID The component ID of the remote candidate (usually 1 for RTP and 2 for RTCP)
* @param priority The priority of the remote candidate
* @param foundation The foundation of the remote candidate
* @param is_default Boolean value telling whether the remote candidate is a default candidate or not
*
* This function is to be called once the remote candidate list has been received via SDP.
*/
MS2_PUBLIC IceCandidate * ice_add_remote_candidate(IceCheckList *cl, const char *type, const char *ip, int port, uint16_t componentID, uint32_t priority, const char * const foundation);
MS2_PUBLIC IceCandidate * ice_add_remote_candidate(IceCheckList *cl, const char *type, const char *ip, int port, uint16_t componentID, uint32_t priority, const char * const foundation, bool_t is_default);
/**
* Add a losing pair to an ICE check list.
......
......@@ -952,7 +952,7 @@ static IceCandidate * ice_learn_peer_reflexive_candidate(IceCheckList *cl, const
/* Add peer reflexive candidate to the remote candidates list. */
memset(foundation, '\0', sizeof(foundation));
ice_generate_arbitrary_foundation(foundation, sizeof(foundation), cl->remote_candidates);
candidate = ice_add_remote_candidate(cl, "prflx", taddr->ip, taddr->port, componentID, msg->priority.priority, foundation);
candidate = ice_add_remote_candidate(cl, "prflx", taddr->ip, taddr->port, componentID, msg->priority.priority, foundation, FALSE);
}
return candidate;
}
......@@ -1426,7 +1426,7 @@ IceCandidate * ice_add_local_candidate(IceCheckList* cl, const char* type, const
return candidate;
}
IceCandidate * ice_add_remote_candidate(IceCheckList *cl, const char *type, const char *ip, int port, uint16_t componentID, uint32_t priority, const char * const foundation)
IceCandidate * ice_add_remote_candidate(IceCheckList *cl, const char *type, const char *ip, int port, uint16_t componentID, uint32_t priority, const char * const foundation, bool_t is_default)
{
IceCandidate *candidate = ice_add_candidate(&cl->remote_candidates, type, ip, port, componentID);
if (candidate == NULL) return NULL;
......@@ -1435,6 +1435,7 @@ IceCandidate * ice_add_remote_candidate(IceCheckList *cl, const char *type, cons
if (priority == 0) ice_compute_candidate_priority(candidate);
else candidate->priority = priority;
strncpy(candidate->foundation, foundation, sizeof(candidate->foundation) - 1);
candidate->is_default = is_default;
return candidate;
}
......
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