Remove nice_agent_add_remote_candidate since it's useless
Youness Alaoui
15 years ago
1201 | 1201 |
return ret;
|
1202 | 1202 |
}
|
1203 | 1203 |
|
1204 | |
|
1205 | |
NICEAPI_EXPORT gboolean
|
1206 | |
nice_agent_add_remote_candidate (
|
1207 | |
NiceAgent *agent,
|
1208 | |
guint stream_id,
|
1209 | |
guint component_id,
|
1210 | |
NiceCandidateType type,
|
1211 | |
NiceAddress *addr,
|
1212 | |
const gchar *username,
|
1213 | |
const gchar *password)
|
1214 | |
{
|
1215 | |
gboolean ret;
|
1216 | |
|
1217 | |
g_static_rec_mutex_lock (&agent->mutex);
|
1218 | |
|
1219 | |
ret =
|
1220 | |
priv_add_remote_candidate (agent,
|
1221 | |
stream_id,
|
1222 | |
component_id,
|
1223 | |
type,
|
1224 | |
addr,
|
1225 | |
NULL,
|
1226 | |
NICE_CANDIDATE_TRANSPORT_UDP,
|
1227 | |
0,
|
1228 | |
username,
|
1229 | |
password,
|
1230 | |
NULL);
|
1231 | |
|
1232 | |
/* XXX/later: for each component, generate a new check with the new
|
1233 | |
candidate, see below set_remote_candidates() */
|
1234 | |
|
1235 | |
|
1236 | |
g_static_rec_mutex_unlock (&agent->mutex);
|
1237 | |
return ret;
|
1238 | |
}
|
1239 | |
|
1240 | |
|
1241 | 1204 |
NICEAPI_EXPORT int
|
1242 | 1205 |
nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint component_id, const GSList *candidates)
|
1243 | 1206 |
{
|
391 | 391 |
NiceAgent *agent,
|
392 | 392 |
guint stream_id,
|
393 | 393 |
const gchar **ufrag, const gchar **pwd);
|
394 | |
|
395 | |
|
396 | |
/**
|
397 | |
* nice_agent_add_remote_candidate:
|
398 | |
* @agent: The #NiceAgent Object
|
399 | |
* @stream_id: The ID of the stream the candidate is for
|
400 | |
* @component_id: The ID of the component the candidate is for
|
401 | |
* @type: The type of the new candidate
|
402 | |
* @addr: The new candidate's IP address
|
403 | |
* @username: The new candidate's username
|
404 | |
* (optional - overrides the value set in nice_agent_set_remote_credentials())
|
405 | |
* @password: The new candidate's password
|
406 | |
* (optional - overrides the value set in nice_agent_set_remote_credentials())
|
407 | |
*
|
408 | |
* Adds a new remote candidate to the agent
|
409 | |
*
|
410 | |
<note>
|
411 | |
<para>
|
412 | |
NICE_AGENT_MAX_REMOTE_CANDIDATES is the absolute maximum limit
|
413 | |
for remote candidates
|
414 | |
</para>
|
415 | |
</note>
|
416 | |
*
|
417 | |
* Returns: %TRUE on success, %FALSE on fatal (memory alloc) errors
|
418 | |
**/
|
419 | |
gboolean
|
420 | |
nice_agent_add_remote_candidate (
|
421 | |
NiceAgent *agent,
|
422 | |
guint stream_id,
|
423 | |
guint component_id,
|
424 | |
NiceCandidateType type,
|
425 | |
NiceAddress *addr,
|
426 | |
const gchar *username,
|
427 | |
const gchar *password);
|
428 | 394 |
|
429 | 395 |
/**
|
430 | 396 |
* nice_agent_set_remote_candidates:
|
87 | 87 |
g_assert (strncmp (candidate->foundation, "1", 1) == 0);
|
88 | 88 |
g_slist_free (candidates);
|
89 | 89 |
|
90 | |
/* add remote candidate */
|
91 | |
nice_agent_add_remote_candidate (agent, stream_id, 1,
|
92 | |
NICE_CANDIDATE_TYPE_HOST,
|
93 | |
&addr_remote, "username", "password");
|
94 | |
candidates = nice_agent_get_remote_candidates (agent, stream_id, 1);
|
95 | |
g_assert (candidates != NULL);
|
96 | |
g_assert (g_slist_length (candidates) == 1);
|
97 | |
candidate = candidates->data;
|
98 | |
g_assert (nice_address_equal (&(candidate->addr), &addr_remote));
|
99 | |
g_assert (candidate->stream_id == stream_id);
|
100 | |
g_assert (candidate->component_id == 1);
|
101 | |
g_assert (candidate->type == NICE_CANDIDATE_TYPE_HOST);
|
102 | |
g_assert (0 == strcmp (candidate->username, "username"));
|
103 | |
g_assert (0 == strcmp (candidate->password, "password"));
|
104 | |
g_slist_free (candidates);
|
105 | |
|
106 | 90 |
/* clean up */
|
107 | 91 |
g_object_unref (agent);
|
108 | 92 |
return 0;
|
13 | 13 |
nice_address_set_port
|
14 | 14 |
nice_address_to_string
|
15 | 15 |
nice_agent_add_local_address
|
16 | |
nice_agent_add_remote_candidate
|
17 | 16 |
nice_agent_add_stream
|
18 | 17 |
nice_agent_attach_recv
|
19 | 18 |
nice_agent_gather_candidates
|