Sun, 14 Jul 2019 22:53:31 +0200
Add purple_media_set_require_encryption api
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
1 | /** |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2 | * @file backend-fs2.c Farstream backend for media API |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
3 | * @ingroup core |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
4 | */ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
5 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
6 | /* purple |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
7 | * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
8 | * Purple is the legal property of its developers, whose names are too numerous |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
10 | * source distribution. |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
11 | * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
12 | * This program is free software; you can redistribute it and/or modify |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
13 | * it under the terms of the GNU General Public License as published by |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
14 | * the Free Software Foundation; either version 2 of the License, or |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
15 | * (at your option) any later version. |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
16 | * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
17 | * This program is distributed in the hope that it will be useful, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
20 | * GNU General Public License for more details. |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
21 | * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
22 | * You should have received a copy of the GNU General Public License |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
23 | * along with this program; if not, write to the Free Software |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
25 | */ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
26 | |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
27 | #include "internal.h" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
28 | |
|
29661
ae75a0a4d399
Fix compile with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29657
diff
changeset
|
29 | #include "backend-fs2.h" |
|
ae75a0a4d399
Fix compile with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29657
diff
changeset
|
30 | |
|
29723
d20be93c4c8d
Compile with --disable-vv. Without this change I get this error:
Mark Doliner <markdoliner@pidgin.im>
parents:
29688
diff
changeset
|
31 | #ifdef USE_VV |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
32 | #include "backend-iface.h" |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
33 | #include "debug.h" |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
34 | #include "network.h" |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
35 | #include "media-gst.h" |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
36 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
37 | #ifdef HAVE_FARSIGHT |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
38 | #include <gst/farsight/fs-conference-iface.h> |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
39 | #include <gst/farsight/fs-element-added-notifier.h> |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
40 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
41 | #include <farstream/fs-conference.h> |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
42 | #include <farstream/fs-element-added-notifier.h> |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
43 | #include <farstream/fs-utils.h> |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
44 | #include <gst/gststructure.h> |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
45 | #endif |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
46 | |
|
37798
387a2fc8af0e
media: Fix gstreamer 0.10 compat (gst_registry_get() is missing there)
dx <dx@dxzone.com.ar>
parents:
37794
diff
changeset
|
47 | #if !GST_CHECK_VERSION(1,0,0) |
|
387a2fc8af0e
media: Fix gstreamer 0.10 compat (gst_registry_get() is missing there)
dx <dx@dxzone.com.ar>
parents:
37794
diff
changeset
|
48 | #define gst_registry_get() gst_registry_get_default() |
|
387a2fc8af0e
media: Fix gstreamer 0.10 compat (gst_registry_get() is missing there)
dx <dx@dxzone.com.ar>
parents:
37794
diff
changeset
|
49 | #endif |
|
387a2fc8af0e
media: Fix gstreamer 0.10 compat (gst_registry_get() is missing there)
dx <dx@dxzone.com.ar>
parents:
37794
diff
changeset
|
50 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
51 | /** @copydoc _PurpleMediaBackendFs2Class */ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
52 | typedef struct _PurpleMediaBackendFs2Class PurpleMediaBackendFs2Class; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
53 | /** @copydoc _PurpleMediaBackendFs2Private */ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
54 | typedef struct _PurpleMediaBackendFs2Private PurpleMediaBackendFs2Private; |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
55 | /** @copydoc _PurpleMediaBackendFs2Session */ |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
56 | typedef struct _PurpleMediaBackendFs2Session PurpleMediaBackendFs2Session; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
57 | /** @copydoc _PurpleMediaBackendFs2Stream */ |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
58 | typedef struct _PurpleMediaBackendFs2Stream PurpleMediaBackendFs2Stream; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
59 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
60 | #define PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj) \ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
61 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
62 | PURPLE_TYPE_MEDIA_BACKEND_FS2, PurpleMediaBackendFs2Private)) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
63 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
64 | static void purple_media_backend_iface_init(PurpleMediaBackendIface *iface); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
65 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
66 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
67 | gst_bus_cb(GstBus *bus, GstMessage *msg, PurpleMediaBackendFs2 *self); |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
68 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
69 | state_changed_cb(PurpleMedia *media, PurpleMediaState state, |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
70 | gchar *sid, gchar *name, PurpleMediaBackendFs2 *self); |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
71 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
72 | stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type, |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
73 | gchar *sid, gchar *name, gboolean local, |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
74 | PurpleMediaBackendFs2 *self); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
75 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
76 | static gboolean purple_media_backend_fs2_add_stream(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
77 | const gchar *sess_id, const gchar *who, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
78 | PurpleMediaSessionType type, gboolean initiator, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
79 | const gchar *transmitter, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
80 | guint num_params, GParameter *params); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
81 | static void purple_media_backend_fs2_add_remote_candidates( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
82 | PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
83 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
84 | GList *remote_candidates); |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
85 | static gboolean purple_media_backend_fs2_codecs_ready(PurpleMediaBackend *self, |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
86 | const gchar *sess_id); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
87 | static GList *purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
88 | const gchar *sess_id); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
89 | static GList *purple_media_backend_fs2_get_local_candidates( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
90 | PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
91 | const gchar *sess_id, const gchar *participant); |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
92 | #if GST_CHECK_VERSION(1,0,0) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
93 | static gboolean purple_media_backend_fs2_set_encryption_parameters ( |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
94 | PurpleMediaBackend *self, const gchar *sess_id, const gchar *cipher, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
95 | const gchar *auth, const gchar *key, gsize key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
96 | static gboolean purple_media_backend_fs2_set_decryption_parameters( |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
97 | PurpleMediaBackend *self, const gchar *sess_id, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
98 | const gchar *participant, const gchar *cipher, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
99 | const gchar *auth, const gchar *key, gsize key_len); |
|
39717
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
100 | static gboolean purple_media_backend_fs2_set_require_encryption( |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
101 | PurpleMediaBackend *self, const gchar *sess_id, |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
102 | const gchar *participant, const gboolean require_encryption); |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
103 | #endif |
|
29588
a3fef46ce04a
Make the backend interface's set_remote_codecs function return gboolean.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
104 | static gboolean purple_media_backend_fs2_set_remote_codecs( |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
105 | PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
106 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
107 | GList *codecs); |
|
29590
bec92b90acc9
Change the media backend interface's set_send_codec to return gboolean to
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
108 | static gboolean purple_media_backend_fs2_set_send_codec( |
|
bec92b90acc9
Change the media backend interface's set_send_codec to return gboolean to
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
109 | PurpleMediaBackend *self, const gchar *sess_id, |
|
bec92b90acc9
Change the media backend interface's set_send_codec to return gboolean to
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
110 | PurpleMediaCodec *codec); |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
111 | static void purple_media_backend_fs2_set_params(PurpleMediaBackend *self, |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
112 | guint num_params, GParameter *params); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
113 | static const gchar **purple_media_backend_fs2_get_available_params(void); |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
114 | static gboolean purple_media_backend_fs2_send_dtmf( |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
115 | PurpleMediaBackend *self, const gchar *sess_id, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
116 | gchar dtmf, guint8 volume, guint16 duration); |
|
36321
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
117 | static gboolean purple_media_backend_fs2_set_send_rtcp_mux( |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
118 | PurpleMediaBackend *self, |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
119 | const gchar *sess_id, const gchar *participant, |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
120 | gboolean send_rtcp_mux); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
121 | |
|
38945
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
122 | static void remove_element(GstElement *element); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
123 | |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
124 | static void free_stream(PurpleMediaBackendFs2Stream *stream); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
125 | static void free_session(PurpleMediaBackendFs2Session *session); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
126 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
127 | struct _PurpleMediaBackendFs2Class |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
128 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
129 | GObjectClass parent_class; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
130 | }; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
131 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
132 | struct _PurpleMediaBackendFs2 |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
133 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
134 | GObject parent; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
135 | }; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
136 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
137 | G_DEFINE_TYPE_WITH_CODE(PurpleMediaBackendFs2, purple_media_backend_fs2, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
138 | G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
139 | PURPLE_TYPE_MEDIA_BACKEND, purple_media_backend_iface_init)); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
140 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
141 | struct _PurpleMediaBackendFs2Stream |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
142 | { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
143 | PurpleMediaBackendFs2Session *session; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
144 | gchar *participant; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
145 | FsStream *stream; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
146 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
147 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
148 | gboolean supports_add; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
149 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
150 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
151 | GstElement *src; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
152 | GstElement *tee; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
153 | GstElement *volume; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
154 | GstElement *level; |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
155 | GstElement *fakesink; |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
156 | GstElement *queue; |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
157 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
158 | GList *local_candidates; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
159 | GList *remote_candidates; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
160 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
161 | guint connected_cb_id; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
162 | }; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
163 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
164 | struct _PurpleMediaBackendFs2Session |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
165 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
166 | PurpleMediaBackendFs2 *backend; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
167 | gchar *id; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
168 | FsSession *session; |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
169 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
170 | GstElement *src; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
171 | GstElement *tee; |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
172 | GstElement *srcvalve; |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
173 | |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
174 | GstPad *srcpad; |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
175 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
176 | PurpleMediaSessionType type; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
177 | }; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
178 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
179 | struct _PurpleMediaBackendFs2Private |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
180 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
181 | PurpleMedia *media; |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
182 | GstElement *confbin; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
183 | FsConference *conference; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
184 | gchar *conference_type; |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
185 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
186 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
187 | FsElementAddedNotifier *notifier; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
188 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
189 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
190 | GHashTable *sessions; |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
191 | GHashTable *participants; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
192 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
193 | GList *streams; |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
194 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
195 | gdouble silence_threshold; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
196 | }; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
197 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
198 | enum { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
199 | PROP_0, |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
200 | PROP_CONFERENCE_TYPE, |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
201 | PROP_MEDIA, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
202 | }; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
203 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
204 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
205 | purple_media_backend_fs2_init(PurpleMediaBackendFs2 *self) |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
206 | {} |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
207 | |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
208 | static FsCandidateType |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
209 | purple_media_candidate_type_to_fs(PurpleMediaCandidateType type) |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
210 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
211 | switch (type) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
212 | case PURPLE_MEDIA_CANDIDATE_TYPE_HOST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
213 | return FS_CANDIDATE_TYPE_HOST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
214 | case PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
215 | return FS_CANDIDATE_TYPE_SRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
216 | case PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
217 | return FS_CANDIDATE_TYPE_PRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
218 | case PURPLE_MEDIA_CANDIDATE_TYPE_RELAY: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
219 | return FS_CANDIDATE_TYPE_RELAY; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
220 | case PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
221 | return FS_CANDIDATE_TYPE_MULTICAST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
222 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
223 | g_return_val_if_reached(FS_CANDIDATE_TYPE_HOST); |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
224 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
225 | |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
226 | static PurpleMediaCandidateType |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
227 | purple_media_candidate_type_from_fs(FsCandidateType type) |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
228 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
229 | switch (type) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
230 | case FS_CANDIDATE_TYPE_HOST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
231 | return PURPLE_MEDIA_CANDIDATE_TYPE_HOST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
232 | case FS_CANDIDATE_TYPE_SRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
233 | return PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
234 | case FS_CANDIDATE_TYPE_PRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
235 | return PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
236 | case FS_CANDIDATE_TYPE_RELAY: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
237 | return PURPLE_MEDIA_CANDIDATE_TYPE_RELAY; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
238 | case FS_CANDIDATE_TYPE_MULTICAST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
239 | return PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
240 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
241 | g_return_val_if_reached(PURPLE_MEDIA_CANDIDATE_TYPE_HOST); |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
242 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
243 | |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
244 | static FsNetworkProtocol |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
245 | purple_media_network_protocol_to_fs(PurpleMediaNetworkProtocol protocol) |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
246 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
247 | switch (protocol) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
248 | case PURPLE_MEDIA_NETWORK_PROTOCOL_UDP: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
249 | return FS_NETWORK_PROTOCOL_UDP; |
|
36317
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
250 | #if GST_CHECK_VERSION(1,0,0) |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
251 | case PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_PASSIVE: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
252 | return FS_NETWORK_PROTOCOL_TCP_PASSIVE; |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
253 | case PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_ACTIVE: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
254 | return FS_NETWORK_PROTOCOL_TCP_ACTIVE; |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
255 | case PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_SO: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
256 | return FS_NETWORK_PROTOCOL_TCP_SO; |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
257 | #endif |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
258 | default: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
259 | g_return_val_if_reached(FS_NETWORK_PROTOCOL_TCP); |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
260 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
261 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
262 | |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
263 | static PurpleMediaNetworkProtocol |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
264 | purple_media_network_protocol_from_fs(FsNetworkProtocol protocol) |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
265 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
266 | switch (protocol) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
267 | case FS_NETWORK_PROTOCOL_UDP: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
268 | return PURPLE_MEDIA_NETWORK_PROTOCOL_UDP; |
|
36317
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
269 | #if GST_CHECK_VERSION(1,0,0) |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
270 | case FS_NETWORK_PROTOCOL_TCP_PASSIVE: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
271 | return PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_PASSIVE; |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
272 | case FS_NETWORK_PROTOCOL_TCP_ACTIVE: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
273 | return PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_ACTIVE; |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
274 | case FS_NETWORK_PROTOCOL_TCP_SO: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
275 | return PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_SO; |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
276 | #endif |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
277 | default: |
|
fcecf7f838e2
Add MS-TURN TCP support
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
278 | g_return_val_if_reached(PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_PASSIVE); |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
279 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
280 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
281 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
282 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
283 | static GstPadProbeReturn |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
284 | event_probe_cb(GstPad *srcpad, GstPadProbeInfo *info, gpointer unused) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
285 | #else |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
286 | static gboolean |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
287 | event_probe_cb(GstPad *srcpad, GstEvent *event, gboolean release_pad) |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
288 | #endif |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
289 | { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
290 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
291 | GstEvent *event = GST_PAD_PROBE_INFO_EVENT(info); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
292 | #endif |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
293 | if (GST_EVENT_TYPE(event) == GST_EVENT_CUSTOM_DOWNSTREAM |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
294 | && gst_event_has_name(event, "purple-unlink-tee")) { |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
295 | |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
296 | const GstStructure *s = gst_event_get_structure(event); |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
297 | |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
298 | gst_pad_unlink(srcpad, gst_pad_get_peer(srcpad)); |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
299 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
300 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
301 | gst_pad_remove_probe(srcpad, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
302 | g_value_get_ulong(gst_structure_get_value(s, "handler-id"))); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
303 | #else |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
304 | gst_pad_remove_event_probe(srcpad, |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
305 | g_value_get_uint(gst_structure_get_value(s, "handler-id"))); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
306 | #endif |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
307 | |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
308 | if (g_value_get_boolean(gst_structure_get_value(s, "release-pad"))) |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
309 | gst_element_release_request_pad(GST_ELEMENT_PARENT(srcpad), srcpad); |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
310 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
311 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
312 | return GST_PAD_PROBE_DROP; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
313 | #else |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
314 | return FALSE; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
315 | #endif |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
316 | } |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
317 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
318 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
319 | return GST_PAD_PROBE_OK; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
320 | #else |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
321 | return TRUE; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
322 | #endif |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
323 | } |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
324 | |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
325 | static void |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
326 | unlink_teepad_dynamic(GstPad *srcpad, gboolean release_pad) |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
327 | { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
328 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
329 | gulong id = gst_pad_add_probe(srcpad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
330 | event_probe_cb, NULL, NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
331 | #else |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
332 | guint id = gst_pad_add_event_probe(srcpad, G_CALLBACK(event_probe_cb), NULL); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
333 | #endif |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
334 | |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
335 | if (GST_IS_GHOST_PAD(srcpad)) |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
336 | srcpad = gst_ghost_pad_get_target(GST_GHOST_PAD(srcpad)); |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
337 | |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
338 | gst_element_send_event(gst_pad_get_parent_element(srcpad), |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
339 | gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM, |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
340 | gst_structure_new("purple-unlink-tee", |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
341 | "release-pad", G_TYPE_BOOLEAN, release_pad, |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
342 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
343 | "handler-id", G_TYPE_ULONG, id, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
344 | #else |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
345 | "handler-id", G_TYPE_UINT, id, |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
346 | #endif |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
347 | NULL))); |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
348 | } |
|
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
349 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
350 | static void |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
351 | purple_media_backend_fs2_dispose(GObject *obj) |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
352 | { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
353 | PurpleMediaBackendFs2Private *priv = |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
354 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj); |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
355 | GList *iter = NULL; |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
356 | |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
357 | purple_debug_info("backend-fs2", "purple_media_backend_fs2_dispose\n"); |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
358 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
359 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
360 | if (priv->notifier) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
361 | g_object_unref(priv->notifier); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
362 | priv->notifier = NULL; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
363 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
364 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
365 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
366 | if (priv->confbin) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
367 | GstElement *pipeline; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
368 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
369 | pipeline = purple_media_manager_get_pipeline( |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
370 | purple_media_get_manager(priv->media)); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
371 | |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
372 | /* All connections to media sources should be blocked before confbin is |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
373 | * removed, to prevent freezing of any other simultaneously running |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
374 | * media calls. */ |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
375 | if (priv->sessions) { |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
376 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
377 | for (; sessions; sessions = |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
378 | g_list_delete_link(sessions, sessions)) { |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
379 | PurpleMediaBackendFs2Session *session = sessions->data; |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
380 | if (session->srcpad) { |
|
31368
ea6ce68f2948
This is a better way to handle ending one call when multiple calls are in
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
381 | unlink_teepad_dynamic(session->srcpad, FALSE); |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
382 | gst_object_unref(session->srcpad); |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
383 | session->srcpad = NULL; |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
384 | } |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
385 | } |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
386 | } |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
387 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
388 | gst_element_set_locked_state(priv->confbin, TRUE); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
389 | gst_element_set_state(GST_ELEMENT(priv->confbin), |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
390 | GST_STATE_NULL); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
391 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
392 | if (pipeline) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
393 | GstBus *bus; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
394 | gst_bin_remove(GST_BIN(pipeline), priv->confbin); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
395 | bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
396 | g_signal_handlers_disconnect_matched(G_OBJECT(bus), |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
397 | G_SIGNAL_MATCH_FUNC | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
398 | G_SIGNAL_MATCH_DATA, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
399 | 0, 0, 0, gst_bus_cb, obj); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
400 | gst_object_unref(bus); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
401 | } else { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
402 | purple_debug_warning("backend-fs2", "Unable to " |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
403 | "properly dispose the conference. " |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
404 | "Couldn't get the pipeline.\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
405 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
406 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
407 | priv->confbin = NULL; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
408 | priv->conference = NULL; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
409 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
410 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
411 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
412 | if (priv->sessions) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
413 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
414 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
415 | for (; sessions; sessions = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
416 | g_list_delete_link(sessions, sessions)) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
417 | PurpleMediaBackendFs2Session *session = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
418 | sessions->data; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
419 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
420 | if (session->session) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
421 | g_object_unref(session->session); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
422 | session->session = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
423 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
424 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
425 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
426 | |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
427 | if (priv->participants) { |
|
30715
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30706
diff
changeset
|
428 | g_hash_table_destroy(priv->participants); |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
429 | priv->participants = NULL; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
430 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
431 | |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
432 | for (iter = priv->streams; iter; iter = g_list_next(iter)) { |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
433 | PurpleMediaBackendFs2Stream *stream = iter->data; |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
434 | if (stream->stream) { |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
435 | g_object_unref(stream->stream); |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
436 | stream->stream = NULL; |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
437 | } |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
438 | } |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
439 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
440 | if (priv->media) { |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
441 | g_object_remove_weak_pointer(G_OBJECT(priv->media), |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
442 | (gpointer*)&priv->media); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
443 | priv->media = NULL; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
444 | } |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
445 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
446 | G_OBJECT_CLASS(purple_media_backend_fs2_parent_class)->dispose(obj); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
447 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
448 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
449 | static void |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
450 | purple_media_backend_fs2_finalize(GObject *obj) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
451 | { |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
452 | PurpleMediaBackendFs2Private *priv = |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
453 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj); |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
454 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
455 | purple_debug_info("backend-fs2", "purple_media_backend_fs2_finalize\n"); |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
456 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
457 | g_free(priv->conference_type); |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
458 | |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
459 | for (; priv->streams; priv->streams = |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
460 | g_list_delete_link(priv->streams, priv->streams)) { |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
461 | PurpleMediaBackendFs2Stream *stream = priv->streams->data; |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
462 | free_stream(stream); |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
463 | } |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
464 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
465 | if (priv->sessions) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
466 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
467 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
468 | for (; sessions; sessions = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
469 | g_list_delete_link(sessions, sessions)) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
470 | PurpleMediaBackendFs2Session *session = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
471 | sessions->data; |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
472 | free_session(session); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
473 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
474 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
475 | g_hash_table_destroy(priv->sessions); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
476 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
477 | |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
478 | G_OBJECT_CLASS(purple_media_backend_fs2_parent_class)->finalize(obj); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
479 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
480 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
481 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
482 | purple_media_backend_fs2_set_property(GObject *object, guint prop_id, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
483 | const GValue *value, GParamSpec *pspec) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
484 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
485 | PurpleMediaBackendFs2Private *priv; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
486 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
487 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
488 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
489 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
490 | switch (prop_id) { |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
491 | case PROP_CONFERENCE_TYPE: |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
492 | priv->conference_type = g_value_dup_string(value); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
493 | break; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
494 | case PROP_MEDIA: |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
495 | priv->media = g_value_get_object(value); |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
496 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
497 | if (priv->media == NULL) |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
498 | break; |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
499 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
500 | g_object_add_weak_pointer(G_OBJECT(priv->media), |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
501 | (gpointer*)&priv->media); |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
502 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
503 | g_signal_connect(G_OBJECT(priv->media), |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
504 | "state-changed", |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
505 | G_CALLBACK(state_changed_cb), |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
506 | PURPLE_MEDIA_BACKEND_FS2(object)); |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
507 | g_signal_connect(G_OBJECT(priv->media), "stream-info", |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
508 | G_CALLBACK(stream_info_cb), |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
509 | PURPLE_MEDIA_BACKEND_FS2(object)); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
510 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
511 | default: |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
512 | G_OBJECT_WARN_INVALID_PROPERTY_ID( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
513 | object, prop_id, pspec); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
514 | break; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
515 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
516 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
517 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
518 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
519 | purple_media_backend_fs2_get_property(GObject *object, guint prop_id, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
520 | GValue *value, GParamSpec *pspec) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
521 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
522 | PurpleMediaBackendFs2Private *priv; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
523 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
524 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
525 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
526 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
527 | switch (prop_id) { |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
528 | case PROP_CONFERENCE_TYPE: |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
529 | g_value_set_string(value, priv->conference_type); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
530 | break; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
531 | case PROP_MEDIA: |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
532 | g_value_set_object(value, priv->media); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
533 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
534 | default: |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
535 | G_OBJECT_WARN_INVALID_PROPERTY_ID( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
536 | object, prop_id, pspec); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
537 | break; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
538 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
539 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
540 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
541 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
542 | purple_media_backend_fs2_class_init(PurpleMediaBackendFs2Class *klass) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
543 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
544 | GObjectClass *gobject_class = (GObjectClass*)klass; |
|
37794
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
545 | GList *features; |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
546 | GList *it; |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
547 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
548 | gobject_class->dispose = purple_media_backend_fs2_dispose; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
549 | gobject_class->finalize = purple_media_backend_fs2_finalize; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
550 | gobject_class->set_property = purple_media_backend_fs2_set_property; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
551 | gobject_class->get_property = purple_media_backend_fs2_get_property; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
552 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
553 | g_object_class_override_property(gobject_class, PROP_CONFERENCE_TYPE, |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
554 | "conference-type"); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
555 | g_object_class_override_property(gobject_class, PROP_MEDIA, "media"); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
556 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
557 | g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private)); |
|
37794
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
558 | |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
559 | /* VA-API elements aren't well supported in Farstream. Ignore them. */ |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
560 | features = gst_registry_get_feature_list_by_plugin(gst_registry_get(), |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
561 | "vaapi"); |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
562 | for (it = features; it; it = it->next) { |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
563 | gst_plugin_feature_set_rank((GstPluginFeature *)it->data, |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
564 | GST_RANK_NONE); |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
565 | } |
|
1645cfba41c8
media: don't let Farstream use VA-API elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36343
diff
changeset
|
566 | gst_plugin_feature_list_free(features); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
567 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
568 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
569 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
570 | purple_media_backend_iface_init(PurpleMediaBackendIface *iface) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
571 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
572 | iface->add_stream = purple_media_backend_fs2_add_stream; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
573 | iface->add_remote_candidates = |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
574 | purple_media_backend_fs2_add_remote_candidates; |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
575 | iface->codecs_ready = purple_media_backend_fs2_codecs_ready; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
576 | iface->get_codecs = purple_media_backend_fs2_get_codecs; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
577 | iface->get_local_candidates = |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
578 | purple_media_backend_fs2_get_local_candidates; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
579 | iface->set_remote_codecs = purple_media_backend_fs2_set_remote_codecs; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
580 | iface->set_send_codec = purple_media_backend_fs2_set_send_codec; |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
581 | #if GST_CHECK_VERSION(1,0,0) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
582 | iface->set_encryption_parameters = |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
583 | purple_media_backend_fs2_set_encryption_parameters; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
584 | iface->set_decryption_parameters = |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
585 | purple_media_backend_fs2_set_decryption_parameters; |
|
39717
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
586 | iface->set_require_encryption = |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
587 | purple_media_backend_fs2_set_require_encryption; |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
588 | #endif |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
589 | iface->set_params = purple_media_backend_fs2_set_params; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
590 | iface->get_available_params = purple_media_backend_fs2_get_available_params; |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
591 | iface->send_dtmf = purple_media_backend_fs2_send_dtmf; |
|
36321
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
592 | iface->set_send_rtcp_mux = purple_media_backend_fs2_set_send_rtcp_mux; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
593 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
594 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
595 | static FsMediaType |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
596 | session_type_to_fs_media_type(PurpleMediaSessionType type) |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
597 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
598 | if (type & PURPLE_MEDIA_AUDIO) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
599 | return FS_MEDIA_TYPE_AUDIO; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
600 | else if (type & PURPLE_MEDIA_VIDEO) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
601 | return FS_MEDIA_TYPE_VIDEO; |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
602 | #ifdef HAVE_MEDIA_APPLICATION |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
603 | else if (type & PURPLE_MEDIA_APPLICATION) |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
604 | return FS_MEDIA_TYPE_APPLICATION; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
605 | #endif |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
606 | else |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
607 | return 0; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
608 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
609 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
610 | static FsStreamDirection |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
611 | session_type_to_fs_stream_direction(PurpleMediaSessionType type) |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
612 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
613 | if ((type & PURPLE_MEDIA_AUDIO) == PURPLE_MEDIA_AUDIO || |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
614 | (type & PURPLE_MEDIA_VIDEO) == PURPLE_MEDIA_VIDEO) |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
615 | return FS_DIRECTION_BOTH; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
616 | else if ((type & PURPLE_MEDIA_SEND_AUDIO) || |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
617 | (type & PURPLE_MEDIA_SEND_VIDEO)) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
618 | return FS_DIRECTION_SEND; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
619 | else if ((type & PURPLE_MEDIA_RECV_AUDIO) || |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
620 | (type & PURPLE_MEDIA_RECV_VIDEO)) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
621 | return FS_DIRECTION_RECV; |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
622 | #ifdef HAVE_MEDIA_APPLICATION |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
623 | else if ((type & PURPLE_MEDIA_APPLICATION) == PURPLE_MEDIA_APPLICATION) |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
624 | return FS_DIRECTION_BOTH; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
625 | else if (type & PURPLE_MEDIA_SEND_APPLICATION) |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
626 | return FS_DIRECTION_SEND; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
627 | else if (type & PURPLE_MEDIA_RECV_APPLICATION) |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
628 | return FS_DIRECTION_RECV; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
629 | #endif |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
630 | else |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
631 | return FS_DIRECTION_NONE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
632 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
633 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
634 | static PurpleMediaSessionType |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
635 | session_type_from_fs(FsMediaType type, FsStreamDirection direction) |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
636 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
637 | PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
638 | if (type == FS_MEDIA_TYPE_AUDIO) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
639 | if (direction & FS_DIRECTION_SEND) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
640 | result |= PURPLE_MEDIA_SEND_AUDIO; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
641 | if (direction & FS_DIRECTION_RECV) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
642 | result |= PURPLE_MEDIA_RECV_AUDIO; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
643 | } else if (type == FS_MEDIA_TYPE_VIDEO) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
644 | if (direction & FS_DIRECTION_SEND) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
645 | result |= PURPLE_MEDIA_SEND_VIDEO; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
646 | if (direction & FS_DIRECTION_RECV) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
647 | result |= PURPLE_MEDIA_RECV_VIDEO; |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
648 | #ifdef HAVE_MEDIA_APPLICATION |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
649 | } else if (type == FS_MEDIA_TYPE_APPLICATION) { |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
650 | if (direction & FS_DIRECTION_SEND) |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
651 | result |= PURPLE_MEDIA_SEND_APPLICATION; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
652 | if (direction & FS_DIRECTION_RECV) |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
653 | result |= PURPLE_MEDIA_RECV_APPLICATION; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
654 | #endif |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
655 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
656 | return result; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
657 | } |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
658 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
659 | static FsCandidate * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
660 | candidate_to_fs(PurpleMediaCandidate *candidate) |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
661 | { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
662 | FsCandidate *fscandidate; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
663 | gchar *foundation; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
664 | guint component_id; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
665 | gchar *ip; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
666 | guint port; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
667 | gchar *base_ip; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
668 | guint base_port; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
669 | PurpleMediaNetworkProtocol proto; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
670 | guint32 priority; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
671 | PurpleMediaCandidateType type; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
672 | gchar *username; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
673 | gchar *password; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
674 | guint ttl; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
675 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
676 | if (candidate == NULL) |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
677 | return NULL; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
678 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
679 | g_object_get(G_OBJECT(candidate), |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
680 | "foundation", &foundation, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
681 | "component-id", &component_id, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
682 | "ip", &ip, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
683 | "port", &port, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
684 | "base-ip", &base_ip, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
685 | "base-port", &base_port, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
686 | "protocol", &proto, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
687 | "priority", &priority, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
688 | "type", &type, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
689 | "username", &username, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
690 | "password", &password, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
691 | "ttl", &ttl, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
692 | NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
693 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
694 | fscandidate = fs_candidate_new(foundation, |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
695 | component_id, purple_media_candidate_type_to_fs(type), |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
696 | purple_media_network_protocol_to_fs(proto), ip, port); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
697 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
698 | fscandidate->base_ip = base_ip; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
699 | fscandidate->base_port = base_port; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
700 | fscandidate->priority = priority; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
701 | fscandidate->username = username; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
702 | fscandidate->password = password; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
703 | fscandidate->ttl = ttl; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
704 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
705 | g_free(foundation); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
706 | g_free(ip); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
707 | return fscandidate; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
708 | } |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
709 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
710 | static GList * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
711 | candidate_list_to_fs(GList *candidates) |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
712 | { |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
713 | GList *new_list = NULL; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
714 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
715 | for (; candidates; candidates = g_list_next(candidates)) { |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
716 | new_list = g_list_prepend(new_list, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
717 | candidate_to_fs(candidates->data)); |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
718 | } |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
719 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
720 | new_list = g_list_reverse(new_list); |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
721 | return new_list; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
722 | } |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
723 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
724 | static PurpleMediaCandidate * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
725 | candidate_from_fs(FsCandidate *fscandidate) |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
726 | { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
727 | PurpleMediaCandidate *candidate; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
728 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
729 | if (fscandidate == NULL) |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
730 | return NULL; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
731 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
732 | candidate = purple_media_candidate_new(fscandidate->foundation, |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
733 | fscandidate->component_id, |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
734 | purple_media_candidate_type_from_fs(fscandidate->type), |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
735 | purple_media_network_protocol_from_fs(fscandidate->proto), |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
736 | fscandidate->ip, fscandidate->port); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
737 | g_object_set(candidate, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
738 | "base-ip", fscandidate->base_ip, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
739 | "base-port", fscandidate->base_port, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
740 | "priority", fscandidate->priority, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
741 | "username", fscandidate->username, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
742 | "password", fscandidate->password, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
743 | "ttl", fscandidate->ttl, NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
744 | return candidate; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
745 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
746 | |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
747 | static GList * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
748 | candidate_list_from_fs(GList *candidates) |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
749 | { |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
750 | GList *new_list = NULL; |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
751 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
752 | for (; candidates; candidates = g_list_next(candidates)) { |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
753 | new_list = g_list_prepend(new_list, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
754 | candidate_from_fs(candidates->data)); |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
755 | } |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
756 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
757 | new_list = g_list_reverse(new_list); |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
758 | return new_list; |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
759 | } |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
760 | |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
761 | static FsCodec * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
762 | codec_to_fs(const PurpleMediaCodec *codec) |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
763 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
764 | FsCodec *new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
765 | gint id; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
766 | char *encoding_name; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
767 | PurpleMediaSessionType media_type; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
768 | guint clock_rate; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
769 | guint channels; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
770 | GList *iter; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
771 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
772 | if (codec == NULL) |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
773 | return NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
774 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
775 | g_object_get(G_OBJECT(codec), |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
776 | "id", &id, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
777 | "encoding-name", &encoding_name, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
778 | "media-type", &media_type, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
779 | "clock-rate", &clock_rate, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
780 | "channels", &channels, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
781 | "optional-params", &iter, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
782 | NULL); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
783 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
784 | new_codec = fs_codec_new(id, encoding_name, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
785 | session_type_to_fs_media_type(media_type), |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
786 | clock_rate); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
787 | new_codec->channels = channels; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
788 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
789 | for (; iter; iter = g_list_next(iter)) { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
790 | PurpleKeyValuePair *param = (PurpleKeyValuePair*)iter->data; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
791 | fs_codec_add_optional_parameter(new_codec, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
792 | param->key, param->value); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
793 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
794 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
795 | g_free(encoding_name); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
796 | return new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
797 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
798 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
799 | static PurpleMediaCodec * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
800 | codec_from_fs(const FsCodec *codec) |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
801 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
802 | PurpleMediaCodec *new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
803 | GList *iter; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
804 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
805 | if (codec == NULL) |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
806 | return NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
807 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
808 | new_codec = purple_media_codec_new(codec->id, codec->encoding_name, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
809 | session_type_from_fs(codec->media_type, |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
810 | FS_DIRECTION_BOTH), codec->clock_rate); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
811 | g_object_set(new_codec, "channels", codec->channels, NULL); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
812 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
813 | for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
814 | FsCodecParameter *param = (FsCodecParameter*)iter->data; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
815 | purple_media_codec_add_optional_parameter(new_codec, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
816 | param->name, param->value); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
817 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
818 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
819 | return new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
820 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
821 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
822 | static GList * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
823 | codec_list_from_fs(GList *codecs) |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
824 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
825 | GList *new_list = NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
826 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
827 | for (; codecs; codecs = g_list_next(codecs)) { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
828 | new_list = g_list_prepend(new_list, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
829 | codec_from_fs(codecs->data)); |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
830 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
831 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
832 | new_list = g_list_reverse(new_list); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
833 | return new_list; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
834 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
835 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
836 | static GList * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
837 | codec_list_to_fs(GList *codecs) |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
838 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
839 | GList *new_list = NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
840 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
841 | for (; codecs; codecs = g_list_next(codecs)) { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
842 | new_list = g_list_prepend(new_list, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
843 | codec_to_fs(codecs->data)); |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
844 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
845 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
846 | new_list = g_list_reverse(new_list); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
847 | return new_list; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
848 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
849 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
850 | static PurpleMediaBackendFs2Session * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
851 | get_session(PurpleMediaBackendFs2 *self, const gchar *sess_id) |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
852 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
853 | PurpleMediaBackendFs2Private *priv; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
854 | PurpleMediaBackendFs2Session *session = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
855 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
856 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
857 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
858 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
859 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
860 | if (priv->sessions != NULL) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
861 | session = g_hash_table_lookup(priv->sessions, sess_id); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
862 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
863 | return session; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
864 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
865 | |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
866 | static FsParticipant * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
867 | get_participant(PurpleMediaBackendFs2 *self, const gchar *name) |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
868 | { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
869 | PurpleMediaBackendFs2Private *priv; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
870 | FsParticipant *participant = NULL; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
871 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
872 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
873 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
874 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
875 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
876 | if (priv->participants != NULL) |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
877 | participant = g_hash_table_lookup(priv->participants, name); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
878 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
879 | return participant; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
880 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
881 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
882 | static PurpleMediaBackendFs2Stream * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
883 | get_stream(PurpleMediaBackendFs2 *self, |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
884 | const gchar *sess_id, const gchar *name) |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
885 | { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
886 | PurpleMediaBackendFs2Private *priv; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
887 | GList *streams; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
888 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
889 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
890 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
891 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
892 | streams = priv->streams; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
893 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
894 | for (; streams; streams = g_list_next(streams)) { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
895 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
896 | if (purple_strequal(stream->session->id, sess_id) && |
|
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
897 | purple_strequal(stream->participant, name)) |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
898 | return stream; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
899 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
900 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
901 | return NULL; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
902 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
903 | |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
904 | static GList * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
905 | get_streams(PurpleMediaBackendFs2 *self, |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
906 | const gchar *sess_id, const gchar *name) |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
907 | { |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
908 | PurpleMediaBackendFs2Private *priv; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
909 | GList *streams, *ret = NULL; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
910 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
911 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
912 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
913 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
914 | streams = priv->streams; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
915 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
916 | for (; streams; streams = g_list_next(streams)) { |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
917 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
918 | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
919 | if (sess_id != NULL && !purple_strequal(stream->session->id, sess_id)) |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
920 | continue; |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
921 | else if (name != NULL && !purple_strequal(stream->participant, name)) |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
922 | continue; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
923 | else |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
924 | ret = g_list_prepend(ret, stream); |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
925 | } |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
926 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
927 | ret = g_list_reverse(ret); |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
928 | return ret; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
929 | } |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
930 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
931 | static PurpleMediaBackendFs2Session * |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
932 | get_session_from_fs_stream(PurpleMediaBackendFs2 *self, FsStream *stream) |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
933 | { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
934 | PurpleMediaBackendFs2Private *priv = |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
935 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
936 | FsSession *fssession; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
937 | GList *values; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
938 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
939 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
940 | g_return_val_if_fail(FS_IS_STREAM(stream), NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
941 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
942 | g_object_get(stream, "session", &fssession, NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
943 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
944 | values = g_hash_table_get_values(priv->sessions); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
945 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
946 | for (; values; values = g_list_delete_link(values, values)) { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
947 | PurpleMediaBackendFs2Session *session = values->data; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
948 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
949 | if (session->session == fssession) { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
950 | g_list_free(values); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
951 | g_object_unref(fssession); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
952 | return session; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
953 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
954 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
955 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
956 | g_object_unref(fssession); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
957 | return NULL; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
958 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
959 | |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
960 | static gdouble |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
961 | gst_msg_db_to_percent(GstMessage *msg, gchar *value_name) |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
962 | { |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
963 | const GValue *list; |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
964 | const GValue *value; |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
965 | gdouble value_db; |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
966 | gdouble percent; |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
967 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
968 | list = gst_structure_get_value(gst_message_get_structure(msg), value_name); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
969 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
970 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
971 | value = g_value_array_get_nth(g_value_get_boxed(list), 0); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
972 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
973 | #else |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
974 | value = gst_value_list_get_value(list, 0); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
975 | #endif |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
976 | value_db = g_value_get_double(value); |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
977 | percent = pow(10, value_db / 20); |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
978 | return (percent > 1.0) ? 1.0 : percent; |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
979 | } |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
980 | |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
981 | static void |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
982 | purple_media_error_fs(PurpleMedia *media, const gchar *error, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
983 | const GstStructure *fs_error) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
984 | { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
985 | const gchar *error_msg = gst_structure_get_string(fs_error, "error-msg"); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
986 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
987 | purple_media_error(media, "%s%s%s", error, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
988 | error_msg ? _("\n\nMessage from Farsight: ") : "", |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
989 | error_msg ? error_msg : ""); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
990 | } |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
991 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
992 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
993 | gst_handle_message_element(GstBus *bus, GstMessage *msg, |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
994 | PurpleMediaBackendFs2 *self) |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
995 | { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
996 | PurpleMediaBackendFs2Private *priv = |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
997 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
998 | GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
999 | static guint level_id = 0; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1000 | const GstStructure *structure = gst_message_get_structure(msg); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1001 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1002 | if (level_id == 0) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1003 | level_id = g_signal_lookup("level", PURPLE_TYPE_MEDIA); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1004 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1005 | if (gst_structure_has_name(structure, "level")) { |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1006 | GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1007 | gchar *name; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1008 | gchar *participant = NULL; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1009 | PurpleMediaBackendFs2Session *session = NULL; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1010 | gdouble percent; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1011 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1012 | if (!PURPLE_IS_MEDIA(priv->media) || |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1013 | GST_ELEMENT_PARENT(src) != priv->confbin) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1014 | return; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1015 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1016 | name = gst_element_get_name(src); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1017 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1018 | if (!strncmp(name, "sendlevel_", 10)) { |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1019 | session = get_session(self, name+10); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1020 | if (priv->silence_threshold > 0) { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1021 | percent = gst_msg_db_to_percent(msg, "decay"); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1022 | g_object_set(session->srcvalve, |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1023 | "drop", (percent < priv->silence_threshold), NULL); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1024 | } |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1025 | } |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1026 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1027 | g_free(name); |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1028 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1029 | if (!g_signal_has_handler_pending(priv->media, level_id, 0, FALSE)) |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1030 | return; |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1031 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1032 | if (!session) { |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1033 | GList *iter = priv->streams; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1034 | PurpleMediaBackendFs2Stream *stream; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1035 | for (; iter; iter = g_list_next(iter)) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1036 | stream = iter->data; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1037 | if (stream->level == src) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1038 | session = stream->session; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1039 | participant = stream->participant; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1040 | break; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1041 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1042 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1043 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1044 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1045 | if (!session) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1046 | return; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1047 | |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1048 | percent = gst_msg_db_to_percent(msg, "rms"); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1049 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1050 | g_signal_emit(priv->media, level_id, 0, |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1051 | session->id, participant, percent); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1052 | return; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1053 | } |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1054 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1055 | if (!FS_IS_CONFERENCE(src) || !PURPLE_IS_MEDIA_BACKEND(self) || |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1056 | priv->conference != FS_CONFERENCE(src)) |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1057 | return; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1058 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1059 | #ifdef HAVE_FARSIGHT |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1060 | if (gst_structure_has_name(structure, "farsight-error")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1061 | #else |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1062 | if (gst_structure_has_name(structure, "farstream-error")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1063 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1064 | FsError error_no; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1065 | gboolean error_emitted = FALSE; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1066 | gst_structure_get_enum(structure, "error-no", |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1067 | FS_TYPE_ERROR, (gint*)&error_no); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1068 | switch (error_no) { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1069 | case FS_ERROR_CONSTRUCTION: |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1070 | purple_media_error_fs(priv->media, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1071 | _("Error initializing the call. " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1072 | "This probably denotes problem in " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1073 | #ifdef HAVE_FARSIGHT |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1074 | "installation of GStreamer or Farsight."), |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1075 | #else |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1076 | "installation of GStreamer or Farstream."), |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1077 | #endif |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1078 | structure); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1079 | error_emitted = TRUE; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1080 | break; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1081 | case FS_ERROR_NETWORK: |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1082 | purple_media_error_fs(priv->media, _("Network error."), |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1083 | structure); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1084 | error_emitted = TRUE; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1085 | purple_media_end(priv->media, NULL, NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1086 | break; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1087 | case FS_ERROR_NEGOTIATION_FAILED: |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1088 | purple_media_error_fs(priv->media, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1089 | _("Codec negotiation failed. " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1090 | "This problem might be resolved by installing " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1091 | "more GStreamer codecs."), |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1092 | structure); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1093 | error_emitted = TRUE; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1094 | purple_media_end(priv->media, NULL, NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1095 | break; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1096 | case FS_ERROR_NO_CODECS: |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1097 | purple_media_error(priv->media, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1098 | _("No codecs found. " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1099 | "Install some GStreamer codecs found " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1100 | "in GStreamer plugins packages.")); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1101 | error_emitted = TRUE; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1102 | purple_media_end(priv->media, NULL, NULL); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1103 | break; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1104 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1105 | case FS_ERROR_NO_CODECS_LEFT: |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1106 | purple_media_error(priv->media, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1107 | _("No codecs left. Your codec preferences " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1108 | "in fs-codecs.conf are too strict.")); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1109 | error_emitted = TRUE; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1110 | purple_media_end(priv->media, NULL, NULL); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1111 | break; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1112 | case FS_ERROR_CONNECTION_FAILED: |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1113 | purple_media_error(priv->media, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1114 | _("Could not connect to the remote party")); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1115 | error_emitted = TRUE; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1116 | break; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1117 | case FS_ERROR_UNKNOWN_CNAME: |
|
32110
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
1118 | /* |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
1119 | * Unknown CName is only a problem for the |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
1120 | * multicast transmitter which isn't used. |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
1121 | * It is also deprecated. |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
1122 | */ |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1123 | break; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1124 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1125 | default: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1126 | purple_debug_error("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1127 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1128 | "farsight-error: %i: %s\n", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1129 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1130 | "farstream-error: %i: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1131 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1132 | error_no, |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1133 | gst_structure_get_string(structure, "error-msg")); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1134 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1135 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1136 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1137 | if (FS_ERROR_IS_FATAL(error_no)) { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1138 | if (!error_emitted) |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1139 | #ifdef HAVE_FARSIGHT |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1140 | purple_media_error(priv->media, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1141 | _("A non-recoverable Farsight2 error has occurred.")); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1142 | #else |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1143 | purple_media_error(priv->media, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1144 | _("A non-recoverable Farstream error has occurred.")); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1145 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1146 | purple_media_end(priv->media, NULL, NULL); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1147 | } |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1148 | } else if (gst_structure_has_name(structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1149 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1150 | "farsight-new-local-candidate")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1151 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1152 | "farstream-new-local-candidate")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1153 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1154 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1155 | FsStream *stream; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1156 | FsCandidate *local_candidate; |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1157 | PurpleMediaCandidate *candidate; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1158 | FsParticipant *participant; |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1159 | PurpleMediaBackendFs2Session *session; |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
1160 | PurpleMediaBackendFs2Stream *media_stream; |
|
38731
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1161 | const gchar *name; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1162 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1163 | value = gst_structure_get_value(structure, "stream"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1164 | stream = g_value_get_object(value); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1165 | value = gst_structure_get_value(structure, "candidate"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1166 | local_candidate = g_value_get_boxed(value); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1167 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1168 | session = get_session_from_fs_stream(self, stream); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1169 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1170 | purple_debug_info("backend-fs2", |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1171 | "got new local candidate: %s\n", |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1172 | local_candidate->foundation); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1173 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1174 | g_object_get(stream, "participant", &participant, NULL); |
|
38731
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1175 | name = g_object_get_data(G_OBJECT(participant), "purple-name"); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1176 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1177 | media_stream = get_stream(self, session->id, name); |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
1178 | media_stream->local_candidates = g_list_append( |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
1179 | media_stream->local_candidates, |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1180 | fs_candidate_copy(local_candidate)); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1181 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1182 | candidate = candidate_from_fs(local_candidate); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1183 | g_signal_emit_by_name(self, "new-candidate", |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1184 | session->id, name, candidate); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1185 | g_object_unref(candidate); |
|
38731
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1186 | g_object_unref(participant); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1187 | } else if (gst_structure_has_name(structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1188 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1189 | "farsight-local-candidates-prepared")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1190 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1191 | "farstream-local-candidates-prepared")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1192 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1193 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1194 | FsStream *stream; |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1195 | FsParticipant *participant; |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1196 | PurpleMediaBackendFs2Session *session; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1197 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1198 | value = gst_structure_get_value(structure, "stream"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1199 | stream = g_value_get_object(value); |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1200 | session = get_session_from_fs_stream(self, stream); |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1201 | |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1202 | g_object_get(stream, "participant", &participant, NULL); |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1203 | |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1204 | g_signal_emit_by_name(self, "candidates-prepared", |
|
38731
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1205 | session->id, |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1206 | g_object_get_data(G_OBJECT(participant), "purple-name")); |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1207 | |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1208 | g_object_unref(participant); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1209 | } else if (gst_structure_has_name(structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1210 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1211 | "farsight-new-active-candidate-pair")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1212 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1213 | "farstream-new-active-candidate-pair")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1214 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1215 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1216 | FsStream *stream; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1217 | FsCandidate *local_candidate; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1218 | FsCandidate *remote_candidate; |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1219 | FsParticipant *participant; |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1220 | PurpleMediaBackendFs2Session *session; |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1221 | PurpleMediaCandidate *lcandidate, *rcandidate; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1222 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1223 | value = gst_structure_get_value(structure, "stream"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1224 | stream = g_value_get_object(value); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1225 | value = gst_structure_get_value(structure, "local-candidate"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1226 | local_candidate = g_value_get_boxed(value); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1227 | value = gst_structure_get_value(structure, "remote-candidate"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1228 | remote_candidate = g_value_get_boxed(value); |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1229 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1230 | g_object_get(stream, "participant", &participant, NULL); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1231 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1232 | session = get_session_from_fs_stream(self, stream); |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1233 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1234 | lcandidate = candidate_from_fs(local_candidate); |
|
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1235 | rcandidate = candidate_from_fs(remote_candidate); |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1236 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1237 | g_signal_emit_by_name(self, "active-candidate-pair", |
|
38731
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1238 | session->id, |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1239 | g_object_get_data(G_OBJECT(participant), "purple-name"), |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1240 | lcandidate, rcandidate); |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1241 | |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
1242 | g_object_unref(participant); |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1243 | g_object_unref(lcandidate); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1244 | g_object_unref(rcandidate); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1245 | } else if (gst_structure_has_name(structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1246 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1247 | "farsight-recv-codecs-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1248 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1249 | "farstream-recv-codecs-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1250 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1251 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1252 | GList *codecs; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1253 | FsCodec *codec; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1254 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1255 | value = gst_structure_get_value(structure, "codecs"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1256 | codecs = g_value_get_boxed(value); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1257 | codec = codecs->data; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1258 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1259 | purple_debug_info("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1260 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1261 | "farsight-recv-codecs-changed: %s\n", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1262 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1263 | "farstream-recv-codecs-changed: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1264 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1265 | codec->encoding_name); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1266 | } else if (gst_structure_has_name(structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1267 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1268 | "farsight-component-state-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1269 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1270 | "farstream-component-state-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1271 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1272 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1273 | FsStreamState fsstate; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1274 | guint component; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1275 | const gchar *state; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1276 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1277 | value = gst_structure_get_value(structure, "state"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1278 | fsstate = g_value_get_enum(value); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1279 | value = gst_structure_get_value(structure, "component"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1280 | component = g_value_get_uint(value); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1281 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1282 | switch (fsstate) { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1283 | case FS_STREAM_STATE_FAILED: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1284 | state = "FAILED"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1285 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1286 | case FS_STREAM_STATE_DISCONNECTED: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1287 | state = "DISCONNECTED"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1288 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1289 | case FS_STREAM_STATE_GATHERING: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1290 | state = "GATHERING"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1291 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1292 | case FS_STREAM_STATE_CONNECTING: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1293 | state = "CONNECTING"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1294 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1295 | case FS_STREAM_STATE_CONNECTED: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1296 | state = "CONNECTED"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1297 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1298 | case FS_STREAM_STATE_READY: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1299 | state = "READY"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1300 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1301 | default: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1302 | state = "UNKNOWN"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1303 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1304 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1305 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1306 | purple_debug_info("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1307 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1308 | "farsight-component-state-changed: " |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1309 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1310 | "farstream-component-state-changed: " |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1311 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1312 | "component: %u state: %s\n", |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1313 | component, state); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1314 | } else if (gst_structure_has_name(structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1315 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1316 | "farsight-send-codec-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1317 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1318 | "farstream-send-codec-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1319 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1320 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1321 | FsCodec *codec; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1322 | gchar *codec_str; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1323 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1324 | value = gst_structure_get_value(structure, "codec"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1325 | codec = g_value_get_boxed(value); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1326 | codec_str = fs_codec_to_string(codec); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1327 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1328 | purple_debug_info("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1329 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1330 | "farsight-send-codec-changed: codec: %s\n", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1331 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1332 | "farstream-send-codec-changed: codec: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1333 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1334 | codec_str); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1335 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1336 | g_free(codec_str); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1337 | } else if (gst_structure_has_name(structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1338 | #ifdef HAVE_FARSIGHT |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1339 | "farsight-codecs-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1340 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1341 | "farstream-codecs-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1342 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1343 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1344 | FsSession *fssession; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1345 | GList *sessions; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1346 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1347 | value = gst_structure_get_value(structure, "session"); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1348 | fssession = g_value_get_object(value); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1349 | sessions = g_hash_table_get_values(priv->sessions); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1350 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1351 | for (; sessions; sessions = |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1352 | g_list_delete_link(sessions, sessions)) { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1353 | PurpleMediaBackendFs2Session *session = sessions->data; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1354 | gchar *session_id; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1355 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1356 | if (session->session != fssession) |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1357 | continue; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1358 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1359 | session_id = g_strdup(session->id); |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1360 | g_signal_emit_by_name(self, "codecs-changed", |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1361 | session_id); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1362 | g_free(session_id); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1363 | g_list_free(sessions); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1364 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1365 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1366 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1367 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1368 | |
|
38945
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1369 | static gboolean |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1370 | downgrade_video_source(PurpleMediaBackendFs2 *self, GstBin *srcbin) |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1371 | { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1372 | PurpleMediaBackendFs2Private *priv; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1373 | GstElement *src; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1374 | GstPad *srcpad = NULL; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1375 | GstPad *p; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1376 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1377 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1378 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1379 | src = gst_bin_get_by_name(srcbin, "purplevideodowngrade"); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1380 | if (src) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1381 | /* The failing source has already been downgraded. Stop here in |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1382 | * order not to cause an infinite loop. */ |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1383 | gst_object_unref(src); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1384 | return FALSE; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1385 | } |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1386 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1387 | src = gst_bin_get_by_name(srcbin, "tee"); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1388 | if (!src) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1389 | return FALSE; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1390 | } |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1391 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1392 | while((p = gst_element_get_static_pad(src, "sink"))) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1393 | if (srcpad) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1394 | gst_object_unref(srcpad); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1395 | } |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1396 | srcpad = gst_pad_get_peer(p); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1397 | gst_object_unref(src); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1398 | src = gst_pad_get_parent_element(srcpad); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1399 | gst_object_unref(p); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1400 | }; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1401 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1402 | if (srcpad) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1403 | PurpleMediaManager *manager; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1404 | GstElement *pipeline; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1405 | GstElement *dest; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1406 | GstElement *newsrc; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1407 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1408 | manager = purple_media_get_manager(priv->media); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1409 | pipeline = purple_media_manager_get_pipeline(manager); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1410 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1411 | dest = gst_pad_get_parent_element(GST_PAD_PEER(srcpad)); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1412 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1413 | remove_element(src); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1414 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1415 | newsrc = gst_element_factory_make("videotestsrc", |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1416 | "purplevideodowngrade"); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1417 | g_object_set(newsrc, "is-live", TRUE, NULL); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1418 | gst_bin_add_many(srcbin, newsrc, NULL); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1419 | gst_element_link(newsrc, dest); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1420 | gst_element_set_state(newsrc, GST_STATE_PLAYING); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1421 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1422 | /* Pipeline with an error might not be any longer PLAYING. */ |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1423 | gst_element_set_state(pipeline, GST_STATE_PLAYING); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1424 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1425 | gst_object_unref(srcpad); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1426 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1427 | /* Flush the video pipeline. */ |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1428 | srcpad = gst_element_get_static_pad(newsrc, "src"); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1429 | gst_pad_push_event(srcpad, gst_event_new_flush_start()); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1430 | #if GST_CHECK_VERSION(1,0,0) |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1431 | gst_pad_push_event(srcpad, gst_event_new_flush_stop(FALSE)); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1432 | #else |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1433 | gst_pad_push_event(srcpad, gst_event_new_flush_stop()); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1434 | #endif |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1435 | gst_object_unref(srcpad); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1436 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1437 | gst_object_unref(dest); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1438 | } |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1439 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1440 | gst_object_unref(src); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1441 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1442 | return TRUE; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1443 | } |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1444 | |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1445 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1446 | gst_handle_message_error(GstBus *bus, GstMessage *msg, |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1447 | PurpleMediaBackendFs2 *self) |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1448 | { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1449 | PurpleMediaBackendFs2Private *priv = |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1450 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1451 | GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1452 | GstElement *lastElement = NULL; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1453 | GList *sessions; |
|
38945
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1454 | gboolean fatal = TRUE; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1455 | |
|
31807
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1456 | GError *error = NULL; |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1457 | gchar *debug_msg = NULL; |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1458 | |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1459 | gst_message_parse_error(msg, &error, &debug_msg); |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1460 | purple_debug_error("backend-fs2", "gst error %s\ndebugging: %s\n", |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1461 | error->message, debug_msg); |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1462 | |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1463 | g_error_free(error); |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1464 | g_free(debug_msg); |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1465 | |
|
31824
6942cb72f357
media/backend-fs2: Better fix for the NULL deref crash here.
Paul Aurich <darkrain42@pidgin.im>
parents:
31807
diff
changeset
|
1466 | while (element && !GST_IS_PIPELINE(element)) { |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1467 | if (element == priv->confbin) |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1468 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1469 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1470 | lastElement = element; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1471 | element = GST_ELEMENT_PARENT(element); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1472 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1473 | |
|
31824
6942cb72f357
media/backend-fs2: Better fix for the NULL deref crash here.
Paul Aurich <darkrain42@pidgin.im>
parents:
31807
diff
changeset
|
1474 | if (!element || !GST_IS_PIPELINE(element)) |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1475 | return; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1476 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1477 | sessions = purple_media_get_session_ids(priv->media); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1478 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1479 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
38945
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1480 | PurpleMediaSessionType session_type; |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1481 | |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1482 | if (purple_media_get_src(priv->media, sessions->data) |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1483 | != lastElement) |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1484 | continue; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1485 | |
|
38945
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1486 | session_type = purple_media_get_session_type(priv->media, |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1487 | sessions->data); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1488 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1489 | if (session_type & PURPLE_MEDIA_AUDIO) { |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1490 | purple_media_error(priv->media, |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1491 | _("Error with your microphone")); |
|
38945
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1492 | } else if (session_type & PURPLE_MEDIA_VIDEO) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1493 | fatal = !downgrade_video_source(self, |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1494 | GST_BIN(lastElement)); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1495 | |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1496 | if (fatal) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1497 | purple_media_error(priv->media, |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1498 | _("Error with your webcam")); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1499 | } |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1500 | } |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1501 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1502 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1503 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1504 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1505 | g_list_free(sessions); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1506 | |
|
38945
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1507 | if (fatal) { |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1508 | purple_media_error(priv->media, _("Conference error")); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1509 | purple_media_end(priv->media, NULL, NULL); |
|
a7917f83bae9
media: improve webcam failure handling
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38912
diff
changeset
|
1510 | } |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1511 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1512 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
1513 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1514 | gst_bus_cb(GstBus *bus, GstMessage *msg, PurpleMediaBackendFs2 *self) |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1515 | { |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1516 | switch(GST_MESSAGE_TYPE(msg)) { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1517 | case GST_MESSAGE_ELEMENT: |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1518 | gst_handle_message_element(bus, msg, self); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1519 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1520 | case GST_MESSAGE_ERROR: |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1521 | gst_handle_message_error(bus, msg, self); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1522 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1523 | default: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1524 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1525 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1526 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1527 | return TRUE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1528 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1529 | |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1530 | static void |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1531 | remove_element(GstElement *element) |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1532 | { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1533 | if (element) { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1534 | gst_element_set_locked_state(element, TRUE); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1535 | gst_element_set_state(element, GST_STATE_NULL); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1536 | gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(element)), element); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1537 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1538 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1539 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1540 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1541 | state_changed_cb(PurpleMedia *media, PurpleMediaState state, |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1542 | gchar *sid, gchar *name, PurpleMediaBackendFs2 *self) |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1543 | { |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1544 | if (state == PURPLE_MEDIA_STATE_END) { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1545 | PurpleMediaBackendFs2Private *priv = |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1546 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1547 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1548 | if (sid && name) { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1549 | PurpleMediaBackendFs2Stream *stream = get_stream(self, sid, name); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1550 | gst_object_unref(stream->stream); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1551 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1552 | priv->streams = g_list_remove(priv->streams, stream); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1553 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1554 | remove_element(stream->src); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1555 | remove_element(stream->tee); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1556 | remove_element(stream->volume); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1557 | remove_element(stream->level); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1558 | remove_element(stream->fakesink); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1559 | remove_element(stream->queue); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1560 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1561 | free_stream(stream); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1562 | } else if (sid && !name) { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1563 | PurpleMediaBackendFs2Session *session = get_session(self, sid); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1564 | GstPad *pad; |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1565 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1566 | g_object_get(session->session, "sink-pad", &pad, NULL); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1567 | gst_pad_unlink(GST_PAD_PEER(pad), pad); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1568 | gst_object_unref(pad); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1569 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1570 | gst_object_unref(session->session); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1571 | g_hash_table_remove(priv->sessions, session->id); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1572 | |
|
38946
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1573 | if (session->srcpad) { |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1574 | pad = gst_pad_get_peer(session->srcpad); |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1575 | if (pad) { |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1576 | gst_element_remove_pad( |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1577 | GST_PAD_PARENT(pad), |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1578 | pad); |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1579 | gst_object_unref(pad); |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1580 | } |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1581 | gst_object_unref(session->srcpad); |
|
0626f7570121
media: fix possible NULL dereference in state_changed_cb()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38945
diff
changeset
|
1582 | } |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1583 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1584 | remove_element(session->srcvalve); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1585 | remove_element(session->tee); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1586 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1587 | free_session(session); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1588 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1589 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1590 | purple_media_manager_remove_output_windows( |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1591 | purple_media_get_manager(media), media, sid, name); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1592 | } |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1593 | } |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1594 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1595 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1596 | stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type, |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1597 | gchar *sid, gchar *name, gboolean local, |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1598 | PurpleMediaBackendFs2 *self) |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1599 | { |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1600 | if (type == PURPLE_MEDIA_INFO_ACCEPT && sid != NULL && name != NULL) { |
|
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1601 | PurpleMediaBackendFs2Stream *stream = |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1602 | get_stream(self, sid, name); |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1603 | GError *err = NULL; |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1604 | |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1605 | g_object_set(G_OBJECT(stream->stream), "direction", |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1606 | session_type_to_fs_stream_direction( |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1607 | stream->session->type), NULL); |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1608 | |
|
29648
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
1609 | if (stream->remote_candidates == NULL || |
|
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
1610 | purple_media_is_initiator(media, sid, name)) |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1611 | return; |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1612 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1613 | #ifdef HAVE_FARSIGHT |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1614 | fs_stream_set_remote_candidates(stream->stream, |
|
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1615 | stream->remote_candidates, &err); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1616 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1617 | if (stream->supports_add) |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1618 | fs_stream_add_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1619 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1620 | else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1621 | fs_stream_force_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1622 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1623 | #endif |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1624 | |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1625 | if (err == NULL) |
|
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1626 | return; |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1627 | |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1628 | purple_debug_error("backend-fs2", "Error adding " |
|
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1629 | "remote candidates: %s\n", |
|
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1630 | err->message); |
|
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1631 | g_error_free(err); |
|
29603
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1632 | } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE || |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1633 | type == PURPLE_MEDIA_INFO_UNMUTE)) { |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1634 | PurpleMediaBackendFs2Private *priv = |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1635 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1636 | gboolean active = (type == PURPLE_MEDIA_INFO_MUTE); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1637 | GList *sessions; |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1638 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1639 | if (sid == NULL) |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1640 | sessions = g_hash_table_get_values(priv->sessions); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1641 | else |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1642 | sessions = g_list_prepend(NULL, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1643 | get_session(self, sid)); |
|
29603
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1644 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1645 | purple_debug_info("media", "Turning mute %s\n", |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1646 | active ? "on" : "off"); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1647 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1648 | for (; sessions; sessions = g_list_delete_link( |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1649 | sessions, sessions)) { |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1650 | PurpleMediaBackendFs2Session *session = |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1651 | sessions->data; |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1652 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1653 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1654 | gchar *name = g_strdup_printf("volume_%s", |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1655 | session->id); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1656 | GstElement *volume = gst_bin_get_by_name( |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1657 | GST_BIN(priv->confbin), name); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1658 | g_free(name); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1659 | g_object_set(volume, "mute", active, NULL); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1660 | } |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1661 | } |
|
31278
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1662 | } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_HOLD || |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1663 | type == PURPLE_MEDIA_INFO_UNHOLD)) { |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1664 | gboolean active = (type == PURPLE_MEDIA_INFO_HOLD); |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1665 | GList *streams = get_streams(self, sid, name); |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1666 | for (; streams; streams = |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1667 | g_list_delete_link(streams, streams)) { |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1668 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1669 | if (stream->session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1670 | g_object_set(stream->stream, "direction", |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1671 | session_type_to_fs_stream_direction( |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1672 | stream->session->type & ((active) ? |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1673 | ~PURPLE_MEDIA_SEND_AUDIO : |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1674 | PURPLE_MEDIA_AUDIO)), NULL); |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1675 | } |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1676 | } |
|
29594
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1677 | } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_PAUSE || |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1678 | type == PURPLE_MEDIA_INFO_UNPAUSE)) { |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1679 | gboolean active = (type == PURPLE_MEDIA_INFO_PAUSE); |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1680 | GList *streams = get_streams(self, sid, name); |
|
29594
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1681 | for (; streams; streams = |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1682 | g_list_delete_link(streams, streams)) { |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1683 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1684 | if (stream->session->type & PURPLE_MEDIA_SEND_VIDEO) { |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1685 | g_object_set(stream->stream, "direction", |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1686 | session_type_to_fs_stream_direction( |
|
29594
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1687 | stream->session->type & ((active) ? |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1688 | ~PURPLE_MEDIA_SEND_VIDEO : |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1689 | PURPLE_MEDIA_VIDEO)), NULL); |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1690 | } |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1691 | } |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1692 | } |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1693 | } |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1694 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1695 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1696 | init_conference(PurpleMediaBackendFs2 *self) |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1697 | { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1698 | PurpleMediaBackendFs2Private *priv = |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1699 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1700 | GstElement *pipeline; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1701 | GstBus *bus; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1702 | gchar *name; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1703 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1704 | GKeyFile *default_props; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1705 | #endif |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1706 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1707 | priv->conference = FS_CONFERENCE( |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1708 | gst_element_factory_make(priv->conference_type, NULL)); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1709 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1710 | if (priv->conference == NULL) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1711 | purple_debug_error("backend-fs2", "Conference == NULL\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1712 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1713 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1714 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1715 | if (purple_account_get_silence_suppression( |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1716 | purple_media_get_account(priv->media))) |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1717 | priv->silence_threshold = purple_prefs_get_int( |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1718 | "/purple/media/audio/silence_threshold") / 100.0; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1719 | else |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1720 | priv->silence_threshold = 0; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1721 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1722 | pipeline = purple_media_manager_get_pipeline( |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1723 | purple_media_get_manager(priv->media)); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1724 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1725 | if (pipeline == NULL) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1726 | purple_debug_error("backend-fs2", |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1727 | "Couldn't retrieve pipeline.\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1728 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1729 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1730 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1731 | name = g_strdup_printf("conf_%p", priv->conference); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1732 | priv->confbin = gst_bin_new(name); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1733 | if (priv->confbin == NULL) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1734 | purple_debug_error("backend-fs2", |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1735 | "Couldn't create confbin.\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1736 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1737 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1738 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1739 | g_free(name); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1740 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1741 | bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1742 | if (bus == NULL) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1743 | purple_debug_error("backend-fs2", |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1744 | "Couldn't get the pipeline's bus.\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1745 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1746 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1747 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1748 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1749 | default_props = fs_utils_get_default_element_properties(GST_ELEMENT(priv->conference)); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1750 | if (default_props != NULL) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1751 | priv->notifier = fs_element_added_notifier_new(); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1752 | fs_element_added_notifier_add(priv->notifier, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1753 | GST_BIN(priv->confbin)); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1754 | fs_element_added_notifier_set_properties_from_keyfile(priv->notifier, default_props); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1755 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1756 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1757 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1758 | g_signal_connect(G_OBJECT(bus), "message", |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1759 | G_CALLBACK(gst_bus_cb), self); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1760 | gst_object_unref(bus); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1761 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1762 | if (!gst_bin_add(GST_BIN(pipeline), |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1763 | GST_ELEMENT(priv->confbin))) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1764 | purple_debug_error("backend-fs2", "Couldn't add confbin " |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1765 | "element to the pipeline\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1766 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1767 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1768 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1769 | if (!gst_bin_add(GST_BIN(priv->confbin), |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1770 | GST_ELEMENT(priv->conference))) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1771 | purple_debug_error("backend-fs2", "Couldn't add conference " |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1772 | "element to the confbin\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1773 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1774 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1775 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1776 | if (gst_element_set_state(GST_ELEMENT(priv->confbin), |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1777 | GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1778 | purple_debug_error("backend-fs2", |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1779 | "Failed to start conference.\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1780 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1781 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1782 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1783 | return TRUE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1784 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1785 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1786 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1787 | gst_element_added_cb(FsElementAddedNotifier *self, |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1788 | GstBin *bin, GstElement *element, gpointer user_data) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1789 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1790 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1791 | * Hack to make H264 work with Gmail video. |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1792 | */ |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1793 | if (!strncmp(GST_ELEMENT_NAME(element), "x264", 4)) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1794 | g_object_set(GST_OBJECT(element), "cabac", FALSE, NULL); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1795 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1796 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1797 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1798 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1799 | create_src(PurpleMediaBackendFs2 *self, const gchar *sess_id, |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1800 | PurpleMediaSessionType type) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1801 | { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1802 | PurpleMediaBackendFs2Private *priv = |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1803 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1804 | PurpleMediaBackendFs2Session *session; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1805 | PurpleMediaSessionType session_type; |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1806 | FsMediaType media_type = session_type_to_fs_media_type(type); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1807 | FsStreamDirection type_direction = |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1808 | session_type_to_fs_stream_direction(type); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1809 | GstElement *src; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1810 | GstPad *sinkpad, *srcpad; |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1811 | GstPad *ghost = NULL; |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1812 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1813 | if ((type_direction & FS_DIRECTION_SEND) == 0) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1814 | return TRUE; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
1815 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1816 | session_type = session_type_from_fs( |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1817 | media_type, FS_DIRECTION_SEND); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1818 | src = purple_media_manager_get_element( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1819 | purple_media_get_manager(priv->media), |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1820 | session_type, priv->media, sess_id, NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1821 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1822 | if (!GST_IS_ELEMENT(src)) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1823 | purple_debug_error("backend-fs2", |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1824 | "Error creating src for session %s\n", |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1825 | sess_id); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1826 | return FALSE; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1827 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1828 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1829 | session = get_session(self, sess_id); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1830 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1831 | if (session == NULL) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1832 | purple_debug_warning("backend-fs2", |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1833 | "purple_media_set_src: trying to set" |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1834 | " src on non-existent session\n"); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1835 | return FALSE; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1836 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1837 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1838 | if (session->src) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1839 | gst_object_unref(session->src); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1840 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1841 | session->src = src; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1842 | gst_element_set_locked_state(session->src, TRUE); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1843 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1844 | session->tee = gst_element_factory_make("tee", NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1845 | gst_bin_add(GST_BIN(priv->confbin), session->tee); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1846 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1847 | /* This supposedly isn't necessary, but it silences some warnings */ |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1848 | if (GST_ELEMENT_PARENT(priv->confbin) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1849 | == GST_ELEMENT_PARENT(session->src)) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1850 | GstPad *pad = gst_element_get_static_pad(session->tee, "sink"); |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1851 | ghost = gst_ghost_pad_new(NULL, pad); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1852 | gst_object_unref(pad); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1853 | gst_pad_set_active(ghost, TRUE); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1854 | gst_element_add_pad(priv->confbin, ghost); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1855 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1856 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1857 | gst_element_set_state(session->tee, GST_STATE_PLAYING); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1858 | gst_element_link(session->src, priv->confbin); |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1859 | if (ghost) |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1860 | session->srcpad = gst_pad_get_peer(ghost); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1861 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1862 | g_object_get(session->session, "sink-pad", &sinkpad, NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1863 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1864 | gchar *name = g_strdup_printf("volume_%s", session->id); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1865 | GstElement *level; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1866 | GstElement *volume = gst_element_factory_make("volume", name); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1867 | double input_volume = purple_prefs_get_int( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1868 | "/purple/media/audio/volume/input")/10.0; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1869 | g_free(name); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1870 | name = g_strdup_printf("sendlevel_%s", session->id); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1871 | level = gst_element_factory_make("level", name); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1872 | g_free(name); |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1873 | session->srcvalve = gst_element_factory_make("valve", NULL); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1874 | gst_bin_add(GST_BIN(priv->confbin), volume); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1875 | gst_bin_add(GST_BIN(priv->confbin), level); |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1876 | gst_bin_add(GST_BIN(priv->confbin), session->srcvalve); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1877 | gst_element_set_state(level, GST_STATE_PLAYING); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1878 | gst_element_set_state(volume, GST_STATE_PLAYING); |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1879 | gst_element_set_state(session->srcvalve, GST_STATE_PLAYING); |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1880 | gst_element_link(level, session->srcvalve); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1881 | gst_element_link(volume, level); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1882 | gst_element_link(session->tee, volume); |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
1883 | srcpad = gst_element_get_static_pad(session->srcvalve, "src"); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1884 | g_object_set(volume, "volume", input_volume, NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1885 | } else { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1886 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1887 | srcpad = gst_element_get_request_pad(session->tee, "src_%u"); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1888 | #else |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1889 | srcpad = gst_element_get_request_pad(session->tee, "src%d"); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1890 | #endif |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1891 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1892 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
1893 | purple_debug_info("backend-fs2", "connecting pad: %s\n", |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1894 | gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1895 | ? "success" : "failure"); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1896 | gst_element_set_locked_state(session->src, FALSE); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1897 | gst_object_unref(session->src); |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1898 | gst_object_unref(sinkpad); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1899 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1900 | purple_media_manager_create_output_window(purple_media_get_manager( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1901 | priv->media), priv->media, sess_id, NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1902 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1903 | purple_debug_info("backend-fs2", "create_src: setting source " |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1904 | "state to GST_STATE_PLAYING - it may hang here on win32\n"); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1905 | gst_element_set_state(session->src, GST_STATE_PLAYING); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1906 | purple_debug_info("backend-fs2", "create_src: state set\n"); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
1907 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1908 | return TRUE; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1909 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1910 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1911 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1912 | create_session(PurpleMediaBackendFs2 *self, const gchar *sess_id, |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1913 | PurpleMediaSessionType type, gboolean initiator, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1914 | const gchar *transmitter) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1915 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1916 | PurpleMediaBackendFs2Private *priv = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1917 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1918 | PurpleMediaBackendFs2Session *session; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1919 | GError *err = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1920 | GList *codec_conf = NULL, *iter = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1921 | gchar *filename = NULL; |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
1922 | gboolean is_nice = purple_strequal(transmitter, "nice"); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1923 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1924 | session = g_new0(PurpleMediaBackendFs2Session, 1); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1925 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1926 | session->session = fs_conference_new_session(priv->conference, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1927 | session_type_to_fs_media_type(type), &err); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1928 | |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1929 | #ifdef HAVE_MEDIA_APPLICATION |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1930 | if (type == PURPLE_MEDIA_APPLICATION) { |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1931 | GstCaps *caps; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1932 | GObject *rtpsession = NULL; |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1933 | |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1934 | caps = gst_caps_new_empty_simple ("application/octet-stream"); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1935 | fs_session_set_allowed_caps (session->session, caps, caps, NULL); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1936 | gst_caps_unref (caps); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1937 | g_object_get (session->session, "internal-session", &rtpsession, NULL); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1938 | if (rtpsession) { |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1939 | g_object_set (rtpsession, "probation", 0, NULL); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1940 | g_object_unref (rtpsession); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1941 | } |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1942 | } |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1943 | #endif |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1944 | if (err != NULL) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1945 | purple_media_error(priv->media, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1946 | _("Error creating session: %s"), |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1947 | err->message); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1948 | g_error_free(err); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1949 | g_free(session); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1950 | return FALSE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1951 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1952 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1953 | filename = g_build_filename(purple_user_dir(), "fs-codec.conf", NULL); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1954 | codec_conf = fs_codec_list_from_keyfile(filename, &err); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1955 | g_free(filename); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1956 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1957 | if (err != NULL) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1958 | if (err->code == 4) |
|
29580
ee364f895072
Correct some debug categories.
Michael Ruprecht <maiku@pidgin.im>
parents:
29579
diff
changeset
|
1959 | purple_debug_info("backend-fs2", "Couldn't read " |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1960 | "fs-codec.conf: %s\n", |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1961 | err->message); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1962 | else |
|
29580
ee364f895072
Correct some debug categories.
Michael Ruprecht <maiku@pidgin.im>
parents:
29579
diff
changeset
|
1963 | purple_debug_error("backend-fs2", "Error reading " |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1964 | "fs-codec.conf: %s\n", |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1965 | err->message); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1966 | g_error_free(err); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1967 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1968 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1969 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1970 | * Add SPEEX if the configuration file doesn't exist or |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1971 | * there isn't a speex entry. |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1972 | */ |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1973 | for (iter = codec_conf; iter; iter = g_list_next(iter)) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1974 | FsCodec *codec = iter->data; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1975 | if (!g_ascii_strcasecmp(codec->encoding_name, "speex")) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1976 | break; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1977 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1978 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1979 | if (iter == NULL) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1980 | codec_conf = g_list_prepend(codec_conf, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1981 | fs_codec_new(FS_CODEC_ID_ANY, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1982 | "SPEEX", FS_MEDIA_TYPE_AUDIO, 8000)); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1983 | codec_conf = g_list_prepend(codec_conf, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1984 | fs_codec_new(FS_CODEC_ID_ANY, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1985 | "SPEEX", FS_MEDIA_TYPE_AUDIO, 16000)); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1986 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1987 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1988 | fs_session_set_codec_preferences(session->session, codec_conf, NULL); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1989 | fs_codec_list_destroy(codec_conf); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1990 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1991 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1992 | * Removes a 5-7 second delay before |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1993 | * receiving the src-pad-added signal. |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1994 | * Only works for non-multicast FsRtpSessions. |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1995 | */ |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
1996 | if (!purple_strequal(transmitter, "multicast")) |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1997 | g_object_set(G_OBJECT(session->session), |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1998 | "no-rtcp-timeout", 0, NULL); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1999 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2000 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2001 | * Hack to make x264 work with Gmail video. |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2002 | */ |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
2003 | if (is_nice && purple_strequal(sess_id, "google-video")) { |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2004 | FsElementAddedNotifier *notifier = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2005 | fs_element_added_notifier_new(); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2006 | g_signal_connect(G_OBJECT(notifier), "element-added", |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2007 | G_CALLBACK(gst_element_added_cb), NULL); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2008 | fs_element_added_notifier_add(notifier, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2009 | GST_BIN(priv->conference)); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2010 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2011 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2012 | session->id = g_strdup(sess_id); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2013 | session->backend = self; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2014 | session->type = type; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2015 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2016 | if (!priv->sessions) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2017 | purple_debug_info("backend-fs2", |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2018 | "Creating hash table for sessions\n"); |
|
30715
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30706
diff
changeset
|
2019 | priv->sessions = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30706
diff
changeset
|
2020 | g_free, NULL); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2021 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2022 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2023 | g_hash_table_insert(priv->sessions, g_strdup(session->id), session); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2024 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2025 | if (!create_src(self, sess_id, type)) { |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2026 | purple_debug_info("backend-fs2", "Error creating the src\n"); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2027 | return FALSE; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2028 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2029 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2030 | return TRUE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2031 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2032 | |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2033 | static void |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2034 | free_session(PurpleMediaBackendFs2Session *session) |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2035 | { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2036 | g_free(session->id); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2037 | g_free(session); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2038 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2039 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2040 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2041 | create_participant(PurpleMediaBackendFs2 *self, const gchar *name) |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2042 | { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2043 | PurpleMediaBackendFs2Private *priv = |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2044 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2045 | FsParticipant *participant; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2046 | GError *err = NULL; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2047 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2048 | participant = fs_conference_new_participant( |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2049 | #ifdef HAVE_FARSIGHT |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2050 | priv->conference, name, &err); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2051 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2052 | priv->conference, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2053 | #endif |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2054 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2055 | if (err) { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2056 | purple_debug_error("backend-fs2", |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2057 | "Error creating participant: %s\n", |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2058 | err->message); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2059 | g_error_free(err); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2060 | return FALSE; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2061 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2062 | |
|
38731
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
2063 | g_object_set_data_full(G_OBJECT(participant), "purple-name", |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
2064 | g_strdup(name), g_free); |
|
e9a7fc25fcca
media: don't expect FsParticipant always has "cname" property
Jakub Adam <jakub.adam@ktknet.cz>
parents:
38259
diff
changeset
|
2065 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2066 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2067 | if (g_object_class_find_property(G_OBJECT_GET_CLASS(participant), |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2068 | "cname")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2069 | g_object_set(participant, "cname", name, NULL); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2070 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2071 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2072 | |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2073 | if (!priv->participants) { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2074 | purple_debug_info("backend-fs2", |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2075 | "Creating hash table for participants\n"); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2076 | priv->participants = g_hash_table_new_full(g_str_hash, |
|
30715
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30706
diff
changeset
|
2077 | g_str_equal, g_free, g_object_unref); |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2078 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2079 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2080 | g_hash_table_insert(priv->participants, g_strdup(name), participant); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2081 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2082 | return TRUE; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2083 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2084 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2085 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2086 | src_pad_added_cb_cb(PurpleMediaBackendFs2Stream *stream) |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2087 | { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2088 | PurpleMediaBackendFs2Private *priv; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2089 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2090 | g_return_val_if_fail(stream != NULL, FALSE); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2091 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2092 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(stream->session->backend); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2093 | stream->connected_cb_id = 0; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2094 | |
|
38947
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2095 | if (stream->src == NULL) { |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2096 | GstElement *pipeline = purple_media_manager_get_pipeline( |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2097 | purple_media_get_manager(priv->media)); |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2098 | GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(pipeline), |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2099 | GST_DEBUG_GRAPH_SHOW_ALL, "media-fail"); |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2100 | |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2101 | purple_media_error(priv->media, |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2102 | _("Could not create media pipeline")); |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2103 | purple_media_end(priv->media, NULL, NULL); |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2104 | return FALSE; |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2105 | } |
|
235db0eb609d
Show error when creating media pipeline fails
David Woodhouse <dwmw2@infradead.org>
parents:
38946
diff
changeset
|
2106 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2107 | purple_media_manager_create_output_window( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2108 | purple_media_get_manager(priv->media), priv->media, |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2109 | stream->session->id, stream->participant); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2110 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2111 | g_signal_emit_by_name(priv->media, "state-changed", |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2112 | PURPLE_MEDIA_STATE_CONNECTED, |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2113 | stream->session->id, stream->participant); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2114 | return FALSE; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2115 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2116 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2117 | static void |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2118 | src_pad_added_cb(FsStream *fsstream, GstPad *srcpad, |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2119 | FsCodec *codec, PurpleMediaBackendFs2Stream *stream) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2120 | { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2121 | PurpleMediaBackendFs2Private *priv; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2122 | GstPad *sinkpad; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2123 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2124 | g_return_if_fail(FS_IS_STREAM(fsstream)); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2125 | g_return_if_fail(stream != NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2126 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2127 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(stream->session->backend); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2128 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2129 | if (stream->src == NULL) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2130 | GstElement *sink = NULL; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2131 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2132 | if (codec->media_type == FS_MEDIA_TYPE_AUDIO) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2133 | double output_volume = purple_prefs_get_int( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2134 | "/purple/media/audio/volume/output")/10.0; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2135 | /* |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2136 | * Should this instead be: |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2137 | * audioconvert ! audioresample ! liveadder ! |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2138 | * audioresample ! audioconvert ! realsink |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2139 | */ |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2140 | stream->queue = gst_element_factory_make("queue", NULL); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2141 | stream->volume = gst_element_factory_make("volume", NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2142 | g_object_set(stream->volume, "volume", output_volume, NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2143 | stream->level = gst_element_factory_make("level", NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2144 | stream->src = gst_element_factory_make("liveadder", NULL); |
|
39171
08a29966cee9
media: Set start-time-selection on liveadder
David Woodhouse <dwmw2@infradead.org>
parents:
38947
diff
changeset
|
2145 | g_object_set(stream->src, "start-time-selection", 1, NULL); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2146 | sink = purple_media_manager_get_element( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2147 | purple_media_get_manager(priv->media), |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2148 | PURPLE_MEDIA_RECV_AUDIO, priv->media, |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2149 | stream->session->id, |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2150 | stream->participant); |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2151 | gst_bin_add(GST_BIN(priv->confbin), stream->queue); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2152 | gst_bin_add(GST_BIN(priv->confbin), stream->volume); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2153 | gst_bin_add(GST_BIN(priv->confbin), stream->level); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2154 | gst_bin_add(GST_BIN(priv->confbin), sink); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2155 | gst_element_set_state(sink, GST_STATE_PLAYING); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2156 | gst_element_set_state(stream->level, GST_STATE_PLAYING); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2157 | gst_element_set_state(stream->volume, GST_STATE_PLAYING); |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2158 | gst_element_set_state(stream->queue, GST_STATE_PLAYING); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2159 | gst_element_link(stream->level, sink); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2160 | gst_element_link(stream->volume, stream->level); |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2161 | gst_element_link(stream->queue, stream->volume); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2162 | sink = stream->queue; |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2163 | } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2164 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2165 | stream->src = gst_element_factory_make("funnel", NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2166 | #else |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2167 | stream->src = gst_element_factory_make("fsfunnel", NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2168 | #endif |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2169 | sink = gst_element_factory_make("fakesink", NULL); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2170 | g_object_set(G_OBJECT(sink), "async", FALSE, NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2171 | gst_bin_add(GST_BIN(priv->confbin), sink); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2172 | gst_element_set_state(sink, GST_STATE_PLAYING); |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2173 | stream->fakesink = sink; |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2174 | #ifdef HAVE_MEDIA_APPLICATION |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2175 | } else if (codec->media_type == FS_MEDIA_TYPE_APPLICATION) { |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2176 | #if GST_CHECK_VERSION(1,0,0) |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2177 | stream->src = gst_element_factory_make("funnel", NULL); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2178 | #else |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2179 | stream->src = gst_element_factory_make("fsfunnel", NULL); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2180 | #endif |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2181 | sink = purple_media_manager_get_element( |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2182 | purple_media_get_manager(priv->media), |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2183 | PURPLE_MEDIA_RECV_APPLICATION, priv->media, |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2184 | stream->session->id, |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2185 | stream->participant); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2186 | gst_bin_add(GST_BIN(priv->confbin), sink); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2187 | gst_element_set_state(sink, GST_STATE_PLAYING); |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2188 | #endif |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2189 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2190 | stream->tee = gst_element_factory_make("tee", NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2191 | gst_bin_add_many(GST_BIN(priv->confbin), |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2192 | stream->src, stream->tee, NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2193 | gst_element_set_state(stream->tee, GST_STATE_PLAYING); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2194 | gst_element_set_state(stream->src, GST_STATE_PLAYING); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2195 | gst_element_link_many(stream->src, stream->tee, sink, NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2196 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2197 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2198 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2199 | sinkpad = gst_element_get_request_pad(stream->src, "sink_%u"); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2200 | #else |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2201 | sinkpad = gst_element_get_request_pad(stream->src, "sink%d"); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2202 | #endif |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2203 | gst_pad_link(srcpad, sinkpad); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2204 | gst_object_unref(sinkpad); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2205 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2206 | stream->connected_cb_id = purple_timeout_add(0, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2207 | (GSourceFunc)src_pad_added_cb_cb, stream); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2208 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2209 | |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2210 | #ifdef HAVE_FARSIGHT |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2211 | static GValueArray * |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2212 | append_relay_info(GValueArray *relay_info, const gchar *ip, gint port, |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2213 | const gchar *username, const gchar *password, const gchar *type) |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2214 | { |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2215 | GValue value; |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2216 | GstStructure *turn_setup = gst_structure_new("relay-info", |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
2217 | "ip", G_TYPE_STRING, ip, |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2218 | "port", G_TYPE_UINT, port, |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2219 | "username", G_TYPE_STRING, username, |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2220 | "password", G_TYPE_STRING, password, |
|
32110
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
2221 | "relay-type", G_TYPE_STRING, type, |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2222 | NULL); |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2223 | |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2224 | if (turn_setup) { |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2225 | memset(&value, 0, sizeof(GValue)); |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2226 | g_value_init(&value, GST_TYPE_STRUCTURE); |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2227 | gst_value_set_structure(&value, turn_setup); |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2228 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2229 | relay_info = g_value_array_append(relay_info, &value); |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2230 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2231 | gst_structure_free(turn_setup); |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2232 | } |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2233 | |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2234 | return relay_info; |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2235 | } |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2236 | #endif |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
2237 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2238 | static gboolean |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2239 | create_stream(PurpleMediaBackendFs2 *self, |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2240 | const gchar *sess_id, const gchar *who, |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2241 | PurpleMediaSessionType type, gboolean initiator, |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2242 | const gchar *transmitter, |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2243 | guint num_params, GParameter *params) |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2244 | { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2245 | PurpleMediaBackendFs2Private *priv = |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2246 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2247 | GError *err = NULL; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2248 | FsStream *fsstream = NULL; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2249 | const gchar *stun_ip = purple_network_get_stun_ip(); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2250 | const gchar *turn_ip = purple_network_get_turn_ip(); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2251 | guint _num_params = num_params; |
|
32111
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2252 | GParameter *_params; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2253 | FsStreamDirection type_direction = |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2254 | session_type_to_fs_stream_direction(type); |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2255 | PurpleMediaBackendFs2Session *session; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2256 | PurpleMediaBackendFs2Stream *stream; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2257 | FsParticipant *participant; |
|
30766
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2258 | /* check if the prpl has already specified a relay-info |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2259 | we need to do this to allow them to override when using non-standard |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2260 | TURN modes, like Google f.ex. */ |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2261 | gboolean got_turn_from_prpl = FALSE; |
|
36256
a437550a9308
Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35978
diff
changeset
|
2262 | guint i; |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2263 | #ifndef HAVE_FARSIGHT |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2264 | GPtrArray *relay_info = g_ptr_array_new_full (1, (GDestroyNotify) gst_structure_free); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2265 | gboolean ret; |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2266 | #endif |
|
30766
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2267 | |
|
32111
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2268 | session = get_session(self, sess_id); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2269 | |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2270 | if (session == NULL) { |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2271 | purple_debug_error("backend-fs2", |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2272 | "Couldn't find session to create stream.\n"); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2273 | return FALSE; |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2274 | } |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2275 | |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2276 | participant = get_participant(self, who); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2277 | |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2278 | if (participant == NULL) { |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2279 | purple_debug_error("backend-fs2", "Couldn't find " |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2280 | "participant to create stream.\n"); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2281 | return FALSE; |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2282 | } |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2283 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2284 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2285 | fsstream = fs_session_new_stream(session->session, participant, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2286 | initiator == TRUE ? type_direction : |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2287 | (type_direction & FS_DIRECTION_RECV), &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2288 | |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2289 | if (fsstream == NULL) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2290 | if (err) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2291 | purple_debug_error("backend-fs2", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2292 | "Error creating stream: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2293 | err && err->message ? |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2294 | err->message : "NULL"); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2295 | g_error_free(err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2296 | } else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2297 | purple_debug_error("backend-fs2", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2298 | "Error creating stream\n"); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2299 | return FALSE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2300 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2301 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2302 | |
|
30766
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2303 | for (i = 0 ; i < num_params ; i++) { |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2304 | if (purple_strequal(params[i].name, "relay-info")) { |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2305 | got_turn_from_prpl = TRUE; |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2306 | break; |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2307 | } |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2308 | } |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2309 | |
|
32111
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2310 | _params = g_new0(GParameter, num_params + 3); |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2311 | memcpy(_params, params, sizeof(GParameter) * num_params); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2312 | |
|
29688
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2313 | /* set the controlling mode parameter */ |
|
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2314 | _params[_num_params].name = "controlling-mode"; |
|
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2315 | g_value_init(&_params[_num_params].value, G_TYPE_BOOLEAN); |
|
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2316 | g_value_set_boolean(&_params[_num_params].value, initiator); |
|
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2317 | ++_num_params; |
|
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2318 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2319 | if (stun_ip) { |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
2320 | purple_debug_info("backend-fs2", |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2321 | "Setting stun-ip on new stream: %s\n", stun_ip); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2322 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2323 | _params[_num_params].name = "stun-ip"; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2324 | g_value_init(&_params[_num_params].value, G_TYPE_STRING); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2325 | g_value_set_string(&_params[_num_params].value, stun_ip); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2326 | ++_num_params; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2327 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2328 | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
2329 | if (turn_ip && purple_strequal("nice", transmitter) && !got_turn_from_prpl) { |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2330 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2331 | #ifdef HAVE_FARSIGHT |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2332 | GValueArray *relay_info = g_value_array_new(0); |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2333 | #endif |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2334 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2335 | gint port; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2336 | const gchar *username = purple_prefs_get_string( |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2337 | "/purple/network/turn_username"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2338 | const gchar *password = purple_prefs_get_string( |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2339 | "/purple/network/turn_password"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2340 | |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2341 | /* UDP */ |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2342 | port = purple_prefs_get_int("/purple/network/turn_port"); |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2343 | if (port > 0) { |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2344 | #ifdef HAVE_FARSIGHT |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2345 | relay_info = append_relay_info(relay_info, turn_ip, port, username, |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2346 | password, "udp"); |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2347 | #else |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2348 | g_ptr_array_add (relay_info, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2349 | gst_structure_new ("relay-info", |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2350 | "ip", G_TYPE_STRING, turn_ip, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2351 | "port", G_TYPE_UINT, port, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2352 | "username", G_TYPE_STRING, username, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2353 | "password", G_TYPE_STRING, password, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2354 | "relay-type", G_TYPE_STRING, "udp", |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2355 | NULL)); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2356 | #endif |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2357 | } |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
2358 | |
|
31831
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2359 | /* TCP */ |
|
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2360 | port = purple_prefs_get_int("/purple/network/turn_port_tcp"); |
|
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2361 | if (port > 0) { |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2362 | #ifdef HAVE_FARSIGHT |
|
31831
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2363 | relay_info = append_relay_info(relay_info, turn_ip, port, username, |
|
31860
0f36ebd8631b
Actually set the relay info for TCP
Marcus Lundblad <malu@pidgin.im>
parents:
31831
diff
changeset
|
2364 | password, "tcp"); |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2365 | #else |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2366 | g_ptr_array_add (relay_info, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2367 | gst_structure_new ("relay-info", |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2368 | "ip", G_TYPE_STRING, turn_ip, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2369 | "port", G_TYPE_UINT, port, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2370 | "username", G_TYPE_STRING, username, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2371 | "password", G_TYPE_STRING, password, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2372 | "relay-type", G_TYPE_STRING, "tcp", |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2373 | NULL)); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2374 | #endif |
|
31831
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2375 | } |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2376 | |
|
31831
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2377 | /* TURN over SSL is only supported by libnice for Google's "psuedo" SSL mode |
|
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2378 | at this time */ |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
2379 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2380 | purple_debug_info("backend-fs2", |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2381 | "Setting relay-info on new stream\n"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2382 | _params[_num_params].name = "relay-info"; |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2383 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2384 | #ifdef HAVE_FARSIGHT |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2385 | g_value_init(&_params[_num_params].value, G_TYPE_VALUE_ARRAY); |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2386 | g_value_set_boxed(&_params[_num_params].value, relay_info); |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2387 | g_value_array_free(relay_info); |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2388 | #else |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2389 | g_value_init(&_params[_num_params].value, G_TYPE_PTR_ARRAY); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2390 | g_value_set_boxed(&_params[_num_params].value, relay_info); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2391 | #endif |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2392 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
30424
24a75f52a4bd
media: Fix the TURN server setting to actually work again (it was apparently
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2393 | _num_params++; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2394 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2395 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2396 | #ifdef HAVE_FARSIGHT |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2397 | fsstream = fs_session_new_stream(session->session, participant, |
|
29648
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2398 | initiator == TRUE ? type_direction : |
|
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2399 | (type_direction & FS_DIRECTION_RECV), transmitter, |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2400 | _num_params, _params, &err); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2401 | g_free(_params); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2402 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2403 | if (fsstream == NULL) { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2404 | if (err) { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2405 | purple_debug_error("backend-fs2", |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2406 | "Error creating stream: %s\n", |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2407 | err && err->message ? |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2408 | err->message : "NULL"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2409 | g_error_free(err); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2410 | } else |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2411 | purple_debug_error("backend-fs2", |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2412 | "Error creating stream\n"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2413 | return FALSE; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2414 | } |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2415 | #else |
|
38912
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2416 | ret = fs_stream_set_transmitter(fsstream, transmitter, |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2417 | _params, _num_params, &err); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2418 | for (i = 0 ; i < _num_params ; i++) |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2419 | g_value_unset (&_params[i].value); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2420 | g_free(_params); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2421 | if (relay_info) |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2422 | g_ptr_array_unref (relay_info); |
|
d75e434521a5
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
Gary Kramlich <grim@reaperworld.com>
parents:
38731
diff
changeset
|
2423 | if (ret == FALSE) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2424 | purple_debug_error("backend-fs2", |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2425 | "Could not set transmitter %s: %s.\n", |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2426 | transmitter, err ? err->message : NULL); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2427 | g_clear_error(&err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2428 | return FALSE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2429 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2430 | #endif |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2431 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2432 | stream = g_new0(PurpleMediaBackendFs2Stream, 1); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2433 | stream->participant = g_strdup(who); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2434 | stream->session = session; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2435 | stream->stream = fsstream; |
|
32115
410435e8fae5
Fix typo that was breaking compilation for me
Mark Doliner <markdoliner@pidgin.im>
parents:
32114
diff
changeset
|
2436 | #ifndef HAVE_FARSIGHT |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
2437 | stream->supports_add = purple_strequal(transmitter, "nice"); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2438 | #endif |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2439 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2440 | priv->streams = g_list_append(priv->streams, stream); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2441 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2442 | g_signal_connect(G_OBJECT(fsstream), "src-pad-added", |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2443 | G_CALLBACK(src_pad_added_cb), stream); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2444 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2445 | return TRUE; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2446 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2447 | |
|
31618
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2448 | static void |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2449 | free_stream(PurpleMediaBackendFs2Stream *stream) |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2450 | { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2451 | /* Remove the connected_cb timeout */ |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2452 | if (stream->connected_cb_id != 0) |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2453 | purple_timeout_remove(stream->connected_cb_id); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2454 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2455 | g_free(stream->participant); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2456 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2457 | if (stream->local_candidates) |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2458 | fs_candidate_list_destroy(stream->local_candidates); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2459 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2460 | if (stream->remote_candidates) |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2461 | fs_candidate_list_destroy(stream->remote_candidates); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2462 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2463 | g_free(stream); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2464 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2465 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2466 | static gboolean |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2467 | purple_media_backend_fs2_add_stream(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2468 | const gchar *sess_id, const gchar *who, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2469 | PurpleMediaSessionType type, gboolean initiator, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2470 | const gchar *transmitter, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2471 | guint num_params, GParameter *params) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2472 | { |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2473 | PurpleMediaBackendFs2 *backend = PURPLE_MEDIA_BACKEND_FS2(self); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2474 | PurpleMediaBackendFs2Private *priv = |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2475 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(backend); |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2476 | PurpleMediaBackendFs2Stream *stream; |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2477 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2478 | if (priv->conference == NULL && !init_conference(backend)) { |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2479 | purple_debug_error("backend-fs2", |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2480 | "Error initializing the conference.\n"); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2481 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2482 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2483 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2484 | if (get_session(backend, sess_id) == NULL && |
|
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2485 | !create_session(backend, sess_id, type, |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2486 | initiator, transmitter)) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2487 | purple_debug_error("backend-fs2", |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2488 | "Error creating the session.\n"); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2489 | return FALSE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2490 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2491 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2492 | if (get_participant(backend, who) == NULL && |
|
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2493 | !create_participant(backend, who)) { |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2494 | purple_debug_error("backend-fs2", |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2495 | "Error creating the participant.\n"); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2496 | return FALSE; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2497 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2498 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2499 | stream = get_stream(backend, sess_id, who); |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2500 | |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2501 | if (stream != NULL) { |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2502 | FsStreamDirection type_direction = |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2503 | session_type_to_fs_stream_direction(type); |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2504 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2505 | if (session_type_to_fs_stream_direction( |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2506 | stream->session->type) != type_direction) { |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2507 | /* change direction */ |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2508 | g_object_set(stream->stream, "direction", |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2509 | type_direction, NULL); |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2510 | } |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2511 | } else if (!create_stream(backend, sess_id, who, type, |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2512 | initiator, transmitter, num_params, params)) { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2513 | purple_debug_error("backend-fs2", |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2514 | "Error creating the stream.\n"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2515 | return FALSE; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2516 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2517 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2518 | return TRUE; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2519 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2520 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2521 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2522 | purple_media_backend_fs2_add_remote_candidates(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2523 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2524 | GList *remote_candidates) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2525 | { |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2526 | PurpleMediaBackendFs2Private *priv; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2527 | PurpleMediaBackendFs2Stream *stream; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2528 | GError *err = NULL; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2529 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2530 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2531 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2532 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2533 | stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2534 | sess_id, participant); |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2535 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2536 | if (stream == NULL) { |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2537 | purple_debug_error("backend-fs2", |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2538 | "purple_media_add_remote_candidates: " |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2539 | "couldn't find stream %s %s.\n", |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2540 | sess_id ? sess_id : "(null)", |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2541 | participant ? participant : "(null)"); |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2542 | return; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2543 | } |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2544 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2545 | stream->remote_candidates = g_list_concat(stream->remote_candidates, |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2546 | candidate_list_to_fs(remote_candidates)); |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2547 | |
|
29648
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2548 | if (purple_media_is_initiator(priv->media, sess_id, participant) || |
|
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2549 | purple_media_accepted( |
|
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2550 | priv->media, sess_id, participant)) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2551 | #ifdef HAVE_FARSIGHT |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2552 | fs_stream_set_remote_candidates(stream->stream, |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2553 | stream->remote_candidates, &err); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2554 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2555 | if (stream->supports_add) |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2556 | fs_stream_add_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2557 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2558 | else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2559 | fs_stream_force_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2560 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2561 | #endif |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2562 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2563 | if (err) { |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2564 | purple_debug_error("backend-fs2", "Error adding remote" |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2565 | " candidates: %s\n", err->message); |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2566 | g_error_free(err); |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2567 | } |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2568 | } |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2569 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2570 | |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2571 | static gboolean |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2572 | purple_media_backend_fs2_codecs_ready(PurpleMediaBackend *self, |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2573 | const gchar *sess_id) |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2574 | { |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2575 | PurpleMediaBackendFs2Private *priv; |
|
30627
5aba54c21ca3
Fix a possible Garbage return value.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30424
diff
changeset
|
2576 | gboolean ret = FALSE; |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2577 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2578 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2579 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2580 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2581 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2582 | if (sess_id != NULL) { |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2583 | PurpleMediaBackendFs2Session *session = get_session( |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2584 | PURPLE_MEDIA_BACKEND_FS2(self), sess_id); |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2585 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2586 | if (session == NULL) |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2587 | return FALSE; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2588 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2589 | if (session->type & (PURPLE_MEDIA_SEND_AUDIO | |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2590 | #ifdef HAVE_MEDIA_APPLICATION |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2591 | PURPLE_MEDIA_SEND_APPLICATION | |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2592 | #endif |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2593 | PURPLE_MEDIA_SEND_VIDEO)) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2594 | #ifdef HAVE_FARSIGHT |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2595 | g_object_get(session->session, |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
2596 | "codecs-ready", &ret, NULL); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2597 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2598 | GList *codecs = NULL; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2599 | |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2600 | g_object_get(session->session, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2601 | "codecs", &codecs, NULL); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2602 | if (codecs) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2603 | fs_codec_list_destroy (codecs); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2604 | ret = TRUE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2605 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2606 | #endif |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2607 | } else |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2608 | ret = TRUE; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2609 | } else { |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2610 | GList *values = g_hash_table_get_values(priv->sessions); |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2611 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2612 | for (; values; values = g_list_delete_link(values, values)) { |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2613 | PurpleMediaBackendFs2Session *session = values->data; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2614 | |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2615 | if (session->type & (PURPLE_MEDIA_SEND_AUDIO | |
|
36333
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2616 | #ifdef HAVE_MEDIA_APPLICATION |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2617 | PURPLE_MEDIA_SEND_APPLICATION | |
|
4fe1034f3dce
Add application media type and APIs
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
2618 | #endif |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2619 | PURPLE_MEDIA_SEND_VIDEO)) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2620 | #ifdef HAVE_FARSIGHT |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2621 | g_object_get(session->session, |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2622 | "codecs-ready", &ret, NULL); |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2623 | if (ret == FALSE) |
|
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2624 | break; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2625 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2626 | GList *codecs = NULL; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2627 | |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2628 | g_object_get(session->session, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2629 | "codecs", &codecs, NULL); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2630 | if (codecs) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2631 | fs_codec_list_destroy (codecs); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2632 | ret = TRUE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2633 | } else { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2634 | ret = FALSE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2635 | break; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2636 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2637 | #endif |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2638 | } else |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2639 | ret = TRUE; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2640 | } |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2641 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2642 | if (values != NULL) |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2643 | g_list_free(values); |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2644 | } |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2645 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2646 | return ret; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2647 | } |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2648 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2649 | static GList * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2650 | purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2651 | const gchar *sess_id) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2652 | { |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2653 | PurpleMediaBackendFs2Session *session; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2654 | GList *fscodecs; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2655 | GList *codecs; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2656 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2657 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2658 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2659 | session = get_session(PURPLE_MEDIA_BACKEND_FS2(self), sess_id); |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2660 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2661 | if (session == NULL) |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2662 | return NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2663 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2664 | g_object_get(G_OBJECT(session->session), |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2665 | "codecs", &fscodecs, NULL); |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2666 | codecs = codec_list_from_fs(fscodecs); |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2667 | fs_codec_list_destroy(fscodecs); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2668 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2669 | return codecs; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2670 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2671 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2672 | static GList * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2673 | purple_media_backend_fs2_get_local_candidates(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2674 | const gchar *sess_id, const gchar *participant) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2675 | { |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2676 | PurpleMediaBackendFs2Stream *stream; |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2677 | GList *candidates = NULL; |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2678 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2679 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), NULL); |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2680 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2681 | stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2682 | sess_id, participant); |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2683 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2684 | if (stream != NULL) |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2685 | candidates = candidate_list_from_fs( |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2686 | stream->local_candidates); |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2687 | return candidates; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2688 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2689 | |
|
29588
a3fef46ce04a
Make the backend interface's set_remote_codecs function return gboolean.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
2690 | static gboolean |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2691 | purple_media_backend_fs2_set_remote_codecs(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2692 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2693 | GList *codecs) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2694 | { |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2695 | PurpleMediaBackendFs2Stream *stream; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2696 | GList *fscodecs; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2697 | GError *err = NULL; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2698 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2699 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2700 | stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2701 | sess_id, participant); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2702 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2703 | if (stream == NULL) |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2704 | return FALSE; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2705 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2706 | fscodecs = codec_list_to_fs(codecs); |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2707 | fs_stream_set_remote_codecs(stream->stream, fscodecs, &err); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2708 | fs_codec_list_destroy(fscodecs); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2709 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2710 | if (err) { |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2711 | purple_debug_error("backend-fs2", |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2712 | "Error setting remote codecs: %s\n", |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2713 | err->message); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2714 | g_error_free(err); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2715 | return FALSE; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2716 | } |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2717 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2718 | return TRUE; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2719 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2720 | |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2721 | #if GST_CHECK_VERSION(1,0,0) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2722 | static GstStructure * |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2723 | create_fs2_srtp_structure(const gchar *cipher, const gchar *auth, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2724 | const gchar *key, gsize key_len) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2725 | { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2726 | GstStructure *result; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2727 | GstBuffer *buffer; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2728 | GstMapInfo info; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2729 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2730 | buffer = gst_buffer_new_allocate(NULL, key_len, NULL); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2731 | gst_buffer_map(buffer, &info, GST_MAP_WRITE); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2732 | memcpy(info.data, key, key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2733 | gst_buffer_unmap(buffer, &info); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2734 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2735 | result = gst_structure_new("FarstreamSRTP", |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2736 | "cipher", G_TYPE_STRING, cipher, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2737 | "auth", G_TYPE_STRING, auth, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2738 | "key", GST_TYPE_BUFFER, buffer, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2739 | NULL); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2740 | gst_buffer_unref(buffer); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2741 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2742 | return result; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2743 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2744 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2745 | static gboolean |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2746 | purple_media_backend_fs2_set_encryption_parameters (PurpleMediaBackend *self, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2747 | const gchar *sess_id, const gchar *cipher, const gchar *auth, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2748 | const gchar *key, gsize key_len) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2749 | { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2750 | PurpleMediaBackendFs2Session *session; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2751 | GstStructure *srtp; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2752 | GError *err = NULL; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2753 | gboolean result; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2754 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2755 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2756 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2757 | session = get_session(PURPLE_MEDIA_BACKEND_FS2(self), sess_id); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2758 | if (!session) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2759 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2760 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2761 | srtp = create_fs2_srtp_structure(cipher, auth, key, key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2762 | if (!srtp) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2763 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2764 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2765 | result = fs_session_set_encryption_parameters(session->session, srtp, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2766 | &err); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2767 | if (!result) { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2768 | purple_debug_error("backend-fs2", |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2769 | "Error setting encryption parameters: %s\n", err->message); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2770 | g_error_free(err); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2771 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2772 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2773 | gst_structure_free(srtp); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2774 | return result; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2775 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2776 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2777 | static gboolean |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2778 | purple_media_backend_fs2_set_decryption_parameters (PurpleMediaBackend *self, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2779 | const gchar *sess_id, const gchar *participant, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2780 | const gchar *cipher, const gchar *auth, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2781 | const gchar *key, gsize key_len) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2782 | { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2783 | PurpleMediaBackendFs2Stream *stream; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2784 | GstStructure *srtp; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2785 | GError *err = NULL; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2786 | gboolean result; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2787 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2788 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2789 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2790 | stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), sess_id, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2791 | participant); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2792 | if (!stream) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2793 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2794 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2795 | srtp = create_fs2_srtp_structure(cipher, auth, key, key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2796 | if (!srtp) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2797 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2798 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2799 | result = fs_stream_set_decryption_parameters(stream->stream, srtp, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2800 | &err); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2801 | if (!result) { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2802 | purple_debug_error("backend-fs2", |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2803 | "Error setting decryption parameters: %s\n", err->message); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2804 | g_error_free(err); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2805 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2806 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2807 | gst_structure_free(srtp); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2808 | return result; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2809 | } |
|
39717
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2810 | |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2811 | static gboolean |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2812 | purple_media_backend_fs2_set_require_encryption (PurpleMediaBackend *self, |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2813 | const gchar *sess_id, const gchar *participant, |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2814 | const gboolean require_encryption) |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2815 | { |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2816 | PurpleMediaBackendFs2Stream *stream; |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2817 | gboolean result; |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2818 | |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2819 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2820 | |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2821 | stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), sess_id, |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2822 | participant); |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2823 | if (!stream) |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2824 | return FALSE; |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2825 | |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2826 | g_object_set (stream->stream, "require-encryption", |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2827 | require_encryption, NULL); |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2828 | return TRUE; |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2829 | } |
|
610670ae4776
Add purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
39171
diff
changeset
|
2830 | |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2831 | #endif /* GST 1.0+ */ |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36317
diff
changeset
|
2832 | |
|
29590
bec92b90acc9
Change the media backend interface's set_send_codec to return gboolean to
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
2833 | static gboolean |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2834 | purple_media_backend_fs2_set_send_codec(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2835 | const gchar *sess_id, PurpleMediaCodec *codec) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2836 | { |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2837 | PurpleMediaBackendFs2Session *session; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2838 | FsCodec *fscodec; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2839 | GError *err = NULL; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2840 | |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2841 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2842 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2843 | session = get_session(PURPLE_MEDIA_BACKEND_FS2(self), sess_id); |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2844 | |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2845 | if (session == NULL) |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2846 | return FALSE; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2847 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2848 | fscodec = codec_to_fs(codec); |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2849 | fs_session_set_send_codec(session->session, fscodec, &err); |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2850 | fs_codec_destroy(fscodec); |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2851 | |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2852 | if (err) { |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2853 | purple_debug_error("media", "Error setting send codec\n"); |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2854 | g_error_free(err); |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2855 | return FALSE; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2856 | } |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2857 | |
|
29590
bec92b90acc9
Change the media backend interface's set_send_codec to return gboolean to
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
2858 | return TRUE; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2859 | } |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2860 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2861 | static const gchar ** |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2862 | purple_media_backend_fs2_get_available_params(void) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2863 | { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2864 | static const gchar *supported_params[] = { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2865 | "sdes-cname", "sdes-email", "sdes-location", "sdes-name", "sdes-note", |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2866 | "sdes-phone", "sdes-tool", NULL |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2867 | }; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2868 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2869 | return supported_params; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2870 | } |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2871 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2872 | static const gchar* |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2873 | param_to_sdes_type(const gchar *param) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2874 | { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2875 | const gchar **supported = purple_media_backend_fs2_get_available_params(); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2876 | static const gchar *sdes_types[] = { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2877 | "cname", "email", "location", "name", "note", "phone", "tool", NULL |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2878 | }; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2879 | guint i; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2880 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2881 | for (i = 0; supported[i] != NULL; ++i) { |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37798
diff
changeset
|
2882 | if (purple_strequal(param, supported[i])) { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2883 | return sdes_types[i]; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2884 | } |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2885 | } |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2886 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2887 | return NULL; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2888 | } |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2889 | |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2890 | static void |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2891 | purple_media_backend_fs2_set_params(PurpleMediaBackend *self, |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2892 | guint num_params, GParameter *params) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2893 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2894 | PurpleMediaBackendFs2Private *priv; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2895 | guint i; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2896 | #ifndef HAVE_FARSIGHT |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2897 | GstStructure *sdes; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2898 | #endif |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2899 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2900 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2901 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2902 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2903 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2904 | if (priv->conference == NULL && |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2905 | !init_conference(PURPLE_MEDIA_BACKEND_FS2(self))) { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2906 | purple_debug_error("backend-fs2", |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2907 | "Error initializing the conference.\n"); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2908 | return; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2909 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2910 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2911 | #ifdef HAVE_FARSIGHT |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2912 | for (i = 0; i != num_params; ++i) { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2913 | if (param_to_sdes_type(params[i].name)) { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2914 | g_object_set(priv->conference, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2915 | params[i].name, g_value_get_string(¶ms[i].value), |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2916 | NULL); |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2917 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2918 | } |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2919 | #else |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2920 | g_object_get(G_OBJECT(priv->conference), "sdes", &sdes, NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2921 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2922 | for (i = 0; i != num_params; ++i) { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2923 | const gchar *sdes_type = param_to_sdes_type(params[i].name); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2924 | if (!sdes_type) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2925 | continue; |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2926 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2927 | gst_structure_set(sdes, sdes_type, |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2928 | G_TYPE_STRING, g_value_get_string(¶ms[i].value), |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2929 | NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2930 | } |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2931 | |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2932 | g_object_set(G_OBJECT(priv->conference), "sdes", sdes, NULL); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2933 | gst_structure_free(sdes); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
2934 | #endif /* HAVE_FARSIGHT */ |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2935 | } |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2936 | static gboolean |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2937 | send_dtmf_callback(gpointer userdata) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2938 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2939 | FsSession *session = userdata; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2940 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2941 | fs_session_stop_telephony_event(session); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2942 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2943 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2944 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2945 | static gboolean |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2946 | purple_media_backend_fs2_send_dtmf(PurpleMediaBackend *self, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2947 | const gchar *sess_id, gchar dtmf, guint8 volume, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2948 | guint16 duration) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2949 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2950 | PurpleMediaBackendFs2Session *session; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2951 | FsDTMFEvent event; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2952 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2953 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2954 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2955 | session = get_session(PURPLE_MEDIA_BACKEND_FS2(self), sess_id); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2956 | if (session == NULL) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2957 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2958 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2959 | /* Convert DTMF char into FsDTMFEvent enum */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2960 | switch(dtmf) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2961 | case '0': event = FS_DTMF_EVENT_0; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2962 | case '1': event = FS_DTMF_EVENT_1; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2963 | case '2': event = FS_DTMF_EVENT_2; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2964 | case '3': event = FS_DTMF_EVENT_3; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2965 | case '4': event = FS_DTMF_EVENT_4; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2966 | case '5': event = FS_DTMF_EVENT_5; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2967 | case '6': event = FS_DTMF_EVENT_6; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2968 | case '7': event = FS_DTMF_EVENT_7; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2969 | case '8': event = FS_DTMF_EVENT_8; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2970 | case '9': event = FS_DTMF_EVENT_9; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2971 | case '*': event = FS_DTMF_EVENT_STAR; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2972 | case '#': event = FS_DTMF_EVENT_POUND; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2973 | case 'A': event = FS_DTMF_EVENT_A; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2974 | case 'B': event = FS_DTMF_EVENT_B; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2975 | case 'C': event = FS_DTMF_EVENT_C; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2976 | case 'D': event = FS_DTMF_EVENT_D; break; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2977 | default: |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2978 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2979 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2980 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2981 | if (!fs_session_start_telephony_event(session->session, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2982 | event, volume)) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2983 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2984 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2985 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2986 | if (duration <= 50) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2987 | fs_session_stop_telephony_event(session->session); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2988 | } else { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2989 | purple_timeout_add(duration, send_dtmf_callback, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2990 | session->session); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2991 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2992 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2993 | return TRUE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2994 | } |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2995 | #else |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2996 | GType |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2997 | purple_media_backend_fs2_get_type(void) |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2998 | { |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2999 | return G_TYPE_NONE; |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3000 | } |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3001 | #endif /* USE_VV */ |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
3002 | |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3003 | #ifdef USE_GSTREAMER |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3004 | GstElement * |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3005 | purple_media_backend_fs2_get_src(PurpleMediaBackendFs2 *self, |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3006 | const gchar *sess_id) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3007 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3008 | #ifdef USE_VV |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
3009 | PurpleMediaBackendFs2Session *session = get_session(self, sess_id); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3010 | return session != NULL ? session->src : NULL; |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3011 | #else |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3012 | return NULL; |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3013 | #endif |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3014 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3015 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3016 | GstElement * |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3017 | purple_media_backend_fs2_get_tee(PurpleMediaBackendFs2 *self, |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3018 | const gchar *sess_id, const gchar *who) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3019 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3020 | #ifdef USE_VV |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3021 | if (sess_id != NULL && who == NULL) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3022 | PurpleMediaBackendFs2Session *session = |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
3023 | get_session(self, sess_id); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3024 | return (session != NULL) ? session->tee : NULL; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3025 | } else if (sess_id != NULL && who != NULL) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3026 | PurpleMediaBackendFs2Stream *stream = |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
3027 | get_stream(self, sess_id, who); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3028 | return (stream != NULL) ? stream->tee : NULL; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3029 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3030 | |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3031 | #endif /* USE_VV */ |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3032 | g_return_val_if_reached(NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
3033 | } |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3034 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3035 | void |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3036 | purple_media_backend_fs2_set_input_volume(PurpleMediaBackendFs2 *self, |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3037 | const gchar *sess_id, double level) |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3038 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3039 | #ifdef USE_VV |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3040 | PurpleMediaBackendFs2Private *priv; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3041 | GList *sessions; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3042 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3043 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3044 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3045 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3046 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3047 | purple_prefs_set_int("/purple/media/audio/volume/input", level); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3048 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3049 | if (sess_id == NULL) |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3050 | sessions = g_hash_table_get_values(priv->sessions); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3051 | else |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
3052 | sessions = g_list_append(NULL, get_session(self, sess_id)); |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3053 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3054 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3055 | PurpleMediaBackendFs2Session *session = sessions->data; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3056 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3057 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3058 | gchar *name = g_strdup_printf("volume_%s", |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3059 | session->id); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3060 | GstElement *volume = gst_bin_get_by_name( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3061 | GST_BIN(priv->confbin), name); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3062 | g_free(name); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3063 | g_object_set(volume, "volume", level/10.0, NULL); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3064 | } |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3065 | } |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3066 | #endif /* USE_VV */ |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3067 | } |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3068 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3069 | void |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3070 | purple_media_backend_fs2_set_output_volume(PurpleMediaBackendFs2 *self, |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3071 | const gchar *sess_id, const gchar *who, double level) |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3072 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3073 | #ifdef USE_VV |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3074 | GList *streams; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3075 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3076 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self)); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3077 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3078 | purple_prefs_set_int("/purple/media/audio/volume/output", level); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3079 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
3080 | streams = get_streams(self, sess_id, who); |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3081 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3082 | for (; streams; streams = g_list_delete_link(streams, streams)) { |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3083 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3084 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3085 | if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3086 | && GST_IS_ELEMENT(stream->volume)) { |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3087 | g_object_set(stream->volume, "volume", |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3088 | level/10.0, NULL); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3089 | } |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3090 | } |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
3091 | #endif /* USE_VV */ |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
3092 | } |
|
29661
ae75a0a4d399
Fix compile with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29657
diff
changeset
|
3093 | #endif /* USE_GSTREAMER */ |
|
36321
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3094 | |
|
36343
4e2ee271e0e1
Fix compilation error when USE_VV is not defined.
Andrew Victor <andrew.victor@mxit.com>
parents:
36333
diff
changeset
|
3095 | #ifdef USE_VV |
|
36321
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3096 | static gboolean |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3097 | purple_media_backend_fs2_set_send_rtcp_mux(PurpleMediaBackend *self, |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3098 | const gchar *sess_id, const gchar *participant, |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3099 | gboolean send_rtcp_mux) |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3100 | { |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3101 | PurpleMediaBackendFs2Stream *stream; |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3102 | |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3103 | g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE); |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3104 | stream = get_stream(PURPLE_MEDIA_BACKEND_FS2(self), |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3105 | sess_id, participant); |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3106 | |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3107 | if (stream != NULL && |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3108 | g_object_class_find_property (G_OBJECT_GET_CLASS (stream->stream), |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3109 | "send-rtcp-mux") != NULL) { |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3110 | g_object_set (stream->stream, "send-rtcp-mux", send_rtcp_mux, NULL); |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3111 | return TRUE; |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3112 | } |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3113 | |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3114 | return FALSE; |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
3115 | } |
|
36343
4e2ee271e0e1
Fix compilation error when USE_VV is not defined.
Andrew Victor <andrew.victor@mxit.com>
parents:
36333
diff
changeset
|
3116 | #endif /* USE_VV */ |