Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jingle/rtp.c @ 26381:d784e9ea7f50
Implement jingle_rtp_candidates_prepared_cb.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Thu, 19 Mar 2009 09:46:37 +0000 |
parents | b892b3cb9dbc |
children | 7fe896a5f4db |
comparison
equal
deleted
inserted
replaced
26380:b892b3cb9dbc | 26381:d784e9ea7f50 |
---|---|
341 { | 341 { |
342 purple_debug_info("jingle-rtp", "jingle_rtp_accepted_cb\n"); | 342 purple_debug_info("jingle-rtp", "jingle_rtp_accepted_cb\n"); |
343 } | 343 } |
344 | 344 |
345 static void | 345 static void |
346 jingle_rtp_candidates_prepared_cb(PurpleMedia *media, gchar *sid, gchar *name) | 346 jingle_rtp_candidates_prepared_cb(PurpleMedia *media, |
347 { | 347 gchar *sid, gchar *name, JingleSession *session) |
348 { | |
349 JingleContent *content = jingle_session_find_content( | |
350 session, sid, "initiator"); | |
351 JingleTransport *oldtransport, *transport; | |
352 GList *candidates; | |
353 | |
348 purple_debug_info("jingle-rtp", "jingle_rtp_candidates_prepared_cb\n"); | 354 purple_debug_info("jingle-rtp", "jingle_rtp_candidates_prepared_cb\n"); |
355 | |
356 if (content == NULL) | |
357 jingle_session_find_content(session, sid, "responder"); | |
358 | |
359 if (content == NULL) { | |
360 purple_debug_error("jingle-rtp", | |
361 "jingle_rtp_candidates_prepared_cb: " | |
362 "Can't find session %s\n", sid); | |
363 return; | |
364 } | |
365 | |
366 oldtransport = jingle_content_get_transport(content); | |
367 candidates = purple_media_get_local_candidates(media, sid, name); | |
368 transport = JINGLE_TRANSPORT(jingle_rtp_candidates_to_transport( | |
369 session, JINGLE_IS_RAWUDP(oldtransport) ? | |
370 JINGLE_TYPE_RAWUDP : JINGLE_TYPE_ICEUDP, | |
371 0, candidates)); | |
372 | |
373 g_list_free(candidates); | |
374 g_object_unref(oldtransport); | |
375 | |
376 jingle_content_set_pending_transport(content, transport); | |
377 jingle_content_accept_transport(content); | |
349 } | 378 } |
350 | 379 |
351 static void | 380 static void |
352 jingle_rtp_codecs_changed_cb(PurpleMedia *media, gchar *sid, | 381 jingle_rtp_codecs_changed_cb(PurpleMedia *media, gchar *sid, |
353 JingleSession *session) | 382 JingleSession *session) |
423 } else { | 452 } else { |
424 jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_ACCEPT)); | 453 jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_ACCEPT)); |
425 g_signal_connect(G_OBJECT(media), "new-candidate", | 454 g_signal_connect(G_OBJECT(media), "new-candidate", |
426 G_CALLBACK(jingle_rtp_new_candidate_cb), session); | 455 G_CALLBACK(jingle_rtp_new_candidate_cb), session); |
427 } | 456 } |
428 } else if (sid != NULL && name != NULL) { | |
429 JingleContent *content = jingle_session_find_content(session, sid, "initiator"); | |
430 JingleTransport *oldtransport = jingle_content_get_transport(content); | |
431 GList *candidates = purple_media_get_local_candidates(media, sid, name); | |
432 JingleTransport *transport = | |
433 JINGLE_TRANSPORT(jingle_rtp_candidates_to_transport( | |
434 session, JINGLE_IS_RAWUDP(oldtransport) ? | |
435 JINGLE_TYPE_RAWUDP : JINGLE_TYPE_ICEUDP, | |
436 0, candidates)); | |
437 g_list_free(candidates); | |
438 g_object_unref(oldtransport); | |
439 | |
440 jingle_content_set_pending_transport(content, transport); | |
441 jingle_content_accept_transport(content); | |
442 } | 457 } |
443 } | 458 } |
444 | 459 |
445 static void | 460 static void |
446 jingle_rtp_state_changed_cb(PurpleMedia *media, PurpleMediaStateChangedType type, | 461 jingle_rtp_state_changed_cb(PurpleMedia *media, PurpleMediaStateChangedType type, |