comparison libpurple/protocols/jabber/jingle/rtp.c @ 26021:f7cf50180e1d

Duplicate FsCandidate to remove it from the public interface.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 10 Jan 2009 03:58:54 +0000
parents b6457b2a8e14
children ac4d7695dbc7
comparison
equal deleted inserted replaced
26020:ade5b2c51047 26021:f7cf50180e1d
191 if (type == JINGLE_TYPE_RAWUDP) { 191 if (type == JINGLE_TYPE_RAWUDP) {
192 gchar *id = jabber_get_next_id(jingle_session_get_js(session)); 192 gchar *id = jabber_get_next_id(jingle_session_get_js(session));
193 JingleTransport *transport = jingle_transport_create(JINGLE_TRANSPORT_RAWUDP); 193 JingleTransport *transport = jingle_transport_create(JINGLE_TRANSPORT_RAWUDP);
194 JingleRawUdpCandidate *rawudp_candidate; 194 JingleRawUdpCandidate *rawudp_candidate;
195 for (; candidates; candidates = g_list_next(candidates)) { 195 for (; candidates; candidates = g_list_next(candidates)) {
196 FsCandidate *candidate = candidates->data; 196 PurpleMediaCandidate *candidate = candidates->data;
197 id = jabber_get_next_id(jingle_session_get_js(session)); 197 id = jabber_get_next_id(jingle_session_get_js(session));
198 rawudp_candidate = jingle_rawudp_candidate_new(id, 198 rawudp_candidate = jingle_rawudp_candidate_new(id,
199 generation, candidate->component_id, 199 generation, candidate->component_id,
200 candidate->ip, candidate->port); 200 candidate->ip, candidate->port);
201 jingle_rawudp_add_local_candidate(JINGLE_RAWUDP(transport), rawudp_candidate); 201 jingle_rawudp_add_local_candidate(JINGLE_RAWUDP(transport), rawudp_candidate);
204 return transport; 204 return transport;
205 } else if (type == JINGLE_TYPE_ICEUDP) { 205 } else if (type == JINGLE_TYPE_ICEUDP) {
206 JingleTransport *transport = jingle_transport_create(JINGLE_TRANSPORT_ICEUDP); 206 JingleTransport *transport = jingle_transport_create(JINGLE_TRANSPORT_ICEUDP);
207 JingleIceUdpCandidate *iceudp_candidate; 207 JingleIceUdpCandidate *iceudp_candidate;
208 for (; candidates; candidates = g_list_next(candidates)) { 208 for (; candidates; candidates = g_list_next(candidates)) {
209 FsCandidate *candidate = candidates->data; 209 PurpleMediaCandidate *candidate = candidates->data;
210 iceudp_candidate = jingle_iceudp_candidate_new(candidate->component_id, 210 iceudp_candidate = jingle_iceudp_candidate_new(candidate->component_id,
211 candidate->foundation, generation, candidate->ip, 211 candidate->foundation, generation, candidate->ip,
212 0, candidate->port, candidate->priority, "udp", 212 0, candidate->port, candidate->priority, "udp",
213 candidate->type == FS_CANDIDATE_TYPE_HOST ? "host" : 213 candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_HOST ? "host" :
214 candidate->type == FS_CANDIDATE_TYPE_SRFLX ? "srflx" : 214 candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX ? "srflx" :
215 candidate->type == FS_CANDIDATE_TYPE_PRFLX ? "prflx" : 215 candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX ? "prflx" :
216 candidate->type == FS_CANDIDATE_TYPE_RELAY ? "relay" : "", 216 candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_RELAY ? "relay" : "",
217 candidate->username, candidate->password); 217 candidate->username, candidate->password);
218 jingle_iceudp_add_local_candidate(JINGLE_ICEUDP(transport), iceudp_candidate); 218 jingle_iceudp_add_local_candidate(JINGLE_ICEUDP(transport), iceudp_candidate);
219 } 219 }
220 return transport; 220 return transport;
221 } else { 221 } else {
231 if (!strcmp(type, JINGLE_TRANSPORT_RAWUDP)) { 231 if (!strcmp(type, JINGLE_TRANSPORT_RAWUDP)) {
232 GList *candidates = jingle_rawudp_get_remote_candidates(JINGLE_RAWUDP(transport)); 232 GList *candidates = jingle_rawudp_get_remote_candidates(JINGLE_RAWUDP(transport));
233 233
234 for (; candidates; candidates = g_list_delete_link(candidates, candidates)) { 234 for (; candidates; candidates = g_list_delete_link(candidates, candidates)) {
235 JingleRawUdpCandidate *candidate = candidates->data; 235 JingleRawUdpCandidate *candidate = candidates->data;
236 ret = g_list_append(ret, fs_candidate_new("", candidate->component, 236 ret = g_list_append(ret, purple_media_candidate_new(
237 FS_CANDIDATE_TYPE_SRFLX, FS_NETWORK_PROTOCOL_UDP, 237 "", candidate->component,
238 PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
239 PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
238 candidate->ip, candidate->port)); 240 candidate->ip, candidate->port));
239 } 241 }
240 242
241 return ret; 243 return ret;
242 } else if (!strcmp(type, JINGLE_TRANSPORT_ICEUDP)) { 244 } else if (!strcmp(type, JINGLE_TRANSPORT_ICEUDP)) {
243 GList *candidates = jingle_iceudp_get_remote_candidates(JINGLE_ICEUDP(transport)); 245 GList *candidates = jingle_iceudp_get_remote_candidates(JINGLE_ICEUDP(transport));
244 246
245 for (; candidates; candidates = g_list_delete_link(candidates, candidates)) { 247 for (; candidates; candidates = g_list_delete_link(candidates, candidates)) {
246 JingleIceUdpCandidate *candidate = candidates->data; 248 JingleIceUdpCandidate *candidate = candidates->data;
247 FsCandidate *fscandidate = fs_candidate_new( 249 PurpleMediaCandidate *new_candidate = purple_media_candidate_new(
248 candidate->foundation, candidate->component, 250 candidate->foundation, candidate->component,
249 !strcmp(candidate->type, "host") ? FS_CANDIDATE_TYPE_HOST : 251 !strcmp(candidate->type, "host") ?
250 !strcmp(candidate->type, "srflx") ? FS_CANDIDATE_TYPE_SRFLX : 252 PURPLE_MEDIA_CANDIDATE_TYPE_HOST :
251 !strcmp(candidate->type, "prflx") ? FS_CANDIDATE_TYPE_PRFLX : 253 !strcmp(candidate->type, "srflx") ?
252 !strcmp(candidate->type, "relay") ? FS_CANDIDATE_TYPE_RELAY : 0, 254 PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX :
253 FS_NETWORK_PROTOCOL_UDP, candidate->ip, candidate->port); 255 !strcmp(candidate->type, "prflx") ?
254 fscandidate->username = g_strdup(candidate->username); 256 PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX :
255 fscandidate->password = g_strdup(candidate->password); 257 !strcmp(candidate->type, "relay") ?
256 fscandidate->priority = candidate->priority; 258 PURPLE_MEDIA_CANDIDATE_TYPE_RELAY : 0,
257 ret = g_list_append(ret, fscandidate); 259 PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
260 candidate->ip, candidate->port);
261 new_candidate->username = g_strdup(candidate->username);
262 new_candidate->password = g_strdup(candidate->password);
263 new_candidate->priority = candidate->priority;
264 ret = g_list_append(ret, new_candidate);
258 } 265 }
259 266
260 return ret; 267 return ret;
261 } else { 268 } else {
262 return NULL; 269 return NULL;
263 } 270 }
264 } 271 }
265 272
266 static void 273 static void
267 jingle_rtp_new_candidate_cb(PurpleMedia *media, gchar *sid, gchar *name, FsCandidate *candidate, JingleSession *session) 274 jingle_rtp_new_candidate_cb(PurpleMedia *media, gchar *sid, gchar *name, PurpleMediaCandidate *candidate, JingleSession *session)
268 { 275 {
269 purple_debug_info("jingle-rtp", "jingle_rtp_new_candidate_cb\n"); 276 purple_debug_info("jingle-rtp", "jingle_rtp_new_candidate_cb\n");
270 } 277 }
271 278
272 static void 279 static void