Mercurial > pidgin
comparison libpurple/media/backend-fs2.c @ 29187:f351e87b7af0
Add codecs_ready to the media backend interface.
author | maiku@pidgin.im |
---|---|
date | Tue, 27 Oct 2009 19:06:29 +0000 |
parents | f65689100cfe |
children | 209fa20fc39f |
comparison
equal
deleted
inserted
replaced
29186:7e9d8840e97f | 29187:f351e87b7af0 |
---|---|
68 guint num_params, GParameter *params); | 68 guint num_params, GParameter *params); |
69 static void purple_media_backend_fs2_add_remote_candidates( | 69 static void purple_media_backend_fs2_add_remote_candidates( |
70 PurpleMediaBackend *self, | 70 PurpleMediaBackend *self, |
71 const gchar *sess_id, const gchar *participant, | 71 const gchar *sess_id, const gchar *participant, |
72 GList *remote_candidates); | 72 GList *remote_candidates); |
73 static gboolean purple_media_backend_fs2_codecs_ready(PurpleMediaBackend *self, | |
74 const gchar *sess_id); | |
73 static GList *purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, | 75 static GList *purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, |
74 const gchar *sess_id); | 76 const gchar *sess_id); |
75 static GList *purple_media_backend_fs2_get_local_candidates( | 77 static GList *purple_media_backend_fs2_get_local_candidates( |
76 PurpleMediaBackend *self, | 78 PurpleMediaBackend *self, |
77 const gchar *sess_id, const gchar *participant); | 79 const gchar *sess_id, const gchar *participant); |
364 purple_media_backend_iface_init(PurpleMediaBackendIface *iface) | 366 purple_media_backend_iface_init(PurpleMediaBackendIface *iface) |
365 { | 367 { |
366 iface->add_stream = purple_media_backend_fs2_add_stream; | 368 iface->add_stream = purple_media_backend_fs2_add_stream; |
367 iface->add_remote_candidates = | 369 iface->add_remote_candidates = |
368 purple_media_backend_fs2_add_remote_candidates; | 370 purple_media_backend_fs2_add_remote_candidates; |
371 iface->codecs_ready = purple_media_backend_fs2_codecs_ready; | |
369 iface->get_codecs = purple_media_backend_fs2_get_codecs; | 372 iface->get_codecs = purple_media_backend_fs2_get_codecs; |
370 iface->get_local_candidates = | 373 iface->get_local_candidates = |
371 purple_media_backend_fs2_get_local_candidates; | 374 purple_media_backend_fs2_get_local_candidates; |
372 iface->set_remote_codecs = purple_media_backend_fs2_set_remote_codecs; | 375 iface->set_remote_codecs = purple_media_backend_fs2_set_remote_codecs; |
373 iface->set_send_codec = purple_media_backend_fs2_set_send_codec; | 376 iface->set_send_codec = purple_media_backend_fs2_set_send_codec; |
1498 g_error_free(err); | 1501 g_error_free(err); |
1499 } | 1502 } |
1500 } | 1503 } |
1501 } | 1504 } |
1502 | 1505 |
1506 static gboolean | |
1507 purple_media_backend_fs2_codecs_ready(PurpleMediaBackend *self, | |
1508 const gchar *sess_id) | |
1509 { | |
1510 PurpleMediaBackendFs2Private *priv; | |
1511 gboolean ret; | |
1512 | |
1513 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); | |
1514 | |
1515 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); | |
1516 | |
1517 if (sess_id != NULL) { | |
1518 PurpleMediaBackendFs2Session *session = _get_session( | |
1519 PURPLE_MEDIA_BACKEND_FS2(self), sess_id); | |
1520 | |
1521 if (session == NULL) | |
1522 return FALSE; | |
1523 | |
1524 if (session->type & (PURPLE_MEDIA_SEND_AUDIO | | |
1525 PURPLE_MEDIA_SEND_VIDEO)) | |
1526 g_object_get(session->session, | |
1527 "codecs-ready", &ret, NULL); | |
1528 else | |
1529 ret = TRUE; | |
1530 } else { | |
1531 GList *values = g_hash_table_get_values(priv->sessions); | |
1532 | |
1533 for (; values; values = g_list_delete_link(values, values)) { | |
1534 PurpleMediaBackendFs2Session *session = values->data; | |
1535 if (session->type & (PURPLE_MEDIA_SEND_AUDIO | | |
1536 PURPLE_MEDIA_SEND_VIDEO)) | |
1537 g_object_get(session->session, | |
1538 "codecs-ready", &ret, NULL); | |
1539 else | |
1540 ret = TRUE; | |
1541 | |
1542 if (ret == FALSE) | |
1543 break; | |
1544 } | |
1545 | |
1546 if (values != NULL) | |
1547 g_list_free(values); | |
1548 } | |
1549 | |
1550 return ret; | |
1551 } | |
1552 | |
1503 static GList * | 1553 static GList * |
1504 purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, | 1554 purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, |
1505 const gchar *sess_id) | 1555 const gchar *sess_id) |
1506 { | 1556 { |
1507 PurpleMediaBackendFs2Private *priv; | 1557 PurpleMediaBackendFs2Private *priv; |