| 45 typedef struct _PurpleMediaBackendFs2Private PurpleMediaBackendFs2Private; |
45 typedef struct _PurpleMediaBackendFs2Private PurpleMediaBackendFs2Private; |
| 46 /** @copydoc _PurpleMediaBackendFs2Session */ |
46 /** @copydoc _PurpleMediaBackendFs2Session */ |
| 47 typedef struct _PurpleMediaBackendFs2Session PurpleMediaBackendFs2Session; |
47 typedef struct _PurpleMediaBackendFs2Session PurpleMediaBackendFs2Session; |
| 48 /** @copydoc _PurpleMediaBackendFs2Stream */ |
48 /** @copydoc _PurpleMediaBackendFs2Stream */ |
| 49 typedef struct _PurpleMediaBackendFs2Stream PurpleMediaBackendFs2Stream; |
49 typedef struct _PurpleMediaBackendFs2Stream PurpleMediaBackendFs2Stream; |
| 50 |
|
| 51 #define PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj) \ |
|
| 52 (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ |
|
| 53 PURPLE_TYPE_MEDIA_BACKEND_FS2, PurpleMediaBackendFs2Private)) |
|
| 54 |
50 |
| 55 static void purple_media_backend_iface_init(PurpleMediaBackendIface *iface); |
51 static void purple_media_backend_iface_init(PurpleMediaBackendIface *iface); |
| 56 |
52 |
| 57 static gboolean |
53 static gboolean |
| 58 gst_bus_cb(GstBus *bus, GstMessage *msg, PurpleMediaBackendFs2 *self); |
54 gst_bus_cb(GstBus *bus, GstMessage *msg, PurpleMediaBackendFs2 *self); |
| 116 struct _PurpleMediaBackendFs2 |
112 struct _PurpleMediaBackendFs2 |
| 117 { |
113 { |
| 118 GObject parent; |
114 GObject parent; |
| 119 }; |
115 }; |
| 120 |
116 |
| 121 G_DEFINE_TYPE_WITH_CODE(PurpleMediaBackendFs2, purple_media_backend_fs2, |
|
| 122 G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE( |
|
| 123 PURPLE_TYPE_MEDIA_BACKEND, purple_media_backend_iface_init)); |
|
| 124 |
|
| 125 struct _PurpleMediaBackendFs2Stream |
117 struct _PurpleMediaBackendFs2Stream |
| 126 { |
118 { |
| 127 PurpleMediaBackendFs2Session *session; |
119 PurpleMediaBackendFs2Session *session; |
| 128 gchar *participant; |
120 gchar *participant; |
| 129 FsStream *stream; |
121 FsStream *stream; |
| 178 enum { |
170 enum { |
| 179 PROP_0, |
171 PROP_0, |
| 180 PROP_CONFERENCE_TYPE, |
172 PROP_CONFERENCE_TYPE, |
| 181 PROP_MEDIA, |
173 PROP_MEDIA, |
| 182 }; |
174 }; |
| |
175 |
| |
176 G_DEFINE_TYPE_WITH_CODE(PurpleMediaBackendFs2, purple_media_backend_fs2, |
| |
177 G_TYPE_OBJECT, G_ADD_PRIVATE(PurpleMediaBackendFs2) |
| |
178 G_IMPLEMENT_INTERFACE(PURPLE_TYPE_MEDIA_BACKEND, |
| |
179 purple_media_backend_iface_init)); |
| 183 |
180 |
| 184 static void |
181 static void |
| 185 purple_media_backend_fs2_init(PurpleMediaBackendFs2 *self) |
182 purple_media_backend_fs2_init(PurpleMediaBackendFs2 *self) |
| 186 { |
183 { |
| 187 } |
184 } |
| 298 |
295 |
| 299 static void |
296 static void |
| 300 purple_media_backend_fs2_dispose(GObject *obj) |
297 purple_media_backend_fs2_dispose(GObject *obj) |
| 301 { |
298 { |
| 302 PurpleMediaBackendFs2Private *priv = |
299 PurpleMediaBackendFs2Private *priv = |
| 303 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj); |
300 purple_media_backend_fs2_get_instance_private( |
| |
301 PURPLE_MEDIA_BACKEND_FS2(obj)); |
| 304 GList *iter = NULL; |
302 GList *iter = NULL; |
| 305 |
303 |
| 306 purple_debug_info("backend-fs2", "purple_media_backend_fs2_dispose\n"); |
304 purple_debug_info("backend-fs2", "purple_media_backend_fs2_dispose\n"); |
| 307 |
305 |
| 308 if (priv->notifier) { |
306 if (priv->notifier) { |
| 395 |
393 |
| 396 static void |
394 static void |
| 397 purple_media_backend_fs2_finalize(GObject *obj) |
395 purple_media_backend_fs2_finalize(GObject *obj) |
| 398 { |
396 { |
| 399 PurpleMediaBackendFs2Private *priv = |
397 PurpleMediaBackendFs2Private *priv = |
| 400 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj); |
398 purple_media_backend_fs2_get_instance_private( |
| |
399 PURPLE_MEDIA_BACKEND_FS2(obj)); |
| 401 |
400 |
| 402 purple_debug_info("backend-fs2", "purple_media_backend_fs2_finalize\n"); |
401 purple_debug_info("backend-fs2", "purple_media_backend_fs2_finalize\n"); |
| 403 |
402 |
| 404 g_free(priv->conference_type); |
403 g_free(priv->conference_type); |
| 405 |
404 |
| 430 const GValue *value, GParamSpec *pspec) |
429 const GValue *value, GParamSpec *pspec) |
| 431 { |
430 { |
| 432 PurpleMediaBackendFs2Private *priv; |
431 PurpleMediaBackendFs2Private *priv; |
| 433 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); |
432 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); |
| 434 |
433 |
| 435 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); |
434 priv = purple_media_backend_fs2_get_instance_private( |
| |
435 PURPLE_MEDIA_BACKEND_FS2(object)); |
| 436 |
436 |
| 437 switch (prop_id) { |
437 switch (prop_id) { |
| 438 case PROP_CONFERENCE_TYPE: |
438 case PROP_CONFERENCE_TYPE: |
| 439 priv->conference_type = g_value_dup_string(value); |
439 priv->conference_type = g_value_dup_string(value); |
| 440 break; |
440 break; |
| 467 GValue *value, GParamSpec *pspec) |
467 GValue *value, GParamSpec *pspec) |
| 468 { |
468 { |
| 469 PurpleMediaBackendFs2Private *priv; |
469 PurpleMediaBackendFs2Private *priv; |
| 470 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); |
470 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); |
| 471 |
471 |
| 472 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); |
472 priv = purple_media_backend_fs2_get_instance_private( |
| |
473 PURPLE_MEDIA_BACKEND_FS2(object)); |
| 473 |
474 |
| 474 switch (prop_id) { |
475 switch (prop_id) { |
| 475 case PROP_CONFERENCE_TYPE: |
476 case PROP_CONFERENCE_TYPE: |
| 476 g_value_set_string(value, priv->conference_type); |
477 g_value_set_string(value, priv->conference_type); |
| 477 break; |
478 break; |
| 498 gobject_class->get_property = purple_media_backend_fs2_get_property; |
499 gobject_class->get_property = purple_media_backend_fs2_get_property; |
| 499 |
500 |
| 500 g_object_class_override_property(gobject_class, PROP_CONFERENCE_TYPE, |
501 g_object_class_override_property(gobject_class, PROP_CONFERENCE_TYPE, |
| 501 "conference-type"); |
502 "conference-type"); |
| 502 g_object_class_override_property(gobject_class, PROP_MEDIA, "media"); |
503 g_object_class_override_property(gobject_class, PROP_MEDIA, "media"); |
| 503 |
|
| 504 g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private)); |
|
| 505 |
504 |
| 506 /* VA-API elements aren't well supported in Farstream. Ignore them. */ |
505 /* VA-API elements aren't well supported in Farstream. Ignore them. */ |
| 507 features = gst_registry_get_feature_list_by_plugin(gst_registry_get(), |
506 features = gst_registry_get_feature_list_by_plugin(gst_registry_get(), |
| 508 "vaapi"); |
507 "vaapi"); |
| 509 for (it = features; it; it = it->next) { |
508 for (it = features; it; it = it->next) { |
| 796 PurpleMediaBackendFs2Private *priv; |
795 PurpleMediaBackendFs2Private *priv; |
| 797 PurpleMediaBackendFs2Session *session = NULL; |
796 PurpleMediaBackendFs2Session *session = NULL; |
| 798 |
797 |
| 799 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
798 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
| 800 |
799 |
| 801 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
800 priv = purple_media_backend_fs2_get_instance_private(self); |
| 802 |
801 |
| 803 if (priv->sessions != NULL) |
802 if (priv->sessions != NULL) |
| 804 session = g_hash_table_lookup(priv->sessions, sess_id); |
803 session = g_hash_table_lookup(priv->sessions, sess_id); |
| 805 |
804 |
| 806 return session; |
805 return session; |
| 812 PurpleMediaBackendFs2Private *priv; |
811 PurpleMediaBackendFs2Private *priv; |
| 813 FsParticipant *participant = NULL; |
812 FsParticipant *participant = NULL; |
| 814 |
813 |
| 815 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
814 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
| 816 |
815 |
| 817 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
816 priv = purple_media_backend_fs2_get_instance_private(self); |
| 818 |
817 |
| 819 if (priv->participants != NULL) |
818 if (priv->participants != NULL) |
| 820 participant = g_hash_table_lookup(priv->participants, name); |
819 participant = g_hash_table_lookup(priv->participants, name); |
| 821 |
820 |
| 822 return participant; |
821 return participant; |
| 829 PurpleMediaBackendFs2Private *priv; |
828 PurpleMediaBackendFs2Private *priv; |
| 830 GList *streams; |
829 GList *streams; |
| 831 |
830 |
| 832 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
831 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
| 833 |
832 |
| 834 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
833 priv = purple_media_backend_fs2_get_instance_private(self); |
| 835 streams = priv->streams; |
834 streams = priv->streams; |
| 836 |
835 |
| 837 for (; streams; streams = g_list_next(streams)) { |
836 for (; streams; streams = g_list_next(streams)) { |
| 838 PurpleMediaBackendFs2Stream *stream = streams->data; |
837 PurpleMediaBackendFs2Stream *stream = streams->data; |
| 839 if (purple_strequal(stream->session->id, sess_id) && |
838 if (purple_strequal(stream->session->id, sess_id) && |
| 851 PurpleMediaBackendFs2Private *priv; |
850 PurpleMediaBackendFs2Private *priv; |
| 852 GList *streams, *ret = NULL; |
851 GList *streams, *ret = NULL; |
| 853 |
852 |
| 854 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
853 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
| 855 |
854 |
| 856 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
855 priv = purple_media_backend_fs2_get_instance_private(self); |
| 857 streams = priv->streams; |
856 streams = priv->streams; |
| 858 |
857 |
| 859 for (; streams; streams = g_list_next(streams)) { |
858 for (; streams; streams = g_list_next(streams)) { |
| 860 PurpleMediaBackendFs2Stream *stream = streams->data; |
859 PurpleMediaBackendFs2Stream *stream = streams->data; |
| 861 |
860 |
| 873 |
872 |
| 874 static PurpleMediaBackendFs2Session * |
873 static PurpleMediaBackendFs2Session * |
| 875 get_session_from_fs_stream(PurpleMediaBackendFs2 *self, FsStream *stream) |
874 get_session_from_fs_stream(PurpleMediaBackendFs2 *self, FsStream *stream) |
| 876 { |
875 { |
| 877 PurpleMediaBackendFs2Private *priv = |
876 PurpleMediaBackendFs2Private *priv = |
| 878 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
877 purple_media_backend_fs2_get_instance_private(self); |
| 879 FsSession *fssession; |
878 FsSession *fssession; |
| 880 GList *values; |
879 GList *values; |
| 881 |
880 |
| 882 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
881 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
| 883 g_return_val_if_fail(FS_IS_STREAM(stream), NULL); |
882 g_return_val_if_fail(FS_IS_STREAM(stream), NULL); |
| 931 static void |
930 static void |
| 932 gst_handle_message_element(GstBus *bus, GstMessage *msg, |
931 gst_handle_message_element(GstBus *bus, GstMessage *msg, |
| 933 PurpleMediaBackendFs2 *self) |
932 PurpleMediaBackendFs2 *self) |
| 934 { |
933 { |
| 935 PurpleMediaBackendFs2Private *priv = |
934 PurpleMediaBackendFs2Private *priv = |
| 936 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
935 purple_media_backend_fs2_get_instance_private(self); |
| 937 GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
936 GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
| 938 static guint level_id = 0; |
937 static guint level_id = 0; |
| 939 const GstStructure *structure = gst_message_get_structure(msg); |
938 const GstStructure *structure = gst_message_get_structure(msg); |
| 940 |
939 |
| 941 if (level_id == 0) |
940 if (level_id == 0) |
| 1230 static void |
1229 static void |
| 1231 gst_handle_message_error(GstBus *bus, GstMessage *msg, |
1230 gst_handle_message_error(GstBus *bus, GstMessage *msg, |
| 1232 PurpleMediaBackendFs2 *self) |
1231 PurpleMediaBackendFs2 *self) |
| 1233 { |
1232 { |
| 1234 PurpleMediaBackendFs2Private *priv = |
1233 PurpleMediaBackendFs2Private *priv = |
| 1235 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1234 purple_media_backend_fs2_get_instance_private(self); |
| 1236 GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
1235 GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
| 1237 GstElement *lastElement = NULL; |
1236 GstElement *lastElement = NULL; |
| 1238 GList *sessions; |
1237 GList *sessions; |
| 1239 |
1238 |
| 1240 GError *error = NULL; |
1239 GError *error = NULL; |
| 1314 state_changed_cb(PurpleMedia *media, PurpleMediaState state, |
1313 state_changed_cb(PurpleMedia *media, PurpleMediaState state, |
| 1315 gchar *sid, gchar *name, PurpleMediaBackendFs2 *self) |
1314 gchar *sid, gchar *name, PurpleMediaBackendFs2 *self) |
| 1316 { |
1315 { |
| 1317 if (state == PURPLE_MEDIA_STATE_END) { |
1316 if (state == PURPLE_MEDIA_STATE_END) { |
| 1318 PurpleMediaBackendFs2Private *priv = |
1317 PurpleMediaBackendFs2Private *priv = |
| 1319 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1318 purple_media_backend_fs2_get_instance_private( |
| |
1319 self); |
| 1320 |
1320 |
| 1321 if (sid && name) { |
1321 if (sid && name) { |
| 1322 PurpleMediaBackendFs2Stream *stream = get_stream(self, sid, name); |
1322 PurpleMediaBackendFs2Stream *stream = get_stream(self, sid, name); |
| 1323 gst_object_unref(stream->stream); |
1323 gst_object_unref(stream->stream); |
| 1324 |
1324 |
| 1392 err->message); |
1392 err->message); |
| 1393 g_error_free(err); |
1393 g_error_free(err); |
| 1394 } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE || |
1394 } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE || |
| 1395 type == PURPLE_MEDIA_INFO_UNMUTE)) { |
1395 type == PURPLE_MEDIA_INFO_UNMUTE)) { |
| 1396 PurpleMediaBackendFs2Private *priv = |
1396 PurpleMediaBackendFs2Private *priv = |
| 1397 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1397 purple_media_backend_fs2_get_instance_private( |
| |
1398 self); |
| 1398 gboolean active = (type == PURPLE_MEDIA_INFO_MUTE); |
1399 gboolean active = (type == PURPLE_MEDIA_INFO_MUTE); |
| 1399 GList *sessions; |
1400 GList *sessions; |
| 1400 |
1401 |
| 1401 if (sid == NULL) |
1402 if (sid == NULL) |
| 1402 sessions = g_hash_table_get_values(priv->sessions); |
1403 sessions = g_hash_table_get_values(priv->sessions); |
| 1456 |
1457 |
| 1457 static gboolean |
1458 static gboolean |
| 1458 init_conference(PurpleMediaBackendFs2 *self) |
1459 init_conference(PurpleMediaBackendFs2 *self) |
| 1459 { |
1460 { |
| 1460 PurpleMediaBackendFs2Private *priv = |
1461 PurpleMediaBackendFs2Private *priv = |
| 1461 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1462 purple_media_backend_fs2_get_instance_private(self); |
| 1462 GstElement *pipeline; |
1463 GstElement *pipeline; |
| 1463 GstBus *bus; |
1464 GstBus *bus; |
| 1464 gchar *name; |
1465 gchar *name; |
| 1465 GKeyFile *default_props; |
1466 GKeyFile *default_props; |
| 1466 |
1467 |
| 1544 static gboolean |
1545 static gboolean |
| 1545 create_src(PurpleMediaBackendFs2 *self, const gchar *sess_id, |
1546 create_src(PurpleMediaBackendFs2 *self, const gchar *sess_id, |
| 1546 PurpleMediaSessionType type) |
1547 PurpleMediaSessionType type) |
| 1547 { |
1548 { |
| 1548 PurpleMediaBackendFs2Private *priv = |
1549 PurpleMediaBackendFs2Private *priv = |
| 1549 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1550 purple_media_backend_fs2_get_instance_private(self); |
| 1550 PurpleMediaBackendFs2Session *session; |
1551 PurpleMediaBackendFs2Session *session; |
| 1551 PurpleMediaSessionType session_type; |
1552 PurpleMediaSessionType session_type; |
| 1552 FsMediaType media_type = session_type_to_fs_media_type(type); |
1553 FsMediaType media_type = session_type_to_fs_media_type(type); |
| 1553 FsStreamDirection type_direction = |
1554 FsStreamDirection type_direction = |
| 1554 session_type_to_fs_stream_direction(type); |
1555 session_type_to_fs_stream_direction(type); |
| 1654 create_session(PurpleMediaBackendFs2 *self, const gchar *sess_id, |
1655 create_session(PurpleMediaBackendFs2 *self, const gchar *sess_id, |
| 1655 PurpleMediaSessionType type, gboolean initiator, |
1656 PurpleMediaSessionType type, gboolean initiator, |
| 1656 const gchar *transmitter) |
1657 const gchar *transmitter) |
| 1657 { |
1658 { |
| 1658 PurpleMediaBackendFs2Private *priv = |
1659 PurpleMediaBackendFs2Private *priv = |
| 1659 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1660 purple_media_backend_fs2_get_instance_private(self); |
| 1660 PurpleMediaBackendFs2Session *session; |
1661 PurpleMediaBackendFs2Session *session; |
| 1661 GError *err = NULL; |
1662 GError *err = NULL; |
| 1662 GList *codec_conf = NULL; |
1663 GList *codec_conf = NULL; |
| 1663 gchar *filename = NULL; |
1664 gchar *filename = NULL; |
| 1664 |
1665 |
| 1754 |
1755 |
| 1755 static gboolean |
1756 static gboolean |
| 1756 create_participant(PurpleMediaBackendFs2 *self, const gchar *name) |
1757 create_participant(PurpleMediaBackendFs2 *self, const gchar *name) |
| 1757 { |
1758 { |
| 1758 PurpleMediaBackendFs2Private *priv = |
1759 PurpleMediaBackendFs2Private *priv = |
| 1759 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1760 purple_media_backend_fs2_get_instance_private(self); |
| 1760 FsParticipant *participant; |
1761 FsParticipant *participant; |
| 1761 GError *err = NULL; |
1762 GError *err = NULL; |
| 1762 |
1763 |
| 1763 participant = fs_conference_new_participant( |
1764 participant = fs_conference_new_participant( |
| 1764 priv->conference, &err); |
1765 priv->conference, &err); |
| 1796 { |
1797 { |
| 1797 PurpleMediaBackendFs2Private *priv; |
1798 PurpleMediaBackendFs2Private *priv; |
| 1798 |
1799 |
| 1799 g_return_val_if_fail(stream != NULL, FALSE); |
1800 g_return_val_if_fail(stream != NULL, FALSE); |
| 1800 |
1801 |
| 1801 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(stream->session->backend); |
1802 priv = purple_media_backend_fs2_get_instance_private( |
| |
1803 stream->session->backend); |
| 1802 stream->connected_cb_id = 0; |
1804 stream->connected_cb_id = 0; |
| 1803 |
1805 |
| 1804 purple_media_manager_create_output_window( |
1806 purple_media_manager_create_output_window( |
| 1805 purple_media_get_manager(priv->media), priv->media, |
1807 purple_media_get_manager(priv->media), priv->media, |
| 1806 stream->session->id, stream->participant); |
1808 stream->session->id, stream->participant); |
| 1819 GstPad *sinkpad; |
1821 GstPad *sinkpad; |
| 1820 |
1822 |
| 1821 g_return_if_fail(FS_IS_STREAM(fsstream)); |
1823 g_return_if_fail(FS_IS_STREAM(fsstream)); |
| 1822 g_return_if_fail(stream != NULL); |
1824 g_return_if_fail(stream != NULL); |
| 1823 |
1825 |
| 1824 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(stream->session->backend); |
1826 priv = purple_media_backend_fs2_get_instance_private( |
| |
1827 stream->session->backend); |
| 1825 |
1828 |
| 1826 if (stream->src == NULL) { |
1829 if (stream->src == NULL) { |
| 1827 GstElement *sink = NULL; |
1830 GstElement *sink = NULL; |
| 1828 |
1831 |
| 1829 if (codec->media_type == FS_MEDIA_TYPE_AUDIO) { |
1832 if (codec->media_type == FS_MEDIA_TYPE_AUDIO) { |
| 1925 PurpleMediaSessionType type, gboolean initiator, |
1928 PurpleMediaSessionType type, gboolean initiator, |
| 1926 const gchar *transmitter, |
1929 const gchar *transmitter, |
| 1927 guint num_params, GParameter *params) |
1930 guint num_params, GParameter *params) |
| 1928 { |
1931 { |
| 1929 PurpleMediaBackendFs2Private *priv = |
1932 PurpleMediaBackendFs2Private *priv = |
| 1930 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
1933 purple_media_backend_fs2_get_instance_private(self); |
| 1931 GError *err = NULL; |
1934 GError *err = NULL; |
| 1932 FsStream *fsstream = NULL; |
1935 FsStream *fsstream = NULL; |
| 1933 const gchar *stun_ip = purple_network_get_stun_ip(); |
1936 const gchar *stun_ip = purple_network_get_stun_ip(); |
| 1934 const gchar *turn_ip = purple_network_get_turn_ip(); |
1937 const gchar *turn_ip = purple_network_get_turn_ip(); |
| 1935 guint _num_params = num_params; |
1938 guint _num_params = num_params; |
| 2150 const gchar *transmitter, |
2153 const gchar *transmitter, |
| 2151 guint num_params, GParameter *params) |
2154 guint num_params, GParameter *params) |
| 2152 { |
2155 { |
| 2153 PurpleMediaBackendFs2 *backend = PURPLE_MEDIA_BACKEND_FS2(self); |
2156 PurpleMediaBackendFs2 *backend = PURPLE_MEDIA_BACKEND_FS2(self); |
| 2154 PurpleMediaBackendFs2Private *priv = |
2157 PurpleMediaBackendFs2Private *priv = |
| 2155 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(backend); |
2158 purple_media_backend_fs2_get_instance_private(backend); |
| 2156 PurpleMediaBackendFs2Stream *stream; |
2159 PurpleMediaBackendFs2Stream *stream; |
| 2157 |
2160 |
| 2158 if (priv->conference == NULL && !init_conference(backend)) { |
2161 if (priv->conference == NULL && !init_conference(backend)) { |
| 2159 purple_debug_error("backend-fs2", |
2162 purple_debug_error("backend-fs2", |
| 2160 "Error initializing the conference.\n"); |
2163 "Error initializing the conference.\n"); |
| 2207 PurpleMediaBackendFs2Stream *stream; |
2210 PurpleMediaBackendFs2Stream *stream; |
| 2208 GError *err = NULL; |
2211 GError *err = NULL; |
| 2209 |
2212 |
| 2210 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
2213 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
| 2211 |
2214 |
| 2212 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
2215 priv = purple_media_backend_fs2_get_instance_private( |
| |
2216 PURPLE_MEDIA_BACKEND_FS2(self)); |
| 2213 stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), |
2217 stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), |
| 2214 sess_id, participant); |
2218 sess_id, participant); |
| 2215 |
2219 |
| 2216 if (stream == NULL) { |
2220 if (stream == NULL) { |
| 2217 purple_debug_error("backend-fs2", |
2221 purple_debug_error("backend-fs2", |
| 2251 PurpleMediaBackendFs2Private *priv; |
2255 PurpleMediaBackendFs2Private *priv; |
| 2252 gboolean ret = FALSE; |
2256 gboolean ret = FALSE; |
| 2253 |
2257 |
| 2254 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
2258 g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
| 2255 |
2259 |
| 2256 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
2260 priv = purple_media_backend_fs2_get_instance_private( |
| |
2261 PURPLE_MEDIA_BACKEND_FS2(self)); |
| 2257 |
2262 |
| 2258 if (sess_id != NULL) { |
2263 if (sess_id != NULL) { |
| 2259 PurpleMediaBackendFs2Session *session = get_session( |
2264 PurpleMediaBackendFs2Session *session = get_session( |
| 2260 PURPLE_MEDIA_BACKEND_FS2(self), sess_id); |
2265 PURPLE_MEDIA_BACKEND_FS2(self), sess_id); |
| 2261 |
2266 |
| 2538 guint i; |
2543 guint i; |
| 2539 GstStructure *sdes; |
2544 GstStructure *sdes; |
| 2540 |
2545 |
| 2541 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
2546 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
| 2542 |
2547 |
| 2543 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
2548 priv = purple_media_backend_fs2_get_instance_private( |
| |
2549 PURPLE_MEDIA_BACKEND_FS2(self)); |
| 2544 |
2550 |
| 2545 if (priv->conference == NULL && |
2551 if (priv->conference == NULL && |
| 2546 !init_conference(PURPLE_MEDIA_BACKEND_FS2(self))) { |
2552 !init_conference(PURPLE_MEDIA_BACKEND_FS2(self))) { |
| 2547 purple_debug_error("backend-fs2", |
2553 purple_debug_error("backend-fs2", |
| 2548 "Error initializing the conference.\n"); |
2554 "Error initializing the conference.\n"); |
| 2670 PurpleMediaBackendFs2Private *priv; |
2676 PurpleMediaBackendFs2Private *priv; |
| 2671 GList *sessions; |
2677 GList *sessions; |
| 2672 |
2678 |
| 2673 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
2679 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
| 2674 |
2680 |
| 2675 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
2681 priv = purple_media_backend_fs2_get_instance_private(self); |
| 2676 |
2682 |
| 2677 purple_prefs_set_int("/purple/media/audio/volume/input", level); |
2683 purple_prefs_set_int("/purple/media/audio/volume/input", level); |
| 2678 |
2684 |
| 2679 if (sess_id == NULL) |
2685 if (sess_id == NULL) |
| 2680 sessions = g_hash_table_get_values(priv->sessions); |
2686 sessions = g_hash_table_get_values(priv->sessions); |