Codebase list libnice / dda9697
Remove nice_agent_add_remote_candidate since it's useless Youness Alaoui 15 years ago
4 changed file(s) with 0 addition(s) and 88 deletion(s). Raw diff Collapse all Expand all
12011201 return ret;
12021202 }
12031203
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
12411204 NICEAPI_EXPORT int
12421205 nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint component_id, const GSList *candidates)
12431206 {
391391 NiceAgent *agent,
392392 guint stream_id,
393393 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);
428394
429395 /**
430396 * nice_agent_set_remote_candidates:
8787 g_assert (strncmp (candidate->foundation, "1", 1) == 0);
8888 g_slist_free (candidates);
8989
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
10690 /* clean up */
10791 g_object_unref (agent);
10892 return 0;
1313 nice_address_set_port
1414 nice_address_to_string
1515 nice_agent_add_local_address
16 nice_agent_add_remote_candidate
1716 nice_agent_add_stream
1817 nice_agent_attach_recv
1918 nice_agent_gather_candidates