Fri, 06 Mar 2015 21:03:03 +0000
Add out-of-band DTMF support and dialpad to use it
This is a backport of e4c122196b08 from the trunk. It adds the UI and
farstream backend support for sending DTMF.
Fixes #15575
|
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> |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
44 | #endif |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
45 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
46 | /** @copydoc _PurpleMediaBackendFs2Class */ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
47 | typedef struct _PurpleMediaBackendFs2Class PurpleMediaBackendFs2Class; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
48 | /** @copydoc _PurpleMediaBackendFs2Private */ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
49 | 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
|
50 | /** @copydoc _PurpleMediaBackendFs2Session */ |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
51 | 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
|
52 | /** @copydoc _PurpleMediaBackendFs2Stream */ |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
53 | typedef struct _PurpleMediaBackendFs2Stream PurpleMediaBackendFs2Stream; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
54 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
55 | #define PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj) \ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
56 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
57 | PURPLE_TYPE_MEDIA_BACKEND_FS2, PurpleMediaBackendFs2Private)) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
58 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
59 | 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
|
60 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
61 | 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
|
62 | 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
|
63 | 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
|
64 | 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
|
65 | 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
|
66 | 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
|
67 | 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
|
68 | 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
|
69 | PurpleMediaBackendFs2 *self); |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
70 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
71 | 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
|
72 | const gchar *sess_id, const gchar *who, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
73 | PurpleMediaSessionType type, gboolean initiator, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
74 | const gchar *transmitter, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
75 | guint num_params, GParameter *params); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
76 | 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
|
77 | PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
78 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
79 | GList *remote_candidates); |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
80 | 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
|
81 | const gchar *sess_id); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
82 | 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
|
83 | const gchar *sess_id); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
84 | 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
|
85 | PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
86 | const gchar *sess_id, const gchar *participant); |
|
29588
a3fef46ce04a
Make the backend interface's set_remote_codecs function return gboolean.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
87 | 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
|
88 | PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
89 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
90 | 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
|
91 | 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
|
92 | 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
|
93 | PurpleMediaCodec *codec); |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
94 | 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
|
95 | 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
|
96 | 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
|
97 | 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
|
98 | 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
|
99 | gchar dtmf, guint8 volume, guint16 duration); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
100 | |
|
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
|
101 | 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
|
102 | 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
|
103 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
104 | struct _PurpleMediaBackendFs2Class |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
105 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
106 | GObjectClass parent_class; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
107 | }; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
108 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
109 | struct _PurpleMediaBackendFs2 |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
110 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
111 | GObject parent; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
112 | }; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
113 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
114 | 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
|
115 | G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
116 | 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
|
117 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
118 | struct _PurpleMediaBackendFs2Stream |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
119 | { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
120 | PurpleMediaBackendFs2Session *session; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
121 | gchar *participant; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
122 | FsStream *stream; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
123 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
124 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
125 | gboolean supports_add; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
126 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
127 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
128 | 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
|
129 | 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
|
130 | 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
|
131 | 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
|
132 | 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
|
133 | 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
|
134 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
135 | GList *local_candidates; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
136 | GList *remote_candidates; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
137 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
138 | guint connected_cb_id; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
139 | }; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
140 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
141 | struct _PurpleMediaBackendFs2Session |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
142 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
143 | PurpleMediaBackendFs2 *backend; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
144 | gchar *id; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
145 | 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
|
146 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
147 | 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
|
148 | 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
|
149 | 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
|
150 | |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
151 | GstPad *srcpad; |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
152 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
153 | PurpleMediaSessionType type; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
154 | }; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
155 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
156 | struct _PurpleMediaBackendFs2Private |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
157 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
158 | PurpleMedia *media; |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
159 | GstElement *confbin; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
160 | FsConference *conference; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
161 | gchar *conference_type; |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
162 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
163 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
164 | FsElementAddedNotifier *notifier; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
165 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
166 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
167 | GHashTable *sessions; |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
168 | GHashTable *participants; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
169 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
170 | 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
|
171 | |
|
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 | gdouble silence_threshold; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
173 | }; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
174 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
175 | enum { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
176 | PROP_0, |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
177 | PROP_CONFERENCE_TYPE, |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
178 | PROP_MEDIA, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
179 | }; |
|
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 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
182 | 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
|
183 | {} |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
184 | |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
185 | static FsCandidateType |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
186 | 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
|
187 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
188 | switch (type) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
189 | case PURPLE_MEDIA_CANDIDATE_TYPE_HOST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
190 | return FS_CANDIDATE_TYPE_HOST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
191 | case PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
192 | return FS_CANDIDATE_TYPE_SRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
193 | case PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
194 | return FS_CANDIDATE_TYPE_PRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
195 | case PURPLE_MEDIA_CANDIDATE_TYPE_RELAY: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
196 | return FS_CANDIDATE_TYPE_RELAY; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
197 | case PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
198 | return FS_CANDIDATE_TYPE_MULTICAST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
199 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
200 | 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
|
201 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
202 | |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
203 | static PurpleMediaCandidateType |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
204 | 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
|
205 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
206 | switch (type) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
207 | case FS_CANDIDATE_TYPE_HOST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
208 | return PURPLE_MEDIA_CANDIDATE_TYPE_HOST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
209 | case FS_CANDIDATE_TYPE_SRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
210 | return PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
211 | case FS_CANDIDATE_TYPE_PRFLX: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
212 | return PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
213 | case FS_CANDIDATE_TYPE_RELAY: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
214 | return PURPLE_MEDIA_CANDIDATE_TYPE_RELAY; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
215 | case FS_CANDIDATE_TYPE_MULTICAST: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
216 | return PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
217 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
218 | 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
|
219 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
220 | |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
221 | static FsNetworkProtocol |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
222 | 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
|
223 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
224 | switch (protocol) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
225 | case PURPLE_MEDIA_NETWORK_PROTOCOL_UDP: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
226 | return FS_NETWORK_PROTOCOL_UDP; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
227 | case PURPLE_MEDIA_NETWORK_PROTOCOL_TCP: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
228 | return FS_NETWORK_PROTOCOL_TCP; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
229 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
230 | g_return_val_if_reached(FS_NETWORK_PROTOCOL_TCP); |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
231 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
232 | |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
233 | static PurpleMediaNetworkProtocol |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
234 | 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
|
235 | { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
236 | switch (protocol) { |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
237 | case FS_NETWORK_PROTOCOL_UDP: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
238 | return PURPLE_MEDIA_NETWORK_PROTOCOL_UDP; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
239 | case FS_NETWORK_PROTOCOL_TCP: |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
240 | return PURPLE_MEDIA_NETWORK_PROTOCOL_TCP; |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
241 | } |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
242 | g_return_val_if_reached(PURPLE_MEDIA_NETWORK_PROTOCOL_TCP); |
|
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 | |
|
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
|
245 | 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
|
246 | event_probe_cb(GstPad *srcpad, GstEvent *event, 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
|
247 | { |
|
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
|
248 | 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
|
249 | && 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
|
250 | |
|
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
|
251 | 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
|
252 | |
|
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
|
253 | 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
|
254 | |
|
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
|
255 | 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
|
256 | g_value_get_uint(gst_structure_get_value(s, "handler-id"))); |
|
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
|
257 | |
|
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
|
258 | 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
|
259 | 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
|
260 | |
|
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
|
261 | return FALSE; |
|
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
|
262 | } |
|
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
|
263 | |
|
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
|
264 | return TRUE; |
|
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
|
265 | } |
|
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
|
266 | |
|
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
|
267 | 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
|
268 | 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
|
269 | { |
|
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
|
270 | guint id = gst_pad_add_event_probe(srcpad, G_CALLBACK(event_probe_cb), 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
|
271 | |
|
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
|
272 | 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
|
273 | 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
|
274 | |
|
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
|
275 | 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
|
276 | 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
|
277 | 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
|
278 | "release-pad", G_TYPE_BOOLEAN, 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
|
279 | "handler-id", G_TYPE_UINT, id, |
|
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
|
280 | 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
|
281 | } |
|
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
|
282 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
283 | static void |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
284 | 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
|
285 | { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
286 | PurpleMediaBackendFs2Private *priv = |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
287 | PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj); |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
288 | 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
|
289 | |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
290 | 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
|
291 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
292 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
293 | if (priv->notifier) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
294 | g_object_unref(priv->notifier); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
295 | priv->notifier = NULL; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
296 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
297 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
298 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
299 | if (priv->confbin) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
300 | GstElement *pipeline; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
301 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
302 | 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
|
303 | 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
|
304 | |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
305 | /* 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
|
306 | * removed, to prevent freezing of any other simultaneously running |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
307 | * media calls. */ |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
308 | if (priv->sessions) { |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
309 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
310 | for (; sessions; sessions = |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
311 | g_list_delete_link(sessions, sessions)) { |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
312 | PurpleMediaBackendFs2Session *session = sessions->data; |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
313 | 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
|
314 | unlink_teepad_dynamic(session->srcpad, FALSE); |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
315 | gst_object_unref(session->srcpad); |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
316 | session->srcpad = NULL; |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
317 | } |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
318 | } |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
319 | } |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
320 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
321 | 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
|
322 | 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
|
323 | GST_STATE_NULL); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
324 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
325 | if (pipeline) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
326 | GstBus *bus; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
327 | 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
|
328 | 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
|
329 | 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
|
330 | 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
|
331 | 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
|
332 | 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
|
333 | 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
|
334 | } else { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
335 | 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
|
336 | "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
|
337 | "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
|
338 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
339 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
340 | priv->confbin = NULL; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
341 | priv->conference = NULL; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
342 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
343 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
344 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
345 | if (priv->sessions) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
346 | 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
|
347 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
348 | for (; sessions; sessions = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
349 | 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
|
350 | PurpleMediaBackendFs2Session *session = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
351 | sessions->data; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
352 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
353 | if (session->session) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
354 | 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
|
355 | session->session = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
356 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
357 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
358 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
359 | |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
360 | if (priv->participants) { |
|
30715
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30706
diff
changeset
|
361 | 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
|
362 | priv->participants = NULL; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
363 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
364 | |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
365 | for (iter = priv->streams; iter; iter = g_list_next(iter)) { |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
366 | PurpleMediaBackendFs2Stream *stream = iter->data; |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
367 | if (stream->stream) { |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
368 | g_object_unref(stream->stream); |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
369 | stream->stream = NULL; |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
370 | } |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
371 | } |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
372 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
373 | 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
|
374 | 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
|
375 | (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
|
376 | priv->media = NULL; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
377 | } |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
378 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
379 | 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
|
380 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
381 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
382 | static void |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
383 | purple_media_backend_fs2_finalize(GObject *obj) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
384 | { |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
385 | PurpleMediaBackendFs2Private *priv = |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
386 | 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
|
387 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
388 | 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
|
389 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
390 | 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
|
391 | |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
392 | for (; priv->streams; priv->streams = |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
393 | g_list_delete_link(priv->streams, priv->streams)) { |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
394 | 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
|
395 | free_stream(stream); |
|
29593
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
396 | } |
|
5274ab2ae88c
Properly free PurpleMediaBackendFs2Stream's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29592
diff
changeset
|
397 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
398 | if (priv->sessions) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
399 | 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
|
400 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
401 | for (; sessions; sessions = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
402 | 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
|
403 | PurpleMediaBackendFs2Session *session = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
404 | 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
|
405 | free_session(session); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
406 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
407 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
408 | 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
|
409 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
410 | |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
411 | 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
|
412 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
413 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
414 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
415 | 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
|
416 | const GValue *value, GParamSpec *pspec) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
417 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
418 | PurpleMediaBackendFs2Private *priv; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
419 | 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
|
420 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
421 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
422 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
423 | 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
|
424 | 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
|
425 | 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
|
426 | break; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
427 | 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
|
428 | 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
|
429 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
430 | 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
|
431 | break; |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
432 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
433 | 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
|
434 | (gpointer*)&priv->media); |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
435 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
436 | 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
|
437 | "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
|
438 | 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
|
439 | 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
|
440 | 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
|
441 | 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
|
442 | PURPLE_MEDIA_BACKEND_FS2(object)); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
443 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
444 | default: |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
445 | G_OBJECT_WARN_INVALID_PROPERTY_ID( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
446 | object, prop_id, pspec); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
447 | break; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
448 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
449 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
450 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
451 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
452 | 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
|
453 | GValue *value, GParamSpec *pspec) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
454 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
455 | PurpleMediaBackendFs2Private *priv; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
456 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
457 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
458 | priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
459 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
460 | 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
|
461 | 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
|
462 | 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
|
463 | break; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
464 | case PROP_MEDIA: |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
465 | g_value_set_object(value, priv->media); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
466 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
467 | default: |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
468 | G_OBJECT_WARN_INVALID_PROPERTY_ID( |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
469 | object, prop_id, pspec); |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
470 | break; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
471 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
472 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
473 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
474 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
475 | purple_media_backend_fs2_class_init(PurpleMediaBackendFs2Class *klass) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
476 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
477 | GObjectClass *gobject_class = (GObjectClass*)klass; |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
478 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
479 | 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
|
480 | gobject_class->finalize = purple_media_backend_fs2_finalize; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
481 | 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
|
482 | 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
|
483 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
484 | 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
|
485 | "conference-type"); |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
486 | 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
|
487 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
488 | g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private)); |
|
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 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
491 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
492 | purple_media_backend_iface_init(PurpleMediaBackendIface *iface) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
493 | { |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
494 | 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
|
495 | iface->add_remote_candidates = |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
496 | 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
|
497 | 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
|
498 | 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
|
499 | iface->get_local_candidates = |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
500 | purple_media_backend_fs2_get_local_candidates; |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
501 | 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
|
502 | iface->set_send_codec = purple_media_backend_fs2_set_send_codec; |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
503 | 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
|
504 | 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
|
505 | iface->send_dtmf = purple_media_backend_fs2_send_dtmf; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
506 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
507 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
508 | 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
|
509 | 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
|
510 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
511 | 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
|
512 | 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
|
513 | 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
|
514 | return FS_MEDIA_TYPE_VIDEO; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
515 | else |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
516 | return 0; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
517 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
518 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
519 | 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
|
520 | 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
|
521 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
522 | if ((type & PURPLE_MEDIA_AUDIO) == PURPLE_MEDIA_AUDIO || |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
523 | (type & PURPLE_MEDIA_VIDEO) == PURPLE_MEDIA_VIDEO) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
524 | return FS_DIRECTION_BOTH; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
525 | 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
|
526 | (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
|
527 | return FS_DIRECTION_SEND; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
528 | 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
|
529 | (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
|
530 | return FS_DIRECTION_RECV; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
531 | else |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
532 | return FS_DIRECTION_NONE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
533 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
534 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
535 | 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
|
536 | 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
|
537 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
538 | 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
|
539 | 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
|
540 | 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
|
541 | 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
|
542 | 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
|
543 | 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
|
544 | } 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
|
545 | 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
|
546 | 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
|
547 | 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
|
548 | result |= PURPLE_MEDIA_RECV_VIDEO; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
549 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
550 | return result; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
551 | } |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
552 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
553 | 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
|
554 | 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
|
555 | { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
556 | 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
|
557 | 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
|
558 | 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
|
559 | 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
|
560 | 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
|
561 | 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
|
562 | 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
|
563 | 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
|
564 | 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
|
565 | 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
|
566 | 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
|
567 | 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
|
568 | 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
|
569 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
570 | 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
|
571 | 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
|
572 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
573 | 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
|
574 | "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
|
575 | "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
|
576 | "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
|
577 | "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
|
578 | "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
|
579 | "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
|
580 | "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
|
581 | "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
|
582 | "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
|
583 | "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
|
584 | "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
|
585 | "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
|
586 | NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
587 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
588 | fscandidate = fs_candidate_new(foundation, |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
589 | 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
|
590 | 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
|
591 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
592 | 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
|
593 | 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
|
594 | 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
|
595 | 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
|
596 | 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
|
597 | 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
|
598 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
599 | 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
|
600 | 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
|
601 | 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
|
602 | } |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
603 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
604 | 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
|
605 | 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
|
606 | { |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
607 | 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
|
608 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
609 | 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
|
610 | 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
|
611 | 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
|
612 | } |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
613 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
614 | 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
|
615 | 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
|
616 | } |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
617 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
618 | 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
|
619 | 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
|
620 | { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
621 | 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
|
622 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
623 | 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
|
624 | 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
|
625 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
626 | 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
|
627 | fscandidate->component_id, |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
628 | 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
|
629 | 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
|
630 | 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
|
631 | 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
|
632 | "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
|
633 | "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
|
634 | "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
|
635 | "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
|
636 | "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
|
637 | "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
|
638 | 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
|
639 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
640 | |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
641 | 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
|
642 | 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
|
643 | { |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
644 | 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
|
645 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
646 | 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
|
647 | 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
|
648 | 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
|
649 | } |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
650 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
651 | 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
|
652 | return new_list; |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
653 | } |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
654 | |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
655 | 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
|
656 | 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
|
657 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
658 | FsCodec *new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
659 | gint id; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
660 | char *encoding_name; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
661 | PurpleMediaSessionType media_type; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
662 | guint clock_rate; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
663 | guint channels; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
664 | GList *iter; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
665 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
666 | if (codec == NULL) |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
667 | return NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
668 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
669 | 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
|
670 | "id", &id, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
671 | "encoding-name", &encoding_name, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
672 | "media-type", &media_type, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
673 | "clock-rate", &clock_rate, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
674 | "channels", &channels, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
675 | "optional-params", &iter, |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
676 | NULL); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
677 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
678 | 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
|
679 | 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
|
680 | clock_rate); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
681 | new_codec->channels = channels; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
682 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
683 | 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
|
684 | PurpleKeyValuePair *param = (PurpleKeyValuePair*)iter->data; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
685 | 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
|
686 | param->key, param->value); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
687 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
688 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
689 | g_free(encoding_name); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
690 | return new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
691 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
692 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
693 | 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
|
694 | 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
|
695 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
696 | PurpleMediaCodec *new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
697 | GList *iter; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
698 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
699 | if (codec == NULL) |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
700 | return NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
701 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
702 | 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
|
703 | 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
|
704 | 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
|
705 | 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
|
706 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
707 | 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
|
708 | FsCodecParameter *param = (FsCodecParameter*)iter->data; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
709 | 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
|
710 | param->name, param->value); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
711 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
712 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
713 | return new_codec; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
714 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
715 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
716 | 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
|
717 | 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
|
718 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
719 | GList *new_list = NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
720 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
721 | 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
|
722 | 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
|
723 | 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
|
724 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
725 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
726 | 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
|
727 | return new_list; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
728 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
729 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
730 | 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
|
731 | 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
|
732 | { |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
733 | GList *new_list = NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
734 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
735 | 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
|
736 | 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
|
737 | 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
|
738 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
739 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
740 | 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
|
741 | return new_list; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
742 | } |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
743 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
744 | 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
|
745 | 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
|
746 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
747 | PurpleMediaBackendFs2Private *priv; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
748 | PurpleMediaBackendFs2Session *session = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
749 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
750 | 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
|
751 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
752 | 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
|
753 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
754 | if (priv->sessions != NULL) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
755 | 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
|
756 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
757 | return session; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
758 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
759 | |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
760 | 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
|
761 | 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
|
762 | { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
763 | PurpleMediaBackendFs2Private *priv; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
764 | FsParticipant *participant = NULL; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
765 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
766 | 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
|
767 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
768 | 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
|
769 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
770 | if (priv->participants != NULL) |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
771 | 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
|
772 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
773 | return participant; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
774 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
775 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
776 | 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
|
777 | 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
|
778 | 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
|
779 | { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
780 | PurpleMediaBackendFs2Private *priv; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
781 | GList *streams; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
782 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
783 | 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
|
784 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
785 | 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
|
786 | streams = priv->streams; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
787 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
788 | 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
|
789 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
790 | if (!strcmp(stream->session->id, sess_id) && |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
791 | !strcmp(stream->participant, name)) |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
792 | return stream; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
793 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
794 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
795 | return NULL; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
796 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
797 | |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
798 | 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
|
799 | 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
|
800 | 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
|
801 | { |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
802 | PurpleMediaBackendFs2Private *priv; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
803 | 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
|
804 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
805 | 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
|
806 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
807 | 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
|
808 | streams = priv->streams; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
809 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
810 | 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
|
811 | 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
|
812 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
813 | if (sess_id != NULL && strcmp(stream->session->id, sess_id)) |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
814 | continue; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
815 | else if (name != NULL && strcmp(stream->participant, name)) |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
816 | continue; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
817 | else |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
818 | 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
|
819 | } |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
820 | |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
821 | 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
|
822 | return ret; |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
823 | } |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
824 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
825 | 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
|
826 | 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
|
827 | { |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
828 | 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
|
829 | 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
|
830 | 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
|
831 | 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
|
832 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
833 | 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
|
834 | 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
|
835 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
836 | 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
|
837 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
838 | 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
|
839 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
840 | 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
|
841 | 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
|
842 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
843 | 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
|
844 | 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
|
845 | 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
|
846 | 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
|
847 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
848 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
849 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
850 | 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
|
851 | 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
|
852 | } |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
853 | |
|
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
|
854 | 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
|
855 | 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
|
856 | { |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
857 | 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
|
858 | 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
|
859 | 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
|
860 | 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
|
861 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
862 | list = gst_structure_get_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
|
863 | gst_message_get_structure(msg), 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
|
864 | value = gst_value_list_get_value(list, 0); |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
865 | 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
|
866 | 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
|
867 | 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
|
868 | } |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
869 | |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
870 | 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
|
871 | 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
|
872 | PurpleMediaBackendFs2 *self) |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
873 | { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
874 | PurpleMediaBackendFs2Private *priv = |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
875 | 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
|
876 | 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
|
877 | static guint 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
|
878 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
879 | 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
|
880 | 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
|
881 | |
|
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
|
882 | if (gst_structure_has_name(msg->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
|
883 | 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
|
884 | 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
|
885 | 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
|
886 | 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
|
887 | 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
|
888 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
889 | 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
|
890 | 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
|
891 | return; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
892 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
893 | 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
|
894 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
895 | 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
|
896 | 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
|
897 | 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
|
898 | 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
|
899 | 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
|
900 | "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
|
901 | } |
|
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
|
902 | } |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
903 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
904 | 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
|
905 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
906 | 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
|
907 | 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
|
908 | |
|
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
909 | 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
|
910 | 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
|
911 | 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
|
912 | 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
|
913 | 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
|
914 | 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
|
915 | 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
|
916 | 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
|
917 | break; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
918 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
919 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
920 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
921 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
922 | 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
|
923 | return; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
924 | |
|
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
|
925 | 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
|
926 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
927 | 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
|
928 | 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
|
929 | return; |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
930 | } |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
931 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
932 | 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
|
933 | 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
|
934 | return; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
935 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
936 | #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
|
937 | if (gst_structure_has_name(msg->structure, "farsight-error")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
938 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
939 | if (gst_structure_has_name(msg->structure, "farstream-error")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
940 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
941 | FsError error_no; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
942 | gst_structure_get_enum(msg->structure, "error-no", |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
943 | 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
|
944 | switch (error_no) { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
945 | case FS_ERROR_NO_CODECS: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
946 | purple_media_error(priv->media, _("No codecs" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
947 | " found. Install some" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
948 | " GStreamer codecs found" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
949 | " in GStreamer plugins" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
950 | " packages.")); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
951 | 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
|
952 | break; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
953 | #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
|
954 | case FS_ERROR_NO_CODECS_LEFT: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
955 | purple_media_error(priv->media, _("No codecs" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
956 | " left. Your codec" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
957 | " preferences in" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
958 | " fs-codecs.conf are too" |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
959 | " strict.")); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
960 | 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
|
961 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
962 | case FS_ERROR_UNKNOWN_CNAME: |
|
32110
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
963 | /* |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
964 | * Unknown CName is only a problem for the |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
965 | * multicast transmitter which isn't used. |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
966 | * It is also deprecated. |
|
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
967 | */ |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
968 | break; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
969 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
970 | default: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
971 | purple_debug_error("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
972 | #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
|
973 | "farsight-error: %i: %s\n", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
974 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
975 | "farstream-error: %i: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
976 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
977 | error_no, |
|
32110
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
978 | gst_structure_get_string( |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
979 | msg->structure, "error-msg")); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
980 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
981 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
982 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
983 | if (FS_ERROR_IS_FATAL(error_no)) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
984 | #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
|
985 | purple_media_error(priv->media, _("A non-recoverable " |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
986 | "Farsight2 error has occurred.")); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
987 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
988 | purple_media_error(priv->media, _("A non-recoverable " |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
989 | "Farstream error has occurred.")); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
990 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
991 | 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
|
992 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
993 | } else if (gst_structure_has_name(msg->structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
994 | #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
|
995 | "farsight-new-local-candidate")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
996 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
997 | "farstream-new-local-candidate")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
998 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
999 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1000 | FsStream *stream; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1001 | 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
|
1002 | 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
|
1003 | 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
|
1004 | PurpleMediaBackendFs2Session *session; |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
1005 | PurpleMediaBackendFs2Stream *media_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
|
1006 | gchar *name; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1007 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1008 | value = gst_structure_get_value(msg->structure, "stream"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1009 | stream = 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
|
1010 | value = gst_structure_get_value(msg->structure, "candidate"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1011 | 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
|
1012 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1013 | 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
|
1014 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1015 | 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
|
1016 | "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
|
1017 | 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
|
1018 | |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1019 | g_object_get(stream, "participant", &participant, NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1020 | g_object_get(participant, "cname", &name, NULL); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1021 | g_object_unref(participant); |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
1022 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1023 | 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
|
1024 | 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
|
1025 | 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
|
1026 | 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
|
1027 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1028 | 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
|
1029 | 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
|
1030 | 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
|
1031 | g_object_unref(candidate); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1032 | } else if (gst_structure_has_name(msg->structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1033 | #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
|
1034 | "farsight-local-candidates-prepared")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1035 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1036 | "farstream-local-candidates-prepared")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1037 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1038 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1039 | 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
|
1040 | 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
|
1041 | PurpleMediaBackendFs2Session *session; |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1042 | gchar *name; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1043 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1044 | value = gst_structure_get_value(msg->structure, "stream"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1045 | 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
|
1046 | 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
|
1047 | |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1048 | 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
|
1049 | g_object_get(participant, "cname", &name, NULL); |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1050 | g_object_unref(participant); |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1051 | |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1052 | g_signal_emit_by_name(self, "candidates-prepared", |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
1053 | session->id, name); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1054 | } else if (gst_structure_has_name(msg->structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1055 | #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
|
1056 | "farsight-new-active-candidate-pair")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1057 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1058 | "farstream-new-active-candidate-pair")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1059 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1060 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1061 | FsStream *stream; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1062 | FsCandidate *local_candidate; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1063 | 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
|
1064 | 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
|
1065 | 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
|
1066 | PurpleMediaCandidate *lcandidate, *rcandidate; |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1067 | gchar *name; |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1068 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1069 | value = gst_structure_get_value(msg->structure, "stream"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1070 | stream = 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
|
1071 | value = gst_structure_get_value(msg->structure, |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1072 | "local-candidate"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1073 | local_candidate = 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
|
1074 | value = gst_structure_get_value(msg->structure, |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1075 | "remote-candidate"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1076 | 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
|
1077 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1078 | 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
|
1079 | g_object_get(participant, "cname", &name, NULL); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1080 | g_object_unref(participant); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1081 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1082 | 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
|
1083 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1084 | 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
|
1085 | 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
|
1086 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1087 | g_signal_emit_by_name(self, "active-candidate-pair", |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1088 | session->id, name, lcandidate, rcandidate); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1089 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1090 | 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
|
1091 | g_object_unref(rcandidate); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1092 | } else if (gst_structure_has_name(msg->structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1093 | #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
|
1094 | "farsight-recv-codecs-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1095 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1096 | "farstream-recv-codecs-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1097 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1098 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1099 | GList *codecs; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1100 | FsCodec *codec; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1101 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1102 | value = gst_structure_get_value(msg->structure, "codecs"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1103 | 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
|
1104 | codec = codecs->data; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1105 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1106 | purple_debug_info("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1107 | #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
|
1108 | "farsight-recv-codecs-changed: %s\n", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1109 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1110 | "farstream-recv-codecs-changed: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1111 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1112 | codec->encoding_name); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1113 | } else if (gst_structure_has_name(msg->structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1114 | #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
|
1115 | "farsight-component-state-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1116 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1117 | "farstream-component-state-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1118 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1119 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1120 | FsStreamState fsstate; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1121 | guint component; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1122 | const gchar *state; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1123 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1124 | value = gst_structure_get_value(msg->structure, "state"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1125 | fsstate = g_value_get_enum(value); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1126 | value = gst_structure_get_value(msg->structure, "component"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1127 | 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
|
1128 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1129 | switch (fsstate) { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1130 | 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
|
1131 | state = "FAILED"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1132 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1133 | 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
|
1134 | state = "DISCONNECTED"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1135 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1136 | 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
|
1137 | state = "GATHERING"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1138 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1139 | 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
|
1140 | state = "CONNECTING"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1141 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1142 | 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
|
1143 | state = "CONNECTED"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1144 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1145 | 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
|
1146 | state = "READY"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1147 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1148 | default: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1149 | state = "UNKNOWN"; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1150 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1151 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1152 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1153 | purple_debug_info("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1154 | #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
|
1155 | "farsight-component-state-changed: " |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1156 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1157 | "farstream-component-state-changed: " |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1158 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1159 | "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
|
1160 | component, state); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1161 | } else if (gst_structure_has_name(msg->structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1162 | #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
|
1163 | "farsight-send-codec-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1164 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1165 | "farstream-send-codec-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1166 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1167 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1168 | FsCodec *codec; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1169 | gchar *codec_str; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1170 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1171 | value = gst_structure_get_value(msg->structure, "codec"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1172 | 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
|
1173 | 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
|
1174 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1175 | purple_debug_info("backend-fs2", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1176 | #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
|
1177 | "farsight-send-codec-changed: codec: %s\n", |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1178 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1179 | "farstream-send-codec-changed: codec: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1180 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1181 | codec_str); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1182 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1183 | g_free(codec_str); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1184 | } else if (gst_structure_has_name(msg->structure, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1185 | #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
|
1186 | "farsight-codecs-changed")) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1187 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1188 | "farstream-codecs-changed")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1189 | #endif |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1190 | const GValue *value; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1191 | FsSession *fssession; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1192 | GList *sessions; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1193 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1194 | value = gst_structure_get_value(msg->structure, "session"); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1195 | 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
|
1196 | 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
|
1197 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1198 | for (; sessions; sessions = |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1199 | 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
|
1200 | 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
|
1201 | gchar *session_id; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1202 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1203 | 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
|
1204 | continue; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1205 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1206 | 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
|
1207 | 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
|
1208 | session_id); |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1209 | 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
|
1210 | 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
|
1211 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1212 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1213 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1214 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1215 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1216 | 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
|
1217 | 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
|
1218 | PurpleMediaBackendFs2 *self) |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1219 | { |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1220 | PurpleMediaBackendFs2Private *priv = |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1221 | 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
|
1222 | 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
|
1223 | GstElement *lastElement = NULL; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1224 | GList *sessions; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1225 | |
|
31807
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1226 | GError *error = NULL; |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1227 | 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
|
1228 | |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1229 | 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
|
1230 | 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
|
1231 | 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
|
1232 | |
|
ea1e6ba109cc
media: Fix a NULL pointer deref crash, and add diagnostic logging.
Paul Aurich <darkrain42@pidgin.im>
parents:
31687
diff
changeset
|
1233 | 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
|
1234 | 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
|
1235 | |
|
31824
6942cb72f357
media/backend-fs2: Better fix for the NULL deref crash here.
Paul Aurich <darkrain42@pidgin.im>
parents:
31807
diff
changeset
|
1236 | 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
|
1237 | 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
|
1238 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1239 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1240 | lastElement = element; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1241 | 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
|
1242 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1243 | |
|
31824
6942cb72f357
media/backend-fs2: Better fix for the NULL deref crash here.
Paul Aurich <darkrain42@pidgin.im>
parents:
31807
diff
changeset
|
1244 | 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
|
1245 | return; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1246 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1247 | 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
|
1248 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1249 | for (; sessions; sessions = 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
|
1250 | 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
|
1251 | != lastElement) |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1252 | continue; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1253 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1254 | if (purple_media_get_session_type(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
|
1255 | & PURPLE_MEDIA_AUDIO) |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1256 | 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
|
1257 | _("Error with your microphone")); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1258 | else |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1259 | 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
|
1260 | _("Error with your webcam")); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1261 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1262 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1263 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1264 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1265 | 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
|
1266 | |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1267 | purple_media_error(priv->media, _("Conference error")); |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1268 | 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
|
1269 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1270 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
1271 | 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
|
1272 | 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
|
1273 | { |
|
29568
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1274 | 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
|
1275 | 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
|
1276 | 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
|
1277 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1278 | 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
|
1279 | 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
|
1280 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1281 | default: |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1282 | break; |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1283 | } |
|
e2fcbaf4409c
Transfer some GStreamer message handling to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29564
diff
changeset
|
1284 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1285 | return TRUE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1286 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1287 | |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1288 | 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
|
1289 | 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
|
1290 | { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1291 | 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
|
1292 | 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
|
1293 | 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
|
1294 | 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
|
1295 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1296 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1297 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1298 | 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
|
1299 | 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
|
1300 | 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
|
1301 | { |
|
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
|
1302 | 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
|
1303 | 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
|
1304 | 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
|
1305 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1306 | 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
|
1307 | 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
|
1308 | 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
|
1309 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1310 | 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
|
1311 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1312 | 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
|
1313 | 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
|
1314 | 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
|
1315 | 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
|
1316 | 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
|
1317 | 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
|
1318 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1319 | 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
|
1320 | } 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
|
1321 | 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
|
1322 | 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
|
1323 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1324 | 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
|
1325 | 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
|
1326 | 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
|
1327 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1328 | 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
|
1329 | 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
|
1330 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1331 | pad = gst_pad_get_peer(session->srcpad); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1332 | gst_element_remove_pad(GST_ELEMENT_PARENT(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
|
1333 | 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
|
1334 | gst_object_unref(session->srcpad); |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1335 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1336 | 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
|
1337 | 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
|
1338 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1339 | 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
|
1340 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1341 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1342 | 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
|
1343 | 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
|
1344 | } |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1345 | } |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1346 | |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1347 | 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
|
1348 | 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
|
1349 | 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
|
1350 | PurpleMediaBackendFs2 *self) |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1351 | { |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1352 | 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
|
1353 | 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
|
1354 | 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
|
1355 | 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
|
1356 | |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1357 | 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
|
1358 | 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
|
1359 | 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
|
1360 | |
|
29648
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
1361 | if (stream->remote_candidates == NULL || |
|
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
1362 | 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
|
1363 | return; |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1364 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1365 | #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
|
1366 | 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
|
1367 | stream->remote_candidates, &err); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1368 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1369 | if (stream->supports_add) |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1370 | fs_stream_add_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1371 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1372 | else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1373 | fs_stream_force_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1374 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1375 | #endif |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1376 | |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1377 | 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
|
1378 | return; |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1379 | |
|
29619
5c64f74c2ebd
Handle individual streams in the Fs2 backend's stream-info callback for accept
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
1380 | 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
|
1381 | "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
|
1382 | 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
|
1383 | g_error_free(err); |
|
29603
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1384 | } 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
|
1385 | type == PURPLE_MEDIA_INFO_UNMUTE)) { |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1386 | PurpleMediaBackendFs2Private *priv = |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1387 | 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
|
1388 | 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
|
1389 | GList *sessions; |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1390 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1391 | if (sid == NULL) |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1392 | 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
|
1393 | else |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1394 | 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
|
1395 | get_session(self, sid)); |
|
29603
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1396 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1397 | 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
|
1398 | active ? "on" : "off"); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1399 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1400 | 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
|
1401 | sessions, sessions)) { |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1402 | PurpleMediaBackendFs2Session *session = |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1403 | sessions->data; |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1404 | |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1405 | 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
|
1406 | 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
|
1407 | session->id); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1408 | 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
|
1409 | GST_BIN(priv->confbin), name); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1410 | g_free(name); |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1411 | 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
|
1412 | } |
|
271b6eb28f54
Move mute functionality into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29601
diff
changeset
|
1413 | } |
|
31278
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1414 | } 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
|
1415 | 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
|
1416 | 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
|
1417 | 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
|
1418 | 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
|
1419 | 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
|
1420 | 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
|
1421 | 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
|
1422 | 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
|
1423 | 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
|
1424 | 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
|
1425 | ~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
|
1426 | 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
|
1427 | } |
|
3314c614763c
Stop sending audio when placing a call on hold. Fixes #13032.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30769
diff
changeset
|
1428 | } |
|
29594
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1429 | } 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
|
1430 | type == PURPLE_MEDIA_INFO_UNPAUSE)) { |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1431 | 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
|
1432 | 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
|
1433 | for (; streams; streams = |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1434 | g_list_delete_link(streams, streams)) { |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1435 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1436 | 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
|
1437 | 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
|
1438 | 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
|
1439 | stream->session->type & ((active) ? |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1440 | ~PURPLE_MEDIA_SEND_VIDEO : |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1441 | PURPLE_MEDIA_VIDEO)), NULL); |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1442 | } |
|
1eefaad00189
Move pause functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29593
diff
changeset
|
1443 | } |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1444 | } |
|
29564
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1445 | } |
|
fa76e21160fd
Various tweaks, fixes, and added debug output. Attached some media signals,
Michael Ruprecht <maiku@pidgin.im>
parents:
29559
diff
changeset
|
1446 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1447 | 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
|
1448 | 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
|
1449 | { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1450 | PurpleMediaBackendFs2Private *priv = |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1451 | 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
|
1452 | GstElement *pipeline; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1453 | GstBus *bus; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1454 | gchar *name; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1455 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1456 | GKeyFile *default_props; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1457 | #endif |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1458 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1459 | 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
|
1460 | 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
|
1461 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1462 | 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
|
1463 | 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
|
1464 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1465 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1466 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1467 | 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
|
1468 | 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
|
1469 | 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
|
1470 | "/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
|
1471 | else |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1472 | 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
|
1473 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1474 | 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
|
1475 | 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
|
1476 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1477 | if (pipeline == NULL) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1478 | 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
|
1479 | "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
|
1480 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1481 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1482 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1483 | 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
|
1484 | 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
|
1485 | 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
|
1486 | 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
|
1487 | "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
|
1488 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1489 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1490 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1491 | g_free(name); |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1492 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1493 | 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
|
1494 | if (bus == NULL) { |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1495 | 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
|
1496 | "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
|
1497 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1498 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1499 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1500 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1501 | 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
|
1502 | if (default_props != NULL) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1503 | priv->notifier = fs_element_added_notifier_new(); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1504 | fs_element_added_notifier_add(priv->notifier, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1505 | GST_BIN(priv->confbin)); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1506 | 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
|
1507 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1508 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1509 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1510 | 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
|
1511 | 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
|
1512 | 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
|
1513 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1514 | 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
|
1515 | 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
|
1516 | 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
|
1517 | "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
|
1518 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1519 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1520 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1521 | 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
|
1522 | 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
|
1523 | 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
|
1524 | "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
|
1525 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1526 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1527 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1528 | 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
|
1529 | 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
|
1530 | 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
|
1531 | "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
|
1532 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1533 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1534 | |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1535 | return TRUE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1536 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1537 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1538 | 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
|
1539 | 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
|
1540 | 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
|
1541 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1542 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1543 | * 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
|
1544 | */ |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1545 | 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
|
1546 | 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
|
1547 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1548 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1549 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1550 | 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
|
1551 | 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
|
1552 | 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
|
1553 | { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1554 | 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
|
1555 | 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
|
1556 | 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
|
1557 | 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
|
1558 | 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
|
1559 | 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
|
1560 | 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
|
1561 | 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
|
1562 | GstPad *sinkpad, *srcpad; |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1563 | 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
|
1564 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1565 | 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
|
1566 | return TRUE; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
1567 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1568 | 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
|
1569 | 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
|
1570 | 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
|
1571 | 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
|
1572 | 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
|
1573 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1574 | 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
|
1575 | 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
|
1576 | "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
|
1577 | 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
|
1578 | 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
|
1579 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1580 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1581 | 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
|
1582 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1583 | 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
|
1584 | 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
|
1585 | "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
|
1586 | " 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
|
1587 | 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
|
1588 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1589 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1590 | 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
|
1591 | 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
|
1592 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1593 | 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
|
1594 | 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
|
1595 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1596 | 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
|
1597 | 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
|
1598 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1599 | /* 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
|
1600 | 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
|
1601 | == 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
|
1602 | 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
|
1603 | 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
|
1604 | 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
|
1605 | 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
|
1606 | 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
|
1607 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1608 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1609 | 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
|
1610 | gst_element_link(session->src, priv->confbin); |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1611 | if (ghost) |
|
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1612 | 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
|
1613 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1614 | 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
|
1615 | 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
|
1616 | 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
|
1617 | 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
|
1618 | 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
|
1619 | 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
|
1620 | "/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
|
1621 | 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
|
1622 | 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
|
1623 | 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
|
1624 | 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
|
1625 | 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
|
1626 | 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
|
1627 | 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
|
1628 | 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
|
1629 | 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
|
1630 | 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
|
1631 | 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
|
1632 | 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
|
1633 | 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
|
1634 | 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
|
1635 | 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
|
1636 | 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
|
1637 | } else { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1638 | srcpad = gst_element_get_request_pad(session->tee, "src%d"); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1639 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1640 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
1641 | 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
|
1642 | 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
|
1643 | ? "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
|
1644 | 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
|
1645 | 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
|
1646 | 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
|
1647 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1648 | gst_element_set_state(session->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
|
1649 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1650 | 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
|
1651 | 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
|
1652 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1653 | 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
|
1654 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1655 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1656 | 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
|
1657 | 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
|
1658 | PurpleMediaSessionType type, gboolean initiator, |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1659 | const gchar *transmitter) |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1660 | { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1661 | PurpleMediaBackendFs2Private *priv = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1662 | 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
|
1663 | PurpleMediaBackendFs2Session *session; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1664 | GError *err = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1665 | 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
|
1666 | gchar *filename = NULL; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1667 | gboolean is_nice = !strcmp(transmitter, "nice"); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1668 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1669 | 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
|
1670 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1671 | 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
|
1672 | 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
|
1673 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1674 | if (err != NULL) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1675 | 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
|
1676 | _("Error creating session: %s"), |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1677 | err->message); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1678 | g_error_free(err); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1679 | g_free(session); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1680 | return FALSE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1681 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1682 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1683 | 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
|
1684 | 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
|
1685 | g_free(filename); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1686 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1687 | if (err != NULL) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1688 | if (err->code == 4) |
|
29580
ee364f895072
Correct some debug categories.
Michael Ruprecht <maiku@pidgin.im>
parents:
29579
diff
changeset
|
1689 | 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
|
1690 | "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
|
1691 | err->message); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1692 | else |
|
29580
ee364f895072
Correct some debug categories.
Michael Ruprecht <maiku@pidgin.im>
parents:
29579
diff
changeset
|
1693 | 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
|
1694 | "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
|
1695 | err->message); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1696 | g_error_free(err); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1697 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1698 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1699 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1700 | * 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
|
1701 | * 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
|
1702 | */ |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1703 | 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
|
1704 | FsCodec *codec = iter->data; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1705 | 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
|
1706 | break; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1707 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1708 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1709 | if (iter == NULL) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1710 | 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
|
1711 | 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
|
1712 | "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
|
1713 | 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
|
1714 | 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
|
1715 | "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
|
1716 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1717 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1718 | 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
|
1719 | 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
|
1720 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1721 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1722 | * 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
|
1723 | * 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
|
1724 | * 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
|
1725 | */ |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1726 | if (!!strcmp(transmitter, "multicast")) |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1727 | 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
|
1728 | "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
|
1729 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1730 | /* |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1731 | * 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
|
1732 | */ |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1733 | if (is_nice && !strcmp(sess_id, "google-video")) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1734 | FsElementAddedNotifier *notifier = |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1735 | 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
|
1736 | 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
|
1737 | 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
|
1738 | 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
|
1739 | GST_BIN(priv->conference)); |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1740 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1741 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1742 | 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
|
1743 | session->backend = self; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1744 | session->type = type; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1745 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1746 | if (!priv->sessions) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1747 | 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
|
1748 | "Creating hash table for sessions\n"); |
|
30715
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30706
diff
changeset
|
1749 | 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
|
1750 | g_free, NULL); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1751 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1752 | |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1753 | 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
|
1754 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
1755 | 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
|
1756 | 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
|
1757 | 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
|
1758 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1759 | |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1760 | return TRUE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1761 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1762 | |
|
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
|
1763 | 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
|
1764 | 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
|
1765 | { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1766 | 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
|
1767 | 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
|
1768 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
1769 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
1770 | 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
|
1771 | 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
|
1772 | { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1773 | PurpleMediaBackendFs2Private *priv = |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1774 | 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
|
1775 | FsParticipant *participant; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1776 | GError *err = NULL; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1777 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1778 | participant = fs_conference_new_participant( |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1779 | #ifdef HAVE_FARSIGHT |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1780 | priv->conference, name, &err); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1781 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1782 | priv->conference, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1783 | #endif |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1784 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1785 | if (err) { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1786 | 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
|
1787 | "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
|
1788 | err->message); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1789 | g_error_free(err); |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1790 | return FALSE; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1791 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1792 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1793 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1794 | 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
|
1795 | "cname")) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1796 | g_object_set(participant, "cname", name, NULL); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1797 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1798 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1799 | |
|
29579
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1800 | if (!priv->participants) { |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1801 | 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
|
1802 | "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
|
1803 | 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
|
1804 | 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
|
1805 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1806 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1807 | 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
|
1808 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1809 | return TRUE; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1810 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1811 | |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
1812 | 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
|
1813 | 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
|
1814 | { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1815 | 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
|
1816 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1817 | 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
|
1818 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1819 | 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
|
1820 | 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
|
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 | 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
|
1823 | 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
|
1824 | 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
|
1825 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1826 | 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
|
1827 | 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
|
1828 | 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
|
1829 | 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
|
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 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1832 | 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
|
1833 | 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
|
1834 | 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
|
1835 | { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1836 | 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
|
1837 | 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
|
1838 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1839 | 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
|
1840 | 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
|
1841 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1842 | 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
|
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 | 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
|
1845 | 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
|
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 | 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
|
1848 | 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
|
1849 | "/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
|
1850 | /* |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1851 | * 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
|
1852 | * 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
|
1853 | * 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
|
1854 | */ |
|
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
|
1855 | stream->queue = gst_element_factory_make("queue", 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
|
1856 | stream->volume = gst_element_factory_make( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1857 | "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
|
1858 | g_object_set(stream->volume, "volume", |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1859 | output_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
|
1860 | stream->level = gst_element_factory_make( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1861 | "level", NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1862 | stream->src = gst_element_factory_make( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1863 | "liveadder", NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1864 | 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
|
1865 | 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
|
1866 | 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
|
1867 | 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
|
1868 | 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
|
1869 | 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
|
1870 | 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
|
1871 | 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
|
1872 | 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
|
1873 | 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
|
1874 | 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
|
1875 | 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
|
1876 | 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
|
1877 | 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
|
1878 | 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
|
1879 | 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
|
1880 | 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
|
1881 | } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) { |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1882 | stream->src = gst_element_factory_make( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1883 | "fsfunnel", NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1884 | sink = gst_element_factory_make( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1885 | "fakesink", NULL); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1886 | 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
|
1887 | 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
|
1888 | 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
|
1889 | stream->fakesink = sink; |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1890 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1891 | 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
|
1892 | 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
|
1893 | 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
|
1894 | 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
|
1895 | 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
|
1896 | 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
|
1897 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1898 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1899 | sinkpad = gst_element_get_request_pad(stream->src, "sink%d"); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1900 | 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
|
1901 | 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
|
1902 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1903 | 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
|
1904 | (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
|
1905 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1906 | |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1907 | static GValueArray * |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1908 | 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
|
1909 | 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
|
1910 | { |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1911 | GValue value; |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1912 | GstStructure *turn_setup = gst_structure_new("relay-info", |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
1913 | "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
|
1914 | "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
|
1915 | "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
|
1916 | "password", G_TYPE_STRING, password, |
|
32110
cf3fc2a5c274
Whitespace normalization
Richard Laager <rlaager@pidgin.im>
parents:
31860
diff
changeset
|
1917 | "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
|
1918 | NULL); |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1919 | |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1920 | 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
|
1921 | 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
|
1922 | 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
|
1923 | 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
|
1924 | 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
|
1925 | 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
|
1926 | 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
|
1927 | 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
|
1928 | } |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1929 | |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
1930 | 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
|
1931 | } |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
1932 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1933 | 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
|
1934 | 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
|
1935 | 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
|
1936 | PurpleMediaSessionType type, gboolean initiator, |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1937 | const gchar *transmitter, |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1938 | 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
|
1939 | { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1940 | PurpleMediaBackendFs2Private *priv = |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1941 | 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
|
1942 | GError *err = NULL; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1943 | FsStream *fsstream = NULL; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1944 | 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
|
1945 | 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
|
1946 | guint _num_params = num_params; |
|
32111
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1947 | GParameter *_params; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1948 | 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
|
1949 | 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
|
1950 | PurpleMediaBackendFs2Session *session; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1951 | PurpleMediaBackendFs2Stream *stream; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
1952 | 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
|
1953 | /* 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
|
1954 | 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
|
1955 | 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
|
1956 | 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
|
1957 | guint i; |
|
30766
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
1958 | |
|
32111
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1959 | session = get_session(self, sess_id); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1960 | |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1961 | if (session == NULL) { |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1962 | purple_debug_error("backend-fs2", |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1963 | "Couldn't find session to create stream.\n"); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1964 | return FALSE; |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1965 | } |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1966 | |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1967 | participant = get_participant(self, who); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1968 | |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1969 | if (participant == NULL) { |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1970 | purple_debug_error("backend-fs2", "Couldn't find " |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1971 | "participant to create stream.\n"); |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1972 | return FALSE; |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1973 | } |
|
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
1974 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1975 | #ifndef HAVE_FARSIGHT |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1976 | fsstream = fs_session_new_stream(session->session, participant, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1977 | initiator == TRUE ? type_direction : |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1978 | (type_direction & FS_DIRECTION_RECV), &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1979 | |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1980 | if (fsstream == NULL) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1981 | if (err) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1982 | purple_debug_error("backend-fs2", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1983 | "Error creating stream: %s\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1984 | err && err->message ? |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1985 | err->message : "NULL"); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1986 | g_error_free(err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1987 | } else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1988 | purple_debug_error("backend-fs2", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1989 | "Error creating stream\n"); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1990 | return FALSE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1991 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1992 | #endif |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
1993 | |
|
30766
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
1994 | 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
|
1995 | 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
|
1996 | 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
|
1997 | break; |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
1998 | } |
|
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
1999 | } |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2000 | |
|
32111
1a0b313cc0b7
Reorder create_stream()
Richard Laager <rlaager@pidgin.im>
parents:
32110
diff
changeset
|
2001 | _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
|
2002 | 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
|
2003 | |
|
29688
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2004 | /* 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
|
2005 | _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
|
2006 | 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
|
2007 | 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
|
2008 | ++_num_params; |
|
d5409dbda6e7
media: "Backport" the ICE controlling-mode fix in the new media subdirectory
Marcus Lundblad <malu@pidgin.im>
parents:
29661
diff
changeset
|
2009 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2010 | if (stun_ip) { |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
2011 | 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
|
2012 | "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
|
2013 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2014 | _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
|
2015 | 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
|
2016 | 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
|
2017 | ++_num_params; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2018 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2019 | |
|
30766
602dc4de31cf
Make the check for PRPL-supplied TURN parameters in the new place
Marcus Lundblad <malu@pidgin.im>
parents:
29723
diff
changeset
|
2020 | if (turn_ip && !strcmp("nice", transmitter) && !got_turn_from_prpl) { |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2021 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2022 | GValueArray *relay_info = g_value_array_new(0); |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2023 | 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
|
2024 | gint port; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2025 | 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
|
2026 | "/purple/network/turn_username"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2027 | 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
|
2028 | "/purple/network/turn_password"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2029 | |
|
30622
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2030 | /* UDP */ |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2031 | 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
|
2032 | if (port > 0) { |
|
aa5a1b0e69bd
Added ability to relay over TCP and TLS for TURN for media.
Marcus Lundblad <malu@pidgin.im>
parents:
30424
diff
changeset
|
2033 | 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
|
2034 | password, "udp"); |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2035 | } |
|
31831
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2036 | |
|
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2037 | /* TCP */ |
|
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2038 | 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
|
2039 | if (port > 0) { |
|
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2040 | 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
|
2041 | password, "tcp"); |
|
31831
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2042 | } |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2043 | |
|
31831
c3778a69ecee
Add support for using TCP relaying with TURN
Marcus Lundblad <malu@pidgin.im>
parents:
31824
diff
changeset
|
2044 | /* 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
|
2045 | at this time */ |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31278
diff
changeset
|
2046 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2047 | 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
|
2048 | "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
|
2049 | _params[_num_params].name = "relay-info"; |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2050 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2051 | 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
|
2052 | 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
|
2053 | g_value_array_free(relay_info); |
|
35978
c0b60f37a7db
Backport warning fixes for libpurple from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
32115
diff
changeset
|
2054 | 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
|
2055 | _num_params++; |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2056 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2057 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2058 | #ifdef HAVE_FARSIGHT |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2059 | 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
|
2060 | initiator == TRUE ? type_direction : |
|
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2061 | (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
|
2062 | _num_params, _params, &err); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2063 | g_free(_params); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2064 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2065 | if (fsstream == NULL) { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2066 | if (err) { |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2067 | 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
|
2068 | "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
|
2069 | err && err->message ? |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2070 | err->message : "NULL"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2071 | g_error_free(err); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2072 | } else |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2073 | 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
|
2074 | "Error creating stream\n"); |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2075 | return FALSE; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2076 | } |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2077 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2078 | if (!fs_stream_set_transmitter(fsstream, transmitter, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2079 | _params, _num_params, &err)) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2080 | purple_debug_error("backend-fs2", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2081 | "Could not set transmitter %s: %s.\n", |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2082 | transmitter, err->message); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2083 | g_clear_error(&err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2084 | g_free(_params); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2085 | return FALSE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2086 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2087 | g_free(_params); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2088 | #endif |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2089 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2090 | 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
|
2091 | 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
|
2092 | stream->session = session; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2093 | stream->stream = fsstream; |
|
32115
410435e8fae5
Fix typo that was breaking compilation for me
Mark Doliner <markdoliner@pidgin.im>
parents:
32114
diff
changeset
|
2094 | #ifndef HAVE_FARSIGHT |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2095 | stream->supports_add = !strcmp(transmitter, "nice"); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2096 | #endif |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2097 | |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2098 | 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
|
2099 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2100 | 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
|
2101 | 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
|
2102 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2103 | return TRUE; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2104 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2105 | |
|
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
|
2106 | 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
|
2107 | 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
|
2108 | { |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2109 | /* 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
|
2110 | 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
|
2111 | 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
|
2112 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2113 | 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
|
2114 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2115 | 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
|
2116 | 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
|
2117 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2118 | 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
|
2119 | 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
|
2120 | |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2121 | 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
|
2122 | } |
|
5a2acc3fb58c
Allow adding or removing media sessions (voice or video) on-the-fly. This
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31566
diff
changeset
|
2123 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2124 | static gboolean |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2125 | purple_media_backend_fs2_add_stream(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2126 | const gchar *sess_id, const gchar *who, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2127 | PurpleMediaSessionType type, gboolean initiator, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2128 | const gchar *transmitter, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2129 | guint num_params, GParameter *params) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2130 | { |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2131 | 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
|
2132 | PurpleMediaBackendFs2Private *priv = |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2133 | 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
|
2134 | PurpleMediaBackendFs2Stream *stream; |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2135 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2136 | 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
|
2137 | 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
|
2138 | "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
|
2139 | return FALSE; |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2140 | } |
|
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2141 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2142 | 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
|
2143 | !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
|
2144 | initiator, transmitter)) { |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2145 | 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
|
2146 | "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
|
2147 | return FALSE; |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2148 | } |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
2149 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2150 | 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
|
2151 | !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
|
2152 | 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
|
2153 | "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
|
2154 | return FALSE; |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2155 | } |
|
bbe57f516ffd
Add participant creation and destruction to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
2156 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2157 | 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
|
2158 | |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2159 | if (stream != NULL) { |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2160 | 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
|
2161 | 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
|
2162 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2163 | 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
|
2164 | 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
|
2165 | /* change direction */ |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2166 | 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
|
2167 | type_direction, NULL); |
|
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
2168 | } |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2169 | } 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
|
2170 | 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
|
2171 | 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
|
2172 | "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
|
2173 | return FALSE; |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2174 | } |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29580
diff
changeset
|
2175 | |
|
29559
fc9fa90d7c4a
Create and dispose the conference in the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29556
diff
changeset
|
2176 | return TRUE; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2177 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2178 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2179 | static void |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2180 | 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
|
2181 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2182 | GList *remote_candidates) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2183 | { |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2184 | PurpleMediaBackendFs2Private *priv; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2185 | PurpleMediaBackendFs2Stream *stream; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2186 | 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
|
2187 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2188 | 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
|
2189 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2190 | 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
|
2191 | 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
|
2192 | 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
|
2193 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2194 | 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
|
2195 | 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
|
2196 | "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
|
2197 | "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
|
2198 | 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
|
2199 | 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
|
2200 | return; |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2201 | } |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2202 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2203 | 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
|
2204 | 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
|
2205 | |
|
29648
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2206 | 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
|
2207 | purple_media_accepted( |
|
be1362619ef2
Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
Michael Ruprecht <maiku@pidgin.im>
parents:
29623
diff
changeset
|
2208 | priv->media, sess_id, participant)) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2209 | #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
|
2210 | 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
|
2211 | stream->remote_candidates, &err); |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2212 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2213 | if (stream->supports_add) |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2214 | fs_stream_add_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2215 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2216 | else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2217 | fs_stream_force_remote_candidates(stream->stream, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2218 | stream->remote_candidates, &err); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2219 | #endif |
|
29583
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2220 | |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2221 | if (err) { |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2222 | 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
|
2223 | " 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
|
2224 | 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
|
2225 | } |
|
706454e8df2b
Transfer setting Farsight 2's remote candidates to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29582
diff
changeset
|
2226 | } |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2227 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2228 | |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2229 | static gboolean |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2230 | 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
|
2231 | const gchar *sess_id) |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2232 | { |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2233 | PurpleMediaBackendFs2Private *priv; |
|
30627
5aba54c21ca3
Fix a possible Garbage return value.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30424
diff
changeset
|
2234 | gboolean ret = FALSE; |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2235 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2236 | 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
|
2237 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2238 | 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
|
2239 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2240 | 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
|
2241 | PurpleMediaBackendFs2Session *session = get_session( |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2242 | 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
|
2243 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2244 | if (session == NULL) |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2245 | return FALSE; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2246 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2247 | if (session->type & (PURPLE_MEDIA_SEND_AUDIO | |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2248 | PURPLE_MEDIA_SEND_VIDEO)) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2249 | #ifdef HAVE_FARSIGHT |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2250 | g_object_get(session->session, |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2251 | "codecs-ready", &ret, NULL); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2252 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2253 | GList *codecs = NULL; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2254 | |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2255 | g_object_get(session->session, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2256 | "codecs", &codecs, NULL); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2257 | if (codecs) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2258 | fs_codec_list_destroy (codecs); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2259 | ret = TRUE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2260 | } |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2261 | #endif |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2262 | } else |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2263 | ret = TRUE; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2264 | } else { |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2265 | 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
|
2266 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2267 | 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
|
2268 | PurpleMediaBackendFs2Session *session = values->data; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2269 | |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2270 | if (session->type & (PURPLE_MEDIA_SEND_AUDIO | |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2271 | PURPLE_MEDIA_SEND_VIDEO)) { |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2272 | #ifdef HAVE_FARSIGHT |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2273 | g_object_get(session->session, |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2274 | "codecs-ready", &ret, NULL); |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2275 | if (ret == FALSE) |
|
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2276 | break; |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2277 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2278 | GList *codecs = NULL; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2279 | |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2280 | g_object_get(session->session, |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2281 | "codecs", &codecs, NULL); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2282 | if (codecs) { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2283 | fs_codec_list_destroy (codecs); |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2284 | ret = TRUE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2285 | } else { |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2286 | ret = FALSE; |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
32112
diff
changeset
|
2287 | break; |
|
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 | #endif |
|
32112
721223fa619b
Minor refactoring of purple_media_backend_fs2_codecs_ready()
Richard Laager <rlaager@pidgin.im>
parents:
32111
diff
changeset
|
2290 | } else |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2291 | ret = TRUE; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2292 | } |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2293 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2294 | if (values != NULL) |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2295 | g_list_free(values); |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2296 | } |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2297 | |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2298 | return ret; |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2299 | } |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
2300 | |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2301 | static GList * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2302 | purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2303 | const gchar *sess_id) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2304 | { |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2305 | PurpleMediaBackendFs2Session *session; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2306 | GList *fscodecs; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2307 | GList *codecs; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2308 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2309 | 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
|
2310 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2311 | 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
|
2312 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2313 | if (session == NULL) |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2314 | return NULL; |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2315 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2316 | 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
|
2317 | "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
|
2318 | 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
|
2319 | fs_codec_list_destroy(fscodecs); |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2320 | |
|
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29583
diff
changeset
|
2321 | return codecs; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2322 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2323 | |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2324 | static GList * |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2325 | 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
|
2326 | const gchar *sess_id, const gchar *participant) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2327 | { |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2328 | PurpleMediaBackendFs2Stream *stream; |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2329 | GList *candidates = NULL; |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2330 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2331 | 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
|
2332 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2333 | 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
|
2334 | sess_id, participant); |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2335 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2336 | 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
|
2337 | 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
|
2338 | stream->local_candidates); |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29586
diff
changeset
|
2339 | return candidates; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2340 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2341 | |
|
29588
a3fef46ce04a
Make the backend interface's set_remote_codecs function return gboolean.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
2342 | static gboolean |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2343 | 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
|
2344 | const gchar *sess_id, const gchar *participant, |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2345 | GList *codecs) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2346 | { |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2347 | PurpleMediaBackendFs2Stream *stream; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2348 | GList *fscodecs; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2349 | GError *err = NULL; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2350 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2351 | 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
|
2352 | 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
|
2353 | sess_id, participant); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2354 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2355 | if (stream == NULL) |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2356 | return FALSE; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2357 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2358 | 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
|
2359 | 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
|
2360 | 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
|
2361 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2362 | if (err) { |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2363 | 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
|
2364 | "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
|
2365 | err->message); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2366 | g_error_free(err); |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2367 | return FALSE; |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2368 | } |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2369 | |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29588
diff
changeset
|
2370 | return TRUE; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2371 | } |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2372 | |
|
29590
bec92b90acc9
Change the media backend interface's set_send_codec to return gboolean to
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
2373 | static gboolean |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2374 | 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
|
2375 | const gchar *sess_id, PurpleMediaCodec *codec) |
|
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2376 | { |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2377 | PurpleMediaBackendFs2Session *session; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2378 | FsCodec *fscodec; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2379 | GError *err = NULL; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2380 | |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2381 | 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
|
2382 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2383 | 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
|
2384 | |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2385 | if (session == NULL) |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2386 | return FALSE; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2387 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2388 | 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
|
2389 | 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
|
2390 | fs_codec_destroy(fscodec); |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2391 | |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2392 | if (err) { |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2393 | 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
|
2394 | g_error_free(err); |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2395 | return FALSE; |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2396 | } |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29590
diff
changeset
|
2397 | |
|
29590
bec92b90acc9
Change the media backend interface's set_send_codec to return gboolean to
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
2398 | return TRUE; |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2399 | } |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2400 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2401 | static void |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2402 | 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
|
2403 | 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
|
2404 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2405 | PurpleMediaBackendFs2Private *priv; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2406 | const gchar **supported = purple_media_backend_fs2_get_available_params(); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2407 | const gchar **p; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2408 | guint i; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2409 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2410 | 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
|
2411 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2412 | 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
|
2413 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2414 | 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
|
2415 | !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
|
2416 | 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
|
2417 | "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
|
2418 | return; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2419 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2420 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2421 | for (i = 0; i != num_params; ++i) { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2422 | for (p = supported; *p != NULL; ++p) { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2423 | if (!strcmp(params[i].name, *p)) { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2424 | g_object_set(priv->conference, |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2425 | params[i].name, g_value_get_string(¶ms[i].value), |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2426 | NULL); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2427 | break; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2428 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2429 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2430 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2431 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2432 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2433 | static const gchar ** |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2434 | purple_media_backend_fs2_get_available_params(void) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2435 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2436 | static const gchar *supported_params[] = { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2437 | "sdes-cname", "sdes-email", "sdes-location", "sdes-name", "sdes-note", |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2438 | "sdes-phone", "sdes-tool", NULL |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2439 | }; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2440 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2441 | return supported_params; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31618
diff
changeset
|
2442 | } |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2443 | static gboolean |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2444 | 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
|
2445 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2446 | 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
|
2447 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2448 | 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
|
2449 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2450 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2451 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2452 | static gboolean |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2453 | 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
|
2454 | 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
|
2455 | guint16 duration) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2456 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2457 | PurpleMediaBackendFs2Session *session; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2458 | FsDTMFEvent event; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2459 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2460 | 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
|
2461 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2462 | 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
|
2463 | 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
|
2464 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2465 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2466 | /* 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
|
2467 | switch(dtmf) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2468 | 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
|
2469 | 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
|
2470 | 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
|
2471 | 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
|
2472 | 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
|
2473 | 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
|
2474 | 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
|
2475 | 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
|
2476 | 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
|
2477 | 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
|
2478 | 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
|
2479 | 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
|
2480 | 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
|
2481 | 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
|
2482 | 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
|
2483 | 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
|
2484 | default: |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2485 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2486 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2487 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2488 | 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
|
2489 | event, volume)) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2490 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2491 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2492 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2493 | 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
|
2494 | 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
|
2495 | } else { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2496 | 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
|
2497 | session->session); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2498 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2499 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2500 | return TRUE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
2501 | } |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2502 | #else |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2503 | GType |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2504 | 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
|
2505 | { |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2506 | 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
|
2507 | } |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2508 | #endif /* USE_VV */ |
|
29556
ebf1af169279
Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2509 | |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2510 | #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
|
2511 | GstElement * |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2512 | 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
|
2513 | 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
|
2514 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2515 | #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
|
2516 | 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
|
2517 | 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
|
2518 | #else |
|
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2519 | 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
|
2520 | #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
|
2521 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2522 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2523 | GstElement * |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2524 | 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
|
2525 | 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
|
2526 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2527 | #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
|
2528 | 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
|
2529 | 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
|
2530 | 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
|
2531 | 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
|
2532 | } 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
|
2533 | 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
|
2534 | 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
|
2535 | 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
|
2536 | } |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
2537 | |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2538 | #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
|
2539 | 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
|
2540 | } |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2541 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2542 | void |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2543 | 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
|
2544 | 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
|
2545 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2546 | #ifdef USE_VV |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2547 | PurpleMediaBackendFs2Private *priv; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2548 | GList *sessions; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2549 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2550 | 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
|
2551 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2552 | 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
|
2553 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2554 | 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
|
2555 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2556 | if (sess_id == NULL) |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2557 | 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
|
2558 | else |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2559 | 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
|
2560 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2561 | 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
|
2562 | PurpleMediaBackendFs2Session *session = sessions->data; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2563 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2564 | 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
|
2565 | 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
|
2566 | session->id); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2567 | 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
|
2568 | GST_BIN(priv->confbin), name); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2569 | g_free(name); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2570 | 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
|
2571 | } |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2572 | } |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2573 | #endif /* USE_VV */ |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2574 | } |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2575 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2576 | void |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2577 | 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
|
2578 | 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
|
2579 | { |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2580 | #ifdef USE_VV |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2581 | GList *streams; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2582 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2583 | 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
|
2584 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2585 | 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
|
2586 | |
|
29623
664df0ecb40f
Remove the underscore from functions as the underscore is reserved for compilers
Michael Ruprecht <maiku@pidgin.im>
parents:
29619
diff
changeset
|
2587 | 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
|
2588 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2589 | 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
|
2590 | PurpleMediaBackendFs2Stream *stream = streams->data; |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2591 | |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2592 | 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
|
2593 | && GST_IS_ELEMENT(stream->volume)) { |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2594 | 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
|
2595 | level/10.0, NULL); |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2596 | } |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2597 | } |
|
29657
d7e6c5fcabcc
Wraps backend-fs2.c in #ifdefs for when VV or GSTREAMER is disabled.
Michael Ruprecht <maiku@pidgin.im>
parents:
29648
diff
changeset
|
2598 | #endif /* USE_VV */ |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
2599 | } |
|
29661
ae75a0a4d399
Fix compile with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29657
diff
changeset
|
2600 | #endif /* USE_GSTREAMER */ |