Mon, 16 Sep 2013 22:53:40 +0530
Refactored finch grouping plugin to use the new plugin API
| 19883 | 1 | /** |
| 19889 | 2 | * @file media.c Media API |
| 19883 | 3 | * @ingroup core |
|
26105
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
4 | */ |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
5 | |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
6 | /* purple |
| 19883 | 7 | * |
| 8 | * Purple is the legal property of its developers, whose names are too numerous | |
| 9 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 10 | * source distribution. | |
| 11 | * | |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
28321
c8d617c408ab
Update various header copyrights thanks to licensecheck.
Paul Aurich <darkrain42@pidgin.im>
parents:
28162
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 19883 | 25 | */ |
| 19889 | 26 | #include "internal.h" |
| 27 | ||
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
28 | #include "account.h" |
| 19883 | 29 | #include "media.h" |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
30 | #include "media/backend-iface.h" |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26112
diff
changeset
|
31 | #include "mediamanager.h" |
| 19883 | 32 | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
33 | #include "debug.h" |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
34 | |
|
26771
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
35 | #ifdef USE_GSTREAMER |
|
29661
ae75a0a4d399
Fix compile with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29655
diff
changeset
|
36 | #include "media/backend-fs2.h" |
|
26792
17140fe8c2f6
Include the media API on win32 even though it isn't actually enabled.
Daniel Atallah <datallah@pidgin.im>
parents:
26771
diff
changeset
|
37 | #include "marshallers.h" |
|
26771
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
38 | #include "media-gst.h" |
|
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
39 | #endif |
|
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
40 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
41 | #ifdef USE_VV |
| 19883 | 42 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
43 | /** @copydoc _PurpleMediaSession */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
44 | typedef struct _PurpleMediaSession PurpleMediaSession; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
45 | /** @copydoc _PurpleMediaStream */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
46 | typedef struct _PurpleMediaStream PurpleMediaStream; |
|
26613
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
47 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
48 | struct _PurpleMediaSession |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
49 | { |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
50 | gchar *id; |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
51 | PurpleMedia *media; |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
52 | PurpleMediaSessionType type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
53 | gboolean initiator; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
54 | }; |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
55 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
56 | struct _PurpleMediaStream |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
57 | { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
58 | PurpleMediaSession *session; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
59 | gchar *participant; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
60 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
61 | GList *local_candidates; |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
62 | GList *remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
63 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
64 | gboolean initiator; |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
65 | gboolean accepted; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
66 | gboolean candidates_prepared; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
67 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
68 | GList *active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
69 | GList *active_remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
70 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
71 | #endif |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
72 | |
| 19883 | 73 | struct _PurpleMediaPrivate |
| 74 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
75 | #ifdef USE_VV |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
76 | PurpleMediaManager *manager; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
77 | PurpleAccount *account; |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
78 | PurpleMediaBackend *backend; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
79 | gchar *conference_type; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
80 | gboolean initiator; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
81 | gpointer protocol_data; |
| 19883 | 82 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
83 | GHashTable *sessions; /* PurpleMediaSession table */ |
|
29615
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
84 | GList *participants; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
85 | GList *streams; /* PurpleMediaStream table */ |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
86 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
87 | gpointer dummy; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
88 | #endif |
| 19883 | 89 | }; |
| 90 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
91 | #ifdef USE_VV |
| 19883 | 92 | #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) |
| 93 | ||
| 94 | static void purple_media_class_init (PurpleMediaClass *klass); | |
| 95 | static void purple_media_init (PurpleMedia *media); | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
96 | static void purple_media_dispose (GObject *object); |
| 19883 | 97 | static void purple_media_finalize (GObject *object); |
| 98 | static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 99 | static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
| 100 | ||
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
101 | static void purple_media_new_local_candidate_cb(PurpleMediaBackend *backend, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
102 | const gchar *sess_id, const gchar *participant, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
103 | PurpleMediaCandidate *candidate, PurpleMedia *media); |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
104 | static void purple_media_candidates_prepared_cb(PurpleMediaBackend *backend, |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
105 | const gchar *sess_id, const gchar *name, PurpleMedia *media); |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
106 | static void purple_media_candidate_pair_established_cb( |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
107 | PurpleMediaBackend *backend, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
108 | const gchar *sess_id, const gchar *name, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
109 | PurpleMediaCandidate *local_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
110 | PurpleMediaCandidate *remote_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
111 | PurpleMedia *media); |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
112 | static void purple_media_codecs_changed_cb(PurpleMediaBackend *backend, |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
113 | const gchar *sess_id, PurpleMedia *media); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
114 | |
| 19883 | 115 | static GObjectClass *parent_class = NULL; |
| 116 | ||
| 117 | ||
| 118 | ||
| 119 | enum { | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
120 | S_ERROR, |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
121 | CANDIDATES_PREPARED, |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
122 | CODECS_CHANGED, |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
123 | LEVEL, |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
124 | NEW_CANDIDATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
125 | STATE_CHANGED, |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
126 | STREAM_INFO, |
| 19883 | 127 | LAST_SIGNAL |
| 128 | }; | |
| 129 | static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
| 130 | ||
| 131 | enum { | |
| 132 | PROP_0, | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
133 | PROP_MANAGER, |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
134 | PROP_BACKEND, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
135 | PROP_ACCOUNT, |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
136 | PROP_CONFERENCE_TYPE, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
137 | PROP_INITIATOR, |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
138 | PROP_PROTOCOL_DATA, |
| 19883 | 139 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
140 | #endif |
| 19883 | 141 | |
|
26618
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
142 | |
| 19883 | 143 | GType |
| 144 | purple_media_get_type() | |
| 145 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
146 | #ifdef USE_VV |
| 19883 | 147 | static GType type = 0; |
| 148 | ||
| 149 | if (type == 0) { | |
| 150 | static const GTypeInfo info = { | |
| 151 | sizeof(PurpleMediaClass), | |
| 152 | NULL, | |
| 153 | NULL, | |
| 154 | (GClassInitFunc) purple_media_class_init, | |
| 155 | NULL, | |
| 156 | NULL, | |
| 157 | sizeof(PurpleMedia), | |
| 158 | 0, | |
|
22071
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
159 | (GInstanceInitFunc) purple_media_init, |
|
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
160 | NULL |
| 19883 | 161 | }; |
| 162 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
| 163 | } | |
| 164 | return type; | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
165 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
166 | return G_TYPE_NONE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
167 | #endif |
| 19883 | 168 | } |
| 169 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
170 | #ifdef USE_VV |
| 19883 | 171 | static void |
| 172 | purple_media_class_init (PurpleMediaClass *klass) | |
| 173 | { | |
| 174 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
| 175 | parent_class = g_type_class_peek_parent(klass); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
176 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
177 | gobject_class->dispose = purple_media_dispose; |
| 19883 | 178 | gobject_class->finalize = purple_media_finalize; |
| 179 | gobject_class->set_property = purple_media_set_property; | |
| 180 | gobject_class->get_property = purple_media_get_property; | |
| 181 | ||
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
182 | g_object_class_install_property(gobject_class, PROP_MANAGER, |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
183 | g_param_spec_object("manager", |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
184 | "Purple Media Manager", |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
185 | "The media manager that contains this media session.", |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
186 | PURPLE_TYPE_MEDIA_MANAGER, |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
187 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
188 | |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
189 | /* |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
190 | * This one should be PURPLE_TYPE_MEDIA_BACKEND, but it doesn't |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
191 | * like interfaces because they "aren't GObjects" |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
192 | */ |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
193 | g_object_class_install_property(gobject_class, PROP_BACKEND, |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
194 | g_param_spec_object("backend", |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
195 | "Purple Media Backend", |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
196 | "The backend object this media object uses.", |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
197 | G_TYPE_OBJECT, |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
198 | G_PARAM_READABLE)); |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
199 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
200 | g_object_class_install_property(gobject_class, PROP_ACCOUNT, |
|
34923
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
201 | g_param_spec_pointer("account", "PurpleAccount", |
|
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
202 | "The account this media session is on.", |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
203 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
204 | |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
205 | g_object_class_install_property(gobject_class, PROP_CONFERENCE_TYPE, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
206 | g_param_spec_string("conference-type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
207 | "Conference Type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
208 | "The type of conference that this media object " |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
209 | "has been created to provide.", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
210 | NULL, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
211 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
212 | |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
213 | g_object_class_install_property(gobject_class, PROP_INITIATOR, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
214 | g_param_spec_boolean("initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
215 | "initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
216 | "If the local user initiated the conference.", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
217 | FALSE, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
218 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
219 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
220 | g_object_class_install_property(gobject_class, PROP_PROTOCOL_DATA, |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
221 | g_param_spec_pointer("protocol-data", |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
222 | "gpointer", |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
223 | "Data the protocol set on the media session.", |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
224 | G_PARAM_READWRITE)); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
225 | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
226 | purple_media_signals[S_ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
227 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
228 | g_cclosure_marshal_VOID__STRING, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
229 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
230 | purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
231 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
232 | purple_smarshal_VOID__STRING_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
233 | G_TYPE_NONE, 2, G_TYPE_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
234 | G_TYPE_STRING); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
235 | purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass), |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
236 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
237 | g_cclosure_marshal_VOID__STRING, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
238 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
239 | purple_media_signals[LEVEL] = g_signal_new("level", G_TYPE_FROM_CLASS(klass), |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
240 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
241 | purple_smarshal_VOID__STRING_STRING_DOUBLE, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
242 | G_TYPE_NONE, 3, G_TYPE_STRING, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
243 | G_TYPE_STRING, G_TYPE_DOUBLE); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
244 | purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass), |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
245 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
246 | purple_smarshal_VOID__POINTER_POINTER_OBJECT, |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
247 | G_TYPE_NONE, 3, G_TYPE_POINTER, |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
248 | G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
249 | purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
250 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
251 | purple_smarshal_VOID__ENUM_STRING_STRING, |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
252 | G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
253 | G_TYPE_STRING, G_TYPE_STRING); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
254 | purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass), |
|
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
255 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
256 | purple_smarshal_VOID__ENUM_STRING_STRING_BOOLEAN, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
257 | G_TYPE_NONE, 4, PURPLE_MEDIA_TYPE_INFO_TYPE, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
258 | G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
259 | g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
| 19883 | 260 | } |
| 261 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
262 | |
| 19883 | 263 | static void |
| 264 | purple_media_init (PurpleMedia *media) | |
| 265 | { | |
| 266 | media->priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
|
26406
9cd3c72d787d
Zero out the proper size for the PurpleMediaPrivate structure.
Michael Ruprecht <maiku@pidgin.im>
parents:
26340
diff
changeset
|
267 | memset(media->priv, 0, sizeof(*media->priv)); |
| 19883 | 268 | } |
| 269 | ||
| 270 | static void | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
271 | purple_media_stream_free(PurpleMediaStream *stream) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
272 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
273 | if (stream == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
274 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
275 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
276 | g_free(stream->participant); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
277 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
278 | if (stream->local_candidates) |
|
29575
a9700491f857
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
279 | purple_media_candidate_list_free(stream->local_candidates); |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
280 | if (stream->remote_candidates) |
|
29576
b6988ade0028
Store remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29575
diff
changeset
|
281 | purple_media_candidate_list_free(stream->remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
282 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
283 | if (stream->active_local_candidates) |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
284 | purple_media_candidate_list_free( |
|
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
285 | stream->active_local_candidates); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
286 | if (stream->active_remote_candidates) |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
287 | purple_media_candidate_list_free( |
|
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
288 | stream->active_remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
289 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
290 | g_free(stream); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
291 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
292 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
293 | static void |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
294 | purple_media_session_free(PurpleMediaSession *session) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
295 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
296 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
297 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
298 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
299 | g_free(session->id); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
300 | g_free(session); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
301 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
302 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
303 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
304 | purple_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
305 | { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
306 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
307 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
308 | purple_debug_info("media","purple_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
309 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
310 | purple_media_manager_remove_media(priv->manager, PURPLE_MEDIA(media)); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
311 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
312 | if (priv->backend) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
313 | g_object_unref(priv->backend); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
314 | priv->backend = NULL; |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
315 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
316 | |
|
29567
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
317 | if (priv->manager) { |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
318 | g_object_unref(priv->manager); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
319 | priv->manager = NULL; |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
320 | } |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
321 | |
| 26412 | 322 | G_OBJECT_CLASS(parent_class)->dispose(media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
323 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
324 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
325 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
326 | purple_media_finalize(GObject *media) |
| 19883 | 327 | { |
|
23711
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
328 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
329 | purple_debug_info("media","purple_media_finalize\n"); |
|
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
330 | |
|
26181
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
331 | for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams)) |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
332 | purple_media_stream_free(priv->streams->data); |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
333 | |
|
29615
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
334 | for (; priv->participants; priv->participants = g_list_delete_link( |
|
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
335 | priv->participants, priv->participants)) |
|
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
336 | g_free(priv->participants->data); |
|
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
337 | |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
338 | if (priv->sessions) { |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
339 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
340 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
341 | purple_media_session_free(sessions->data); |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
342 | } |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
343 | g_hash_table_destroy(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
344 | } |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
345 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
346 | G_OBJECT_CLASS(parent_class)->finalize(media); |
| 19883 | 347 | } |
| 348 | ||
| 349 | static void | |
| 350 | purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
| 351 | { | |
| 352 | PurpleMedia *media; | |
| 353 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
354 | |
| 19883 | 355 | media = PURPLE_MEDIA(object); |
| 356 | ||
| 357 | switch (prop_id) { | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
358 | case PROP_MANAGER: |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
359 | media->priv->manager = g_value_dup_object(value); |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
360 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
361 | case PROP_ACCOUNT: |
|
34780
3cf3800ed151
changed _pointer GValue calls to _object for PurpleAccount
Ankit Vani <a@nevitus.org>
parents:
34532
diff
changeset
|
362 | media->priv->account = g_value_get_object(value); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
363 | break; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
364 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
365 | media->priv->conference_type = |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
366 | g_value_dup_string(value); |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
367 | media->priv->backend = g_object_new( |
|
29620
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
368 | purple_media_manager_get_backend_type( |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
369 | purple_media_manager_get()), |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
370 | "conference-type", |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
371 | media->priv->conference_type, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
372 | "media", media, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
373 | NULL); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
374 | g_signal_connect(media->priv->backend, |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
375 | "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
|
376 | G_CALLBACK( |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
377 | purple_media_candidate_pair_established_cb), |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
378 | media); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
379 | g_signal_connect(media->priv->backend, |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
380 | "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
|
381 | G_CALLBACK( |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
382 | purple_media_candidates_prepared_cb), |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
383 | media); |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
384 | g_signal_connect(media->priv->backend, |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
385 | "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
|
386 | G_CALLBACK( |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
387 | purple_media_codecs_changed_cb), |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
388 | media); |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
389 | g_signal_connect(media->priv->backend, |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
390 | "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
|
391 | G_CALLBACK( |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
392 | purple_media_new_local_candidate_cb), |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
393 | media); |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
394 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
395 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
396 | media->priv->initiator = g_value_get_boolean(value); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
397 | break; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
398 | case PROP_PROTOCOL_DATA: |
|
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
399 | media->priv->protocol_data = g_value_get_pointer(value); |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
400 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
401 | default: |
| 19883 | 402 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 403 | break; | |
| 404 | } | |
| 405 | } | |
| 406 | ||
| 407 | static void | |
| 408 | purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 409 | { | |
| 410 | PurpleMedia *media; | |
| 411 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
412 | |
| 19883 | 413 | media = PURPLE_MEDIA(object); |
| 414 | ||
| 415 | switch (prop_id) { | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
416 | case PROP_MANAGER: |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
417 | g_value_set_object(value, media->priv->manager); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
418 | break; |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
419 | case PROP_BACKEND: |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
420 | g_value_set_object(value, media->priv->backend); |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
421 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
422 | case PROP_ACCOUNT: |
|
34780
3cf3800ed151
changed _pointer GValue calls to _object for PurpleAccount
Ankit Vani <a@nevitus.org>
parents:
34532
diff
changeset
|
423 | g_value_set_object(value, media->priv->account); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
424 | break; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
425 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
426 | g_value_set_string(value, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
427 | media->priv->conference_type); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
428 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
429 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
430 | g_value_set_boolean(value, media->priv->initiator); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
431 | break; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
432 | case PROP_PROTOCOL_DATA: |
|
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
433 | g_value_set_pointer(value, media->priv->protocol_data); |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
434 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
435 | default: |
|
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
436 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 19883 | 437 | break; |
| 438 | } | |
| 439 | ||
| 440 | } | |
| 441 | ||
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
442 | static PurpleMediaSession* |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
443 | purple_media_get_session(PurpleMedia *media, const gchar *sess_id) |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
444 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
445 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
446 | return (PurpleMediaSession*) (media->priv->sessions) ? |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
447 | g_hash_table_lookup(media->priv->sessions, sess_id) : NULL; |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
448 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
449 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
450 | static PurpleMediaStream* |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
451 | purple_media_get_stream(PurpleMedia *media, const gchar *session, const gchar *participant) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
452 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
453 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
454 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
455 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
456 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
457 | streams = media->priv->streams; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
458 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
459 | for (; streams; streams = g_list_next(streams)) { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
460 | PurpleMediaStream *stream = streams->data; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
461 | if (!strcmp(stream->session->id, session) && |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
462 | !strcmp(stream->participant, participant)) |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
463 | return stream; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
464 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
465 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
466 | return NULL; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
467 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
468 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
469 | static GList * |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
470 | purple_media_get_streams(PurpleMedia *media, const gchar *session, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
471 | const gchar *participant) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
472 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
473 | GList *streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
474 | GList *ret = NULL; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
475 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
476 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
477 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
478 | streams = media->priv->streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
479 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
480 | for (; streams; streams = g_list_next(streams)) { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
481 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
482 | if ((session == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
483 | !strcmp(stream->session->id, session)) && |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
484 | (participant == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
485 | !strcmp(stream->participant, participant))) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
486 | ret = g_list_append(ret, stream); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
487 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
488 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
489 | return ret; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
490 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
491 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
492 | static void |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
493 | purple_media_add_session(PurpleMedia *media, PurpleMediaSession *session) |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
494 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
495 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
496 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
497 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
498 | if (!media->priv->sessions) { |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
499 | purple_debug_info("media", "Creating hash table for sessions\n"); |
|
30715
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
29691
diff
changeset
|
500 | media->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:
29691
diff
changeset
|
501 | g_free, NULL); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
502 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
503 | g_hash_table_insert(media->priv->sessions, g_strdup(session->id), session); |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
504 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
505 | |
| 29584 | 506 | #if 0 |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
507 | static gboolean |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
508 | purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
509 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
510 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
511 | return g_hash_table_remove(media->priv->sessions, session->id); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
512 | } |
| 29584 | 513 | #endif |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
514 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
515 | static PurpleMediaStream * |
|
29596
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
516 | purple_media_insert_stream(PurpleMediaSession *session, |
|
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
517 | const gchar *name, gboolean initiator) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
518 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
519 | PurpleMediaStream *media_stream; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
520 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
521 | g_return_val_if_fail(session != NULL, NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
522 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
523 | media_stream = g_new0(PurpleMediaStream, 1); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
524 | media_stream->participant = g_strdup(name); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
525 | media_stream->session = session; |
|
29596
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
526 | media_stream->initiator = initiator; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
527 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
528 | session->media->priv->streams = |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
529 | g_list_append(session->media->priv->streams, media_stream); |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
530 | |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
531 | return media_stream; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
532 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
533 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
534 | static void |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
535 | purple_media_insert_local_candidate(PurpleMediaSession *session, const gchar *name, |
|
29575
a9700491f857
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
536 | PurpleMediaCandidate *candidate) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
537 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
538 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
539 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
540 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
541 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
542 | stream = purple_media_get_stream(session->media, session->id, name); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
543 | stream->local_candidates = g_list_append(stream->local_candidates, candidate); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
544 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
545 | #endif |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
546 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
547 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
548 | purple_media_get_session_ids(PurpleMedia *media) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
549 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
550 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
551 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
| 26332 | 552 | return media->priv->sessions != NULL ? |
| 553 | g_hash_table_get_keys(media->priv->sessions) : NULL; | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
554 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
555 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
556 | #endif |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
557 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
558 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
559 | #ifdef USE_GSTREAMER |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
560 | GstElement * |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
561 | purple_media_get_src(PurpleMedia *media, const gchar *sess_id) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
562 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
563 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
564 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), 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
|
565 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
566 | if (PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
567 | return purple_media_backend_fs2_get_src( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
568 | PURPLE_MEDIA_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
|
569 | media->priv->backend), 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
|
570 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
571 | g_return_val_if_reached(NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
572 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
573 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
574 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
575 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
576 | #endif /* USE_GSTREAMER */ |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
577 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
578 | PurpleAccount * |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
579 | purple_media_get_account(PurpleMedia *media) |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
580 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
581 | #ifdef USE_VV |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
582 | PurpleAccount *account; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
583 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
584 | g_object_get(G_OBJECT(media), "account", &account, NULL); |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
585 | return account; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
586 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
587 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
588 | #endif |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
589 | } |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
590 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
591 | gpointer |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
592 | purple_media_get_protocol_data(PurpleMedia *media) |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
593 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
594 | #ifdef USE_VV |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
595 | gpointer protocol_data; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
596 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
597 | g_object_get(G_OBJECT(media), "protocol-data", &protocol_data, NULL); |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
598 | return protocol_data; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
599 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
600 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
601 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
602 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
603 | |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
604 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
605 | purple_media_set_protocol_data(PurpleMedia *media, gpointer protocol_data) |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
606 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
607 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
608 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
609 | g_object_set(G_OBJECT(media), "protocol-data", protocol_data, NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
610 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
611 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
612 | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
613 | void |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
614 | purple_media_error(PurpleMedia *media, const gchar *error, ...) |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
615 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
616 | #ifdef USE_VV |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
617 | va_list args; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
618 | gchar *message; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
619 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
620 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
621 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
622 | va_start(args, error); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
623 | message = g_strdup_vprintf(error, args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
624 | va_end(args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
625 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
626 | purple_debug_error("media", "%s\n", message); |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
627 | g_signal_emit(media, purple_media_signals[S_ERROR], 0, message); |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
628 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
629 | g_free(message); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
630 | #endif |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
631 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
632 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
633 | void |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
634 | purple_media_end(PurpleMedia *media, |
|
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
635 | const gchar *session_id, const gchar *participant) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
636 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
637 | #ifdef USE_VV |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
638 | GList *iter, *sessions = NULL, *participants = NULL; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
639 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
640 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
641 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
642 | iter = purple_media_get_streams(media, session_id, participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
643 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
644 | /* Free matching streams */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
645 | for (; iter; iter = g_list_delete_link(iter, iter)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
646 | PurpleMediaStream *stream = iter->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
647 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
648 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
649 | 0, PURPLE_MEDIA_STATE_END, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
650 | stream->session->id, stream->participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
651 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
652 | media->priv->streams = |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
653 | g_list_remove(media->priv->streams, stream); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
654 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
655 | if (g_list_find(sessions, stream->session) == NULL) |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
656 | sessions = g_list_prepend(sessions, stream->session); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
657 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
658 | if (g_list_find_custom(participants, stream->participant, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
659 | (GCompareFunc)strcmp) == NULL) |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
660 | participants = g_list_prepend(participants, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
661 | g_strdup(stream->participant)); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
662 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
663 | purple_media_stream_free(stream); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
664 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
665 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
666 | iter = media->priv->streams; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
667 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
668 | /* Reduce to list of sessions to remove */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
669 | for (; iter; iter = g_list_next(iter)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
670 | PurpleMediaStream *stream = iter->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
671 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
672 | sessions = g_list_remove(sessions, stream->session); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
673 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
674 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
675 | /* Free sessions with no streams left */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
676 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
677 | PurpleMediaSession *session = sessions->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
678 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
679 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
680 | 0, PURPLE_MEDIA_STATE_END, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
681 | session->id, NULL); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
682 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
683 | g_hash_table_remove(media->priv->sessions, session->id); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
684 | purple_media_session_free(session); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
685 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
686 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
687 | iter = media->priv->streams; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
688 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
689 | /* Reduce to list of participants to remove */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
690 | for (; iter; iter = g_list_next(iter)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
691 | PurpleMediaStream *stream = iter->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
692 | GList *tmp; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
693 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
694 | tmp = g_list_find_custom(participants, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
695 | stream->participant, (GCompareFunc)strcmp); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
696 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
697 | if (tmp != NULL) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
698 | g_free(tmp->data); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
699 | participants = g_list_delete_link(participants, tmp); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
700 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
701 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
702 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
703 | /* Remove participants with no streams left (just emit the signal) */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
704 | for (; participants; participants = |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
705 | g_list_delete_link(participants, participants)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
706 | gchar *participant = participants->data; |
|
29616
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
707 | GList *link = g_list_find_custom(media->priv->participants, |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
708 | participant, (GCompareFunc)strcmp); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
709 | |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
710 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
711 | 0, PURPLE_MEDIA_STATE_END, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
712 | NULL, participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
713 | |
|
29616
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
714 | if (link != NULL) { |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
715 | g_free(link->data); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
716 | media->priv->participants = g_list_delete_link( |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
717 | media->priv->participants, link); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
718 | } |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
719 | |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
720 | g_free(participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
721 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
722 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
723 | /* Free the conference if no sessions left */ |
|
29625
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
724 | if (media->priv->sessions != NULL && |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
725 | g_hash_table_size(media->priv->sessions) == 0) { |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
726 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
727 | 0, PURPLE_MEDIA_STATE_END, |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
728 | NULL, NULL); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
729 | g_object_unref(media); |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
730 | return; |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
731 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
732 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
733 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
734 | |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
735 | void |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
736 | purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
737 | const gchar *session_id, const gchar *participant, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
738 | gboolean local) |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
739 | { |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
740 | #ifdef USE_VV |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
741 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
742 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
743 | if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
744 | GList *streams, *sessions = NULL, *participants = NULL; |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
745 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
746 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
747 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
748 | streams = purple_media_get_streams(media, |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
749 | session_id, participant); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
750 | |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
751 | /* Emit stream acceptance */ |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
752 | for (; streams; streams = |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
753 | g_list_delete_link(streams, streams)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
754 | PurpleMediaStream *stream = streams->data; |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
755 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
756 | stream->accepted = TRUE; |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
757 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
758 | g_signal_emit(media, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
759 | purple_media_signals[STREAM_INFO], |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
760 | 0, type, stream->session->id, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
761 | stream->participant, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
762 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
763 | if (g_list_find(sessions, stream->session) == NULL) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
764 | sessions = g_list_prepend(sessions, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
765 | stream->session); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
766 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
767 | if (g_list_find_custom(participants, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
768 | stream->participant, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
769 | (GCompareFunc)strcmp) == NULL) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
770 | participants = g_list_prepend(participants, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
771 | g_strdup(stream->participant)); |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
772 | } |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
773 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
774 | /* Emit session acceptance */ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
775 | for (; sessions; sessions = |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
776 | g_list_delete_link(sessions, sessions)) { |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
777 | PurpleMediaSession *session = sessions->data; |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
778 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
779 | if (purple_media_accepted(media, session->id, NULL)) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
780 | g_signal_emit(media, purple_media_signals[ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
781 | STREAM_INFO], 0, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
782 | PURPLE_MEDIA_INFO_ACCEPT, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
783 | session->id, NULL, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
784 | } |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
785 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
786 | /* Emit participant acceptance */ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
787 | for (; participants; participants = g_list_delete_link( |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
788 | participants, participants)) { |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
789 | gchar *participant = participants->data; |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
790 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
791 | if (purple_media_accepted(media, NULL, participant)) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
792 | g_signal_emit(media, purple_media_signals[ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
793 | STREAM_INFO], 0, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
794 | PURPLE_MEDIA_INFO_ACCEPT, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
795 | NULL, participant, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
796 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
797 | g_free(participant); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
798 | } |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
799 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
800 | /* Emit conference acceptance */ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
801 | if (purple_media_accepted(media, NULL, NULL)) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
802 | g_signal_emit(media, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
803 | purple_media_signals[STREAM_INFO], |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
804 | 0, PURPLE_MEDIA_INFO_ACCEPT, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
805 | NULL, NULL, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
806 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
807 | return; |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
808 | } else if (type == PURPLE_MEDIA_INFO_HANGUP || |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
809 | type == PURPLE_MEDIA_INFO_REJECT) { |
|
29617
3cc3d60ee573
Keep track of participants better in purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
29616
diff
changeset
|
810 | GList *streams; |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
811 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
812 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
813 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
814 | streams = purple_media_get_streams(media, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
815 | session_id, participant); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
816 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
817 | /* Emit for stream */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
818 | for (; streams; streams = |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
819 | g_list_delete_link(streams, streams)) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
820 | PurpleMediaStream *stream = streams->data; |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
821 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
822 | g_signal_emit(media, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
823 | purple_media_signals[STREAM_INFO], |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
824 | 0, type, stream->session->id, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
825 | stream->participant, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
826 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
827 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
828 | if (session_id != NULL && participant != NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
829 | /* Everything that needs to be emitted has been */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
830 | } else if (session_id == NULL && participant == NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
831 | /* Emit for everything in the conference */ |
|
29625
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
832 | GList *sessions = NULL; |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
833 | GList *participants = media->priv->participants; |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
834 | |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
835 | if (media->priv->sessions != NULL) |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
836 | sessions = g_hash_table_get_values( |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
837 | media->priv->sessions); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
838 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
839 | /* Emit for sessions */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
840 | for (; sessions; sessions = g_list_delete_link( |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
841 | sessions, sessions)) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
842 | PurpleMediaSession *session = sessions->data; |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
843 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
844 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
845 | STREAM_INFO], 0, type, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
846 | session->id, NULL, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
847 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
848 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
849 | /* Emit for participants */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
850 | for (; participants; participants = |
|
29617
3cc3d60ee573
Keep track of participants better in purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
29616
diff
changeset
|
851 | g_list_next(participants)) { |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
852 | gchar *participant = participants->data; |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
853 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
854 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
855 | STREAM_INFO], 0, type, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
856 | NULL, participant, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
857 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
858 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
859 | /* Emit for conference */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
860 | g_signal_emit(media, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
861 | purple_media_signals[STREAM_INFO], |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
862 | 0, type, NULL, NULL, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
863 | } else if (session_id != NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
864 | /* Emit just the specific session */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
865 | PurpleMediaSession *session = |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
866 | purple_media_get_session( |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
867 | media, session_id); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
868 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
869 | if (session == NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
870 | purple_debug_warning("media", |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
871 | "Couldn't find session" |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
872 | " to hangup/reject.\n"); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
873 | } else { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
874 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
875 | STREAM_INFO], 0, type, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
876 | session->id, NULL, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
877 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
878 | } else if (participant != NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
879 | /* Emit just the specific participant */ |
|
29617
3cc3d60ee573
Keep track of participants better in purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
29616
diff
changeset
|
880 | if (!g_list_find_custom(media->priv->participants, |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
881 | participant, (GCompareFunc)strcmp)) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
882 | purple_debug_warning("media", |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
883 | "Couldn't find participant" |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
884 | " to hangup/reject.\n"); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
885 | } else { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
886 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
887 | STREAM_INFO], 0, type, NULL, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
888 | participant, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
889 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
890 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
891 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
892 | purple_media_end(media, session_id, participant); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
893 | return; |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
894 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
895 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
896 | g_signal_emit(media, purple_media_signals[STREAM_INFO], |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
897 | 0, type, session_id, participant, local); |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
898 | #endif |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
899 | } |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
900 | |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
901 | void |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
902 | purple_media_set_params(PurpleMedia *media, |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
903 | guint num_params, GParameter *params) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
904 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
905 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
906 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
907 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
908 | purple_media_backend_set_params(media->priv->backend, num_params, params); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
909 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
910 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
911 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
912 | const gchar ** |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
913 | purple_media_get_available_params(PurpleMedia *media) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
914 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
915 | static const gchar *NULL_ARRAY[] = { NULL }; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
916 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
917 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL_ARRAY); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
918 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
919 | return purple_media_backend_get_available_params(media->priv->backend); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
920 | #else |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
921 | return NULL_ARRAY; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
922 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
923 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
924 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
925 | gboolean |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
926 | purple_media_param_is_supported(PurpleMedia *media, const gchar *param) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
927 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
928 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
929 | const gchar **params; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
930 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
931 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
932 | g_return_val_if_fail(param != NULL, FALSE); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
933 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
934 | params = purple_media_backend_get_available_params(media->priv->backend); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
935 | for (; *params != NULL; ++params) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
936 | if (!strcmp(*params, param)) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
937 | return TRUE; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
938 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
939 | return FALSE; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
940 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
941 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
942 | #ifdef USE_VV |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
943 | static void |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
944 | purple_media_new_local_candidate_cb(PurpleMediaBackend *backend, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
945 | const gchar *sess_id, const gchar *participant, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
946 | PurpleMediaCandidate *candidate, PurpleMedia *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
947 | { |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
948 | PurpleMediaSession *session = |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
949 | purple_media_get_session(media, sess_id); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
950 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
951 | purple_media_insert_local_candidate(session, participant, |
|
29575
a9700491f857
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
952 | purple_media_candidate_copy(candidate)); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
953 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
954 | g_signal_emit(session->media, purple_media_signals[NEW_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
|
955 | 0, session->id, participant, candidate); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
956 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
957 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
958 | static void |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
959 | purple_media_candidates_prepared_cb(PurpleMediaBackend *backend, |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
960 | const gchar *sess_id, const gchar *name, PurpleMedia *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
961 | { |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
962 | PurpleMediaStream *stream_data; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
963 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
964 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
965 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
966 | stream_data = purple_media_get_stream(media, sess_id, name); |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
967 | stream_data->candidates_prepared = TRUE; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
968 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
969 | g_signal_emit(media, purple_media_signals[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
|
970 | 0, sess_id, name); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
971 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
972 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
973 | /* callback called when a pair of transport candidates (local and remote) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
974 | * has been established */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
975 | static void |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
976 | purple_media_candidate_pair_established_cb(PurpleMediaBackend *backend, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
977 | const gchar *sess_id, const gchar *name, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
978 | PurpleMediaCandidate *local_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
979 | PurpleMediaCandidate *remote_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
980 | PurpleMedia *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
981 | { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
982 | PurpleMediaStream *stream; |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
983 | GList *iter; |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
984 | guint id; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
985 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
986 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
987 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
988 | stream = purple_media_get_stream(media, sess_id, name); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
989 | id = purple_media_candidate_get_component_id(local_candidate); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
990 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
991 | iter = stream->active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
992 | for(; iter; iter = g_list_next(iter)) { |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
993 | PurpleMediaCandidate *c = iter->data; |
|
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
994 | if (id == purple_media_candidate_get_component_id(c)) { |
|
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
995 | g_object_unref(c); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
996 | stream->active_local_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
997 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
998 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
999 | stream->active_local_candidates, |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1000 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1001 | local_candidate)); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1002 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1003 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1004 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1005 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1006 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1007 | stream->active_local_candidates, |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1008 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1009 | local_candidate)); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1010 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1011 | id = purple_media_candidate_get_component_id(local_candidate); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1012 | |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1013 | iter = stream->active_remote_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1014 | for(; iter; iter = g_list_next(iter)) { |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1015 | PurpleMediaCandidate *c = iter->data; |
|
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1016 | if (id == purple_media_candidate_get_component_id(c)) { |
|
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1017 | g_object_unref(c); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1018 | stream->active_remote_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1019 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1020 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1021 | stream->active_remote_candidates, |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1022 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1023 | remote_candidate)); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1024 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1025 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1026 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1027 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1028 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1029 | stream->active_remote_candidates, |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1030 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1031 | remote_candidate)); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1032 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1033 | purple_debug_info("media", "candidate pair established\n"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1034 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1035 | |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1036 | static void |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1037 | purple_media_codecs_changed_cb(PurpleMediaBackend *backend, |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1038 | const gchar *sess_id, PurpleMedia *media) |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1039 | { |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1040 | g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, sess_id); |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1041 | } |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1042 | #endif /* USE_VV */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1043 | |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1044 | gboolean |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1045 | purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1046 | const gchar *who, PurpleMediaSessionType type, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1047 | gboolean initiator, const gchar *transmitter, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1048 | guint num_params, GParameter *params) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1049 | { |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1050 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1051 | PurpleMediaSession *session; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1052 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1053 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1054 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1055 | if (!purple_media_backend_add_stream(media->priv->backend, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1056 | sess_id, who, type, initiator, transmitter, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1057 | num_params, params)) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1058 | purple_debug_error("media", "Error adding stream.\n"); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1059 | return FALSE; |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1060 | } |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1061 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1062 | session = purple_media_get_session(media, sess_id); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1063 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1064 | if (!session) { |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1065 | session = g_new0(PurpleMediaSession, 1); |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1066 | session->id = g_strdup(sess_id); |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1067 | session->media = media; |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1068 | session->type = type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1069 | session->initiator = initiator; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1070 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1071 | purple_media_add_session(media, session); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1072 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
1073 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1074 | session->id, NULL); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1075 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1076 | |
|
29618
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1077 | if (!g_list_find_custom(media->priv->participants, |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1078 | who, (GCompareFunc)strcmp)) { |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1079 | media->priv->participants = g_list_prepend( |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1080 | media->priv->participants, g_strdup(who)); |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1081 | |
|
33840
3d6440551829
Remove unnecessary signal name lookup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32109
diff
changeset
|
1082 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], 0, |
|
29618
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1083 | PURPLE_MEDIA_STATE_NEW, NULL, who); |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1084 | } |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1085 | |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
1086 | if (purple_media_get_stream(media, sess_id, who) == NULL) { |
|
32109
811763ee9ec5
Remove an unused variable
Olivier Crête <olivier.crete@collabora.com>
parents:
31687
diff
changeset
|
1087 | purple_media_insert_stream(session, who, initiator); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1088 | |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1089 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
1090 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1091 | session->id, who); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1092 | } |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1093 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1094 | return TRUE; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1095 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1096 | return FALSE; |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1097 | #endif /* USE_VV */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1098 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1099 | |
|
26523
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1100 | PurpleMediaManager * |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1101 | purple_media_get_manager(PurpleMedia *media) |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1102 | { |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1103 | PurpleMediaManager *ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1104 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1105 | g_object_get(media, "manager", &ret, NULL); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1106 | return ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1107 | } |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1108 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
1109 | PurpleMediaSessionType |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1110 | purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1111 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1112 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1113 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1114 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), PURPLE_MEDIA_NONE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1115 | session = purple_media_get_session(media, sess_id); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1116 | return session->type; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1117 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1118 | return PURPLE_MEDIA_NONE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1119 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1120 | } |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1121 | /* XXX: Should wait until codecs-ready is TRUE before using this function */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1122 | GList * |
|
26160
46bc5e18d59c
Combine get_*_codecs functions to mirror Farsight 2.
Michael Ruprecht <maiku@pidgin.im>
parents:
26151
diff
changeset
|
1123 | purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1124 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1125 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1126 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1127 | |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29584
diff
changeset
|
1128 | return purple_media_backend_get_codecs(media->priv->backend, sess_id); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1129 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1130 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1131 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1132 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1133 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1134 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1135 | purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1136 | const gchar *participant) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1137 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1138 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1139 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1140 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1141 | return purple_media_backend_get_local_candidates(media->priv->backend, |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1142 | sess_id, participant); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1143 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1144 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1145 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1146 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1147 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1148 | void |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1149 | purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1150 | const gchar *participant, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1151 | GList *remote_candidates) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1152 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1153 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1154 | PurpleMediaStream *stream; |
|
26258
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1155 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1156 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1157 | stream = purple_media_get_stream(media, sess_id, participant); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1158 | |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1159 | if (stream == NULL) { |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1160 | purple_debug_error("media", |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1161 | "purple_media_add_remote_candidates: " |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1162 | "couldn't find stream %s %s.\n", |
|
27974
2021706e911d
Fixes for some potential printf("%s", NULL) type of problems from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27971
diff
changeset
|
1163 | sess_id ? sess_id : "(null)", |
|
2021706e911d
Fixes for some potential printf("%s", NULL) type of problems from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27971
diff
changeset
|
1164 | participant ? participant : "(null)"); |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1165 | return; |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1166 | } |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1167 | |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
1168 | stream->remote_candidates = g_list_concat(stream->remote_candidates, |
|
29576
b6988ade0028
Store remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29575
diff
changeset
|
1169 | purple_media_candidate_list_copy(remote_candidates)); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1170 | |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1171 | purple_media_backend_add_remote_candidates(media->priv->backend, |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1172 | sess_id, participant, remote_candidates); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1173 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1174 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1175 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1176 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1177 | purple_media_get_active_local_candidates(PurpleMedia *media, |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1178 | const gchar *sess_id, const gchar *participant) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1179 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1180 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1181 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1182 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1183 | stream = purple_media_get_stream(media, sess_id, participant); |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1184 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1185 | stream->active_local_candidates); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1186 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1187 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1188 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1189 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1190 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1191 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1192 | purple_media_get_active_remote_candidates(PurpleMedia *media, |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1193 | const gchar *sess_id, const gchar *participant) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1194 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1195 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1196 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1197 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1198 | stream = purple_media_get_stream(media, sess_id, participant); |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1199 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1200 | stream->active_remote_candidates); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1201 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1202 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1203 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1204 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1205 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1206 | gboolean |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1207 | purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1208 | const gchar *participant, GList *codecs) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1209 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1210 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1211 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1212 | |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
1213 | return purple_media_backend_set_remote_codecs(media->priv->backend, |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
1214 | sess_id, participant, codecs); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1215 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1216 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1217 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1218 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1219 | |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1220 | gboolean |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1221 | purple_media_candidates_prepared(PurpleMedia *media, |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1222 | const gchar *session_id, const gchar *participant) |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1223 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1224 | #ifdef USE_VV |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1225 | GList *streams; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1226 | gboolean prepared = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1227 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1228 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1229 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1230 | streams = purple_media_get_streams(media, session_id, participant); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1231 | |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1232 | for (; streams; streams = g_list_delete_link(streams, streams)) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1233 | PurpleMediaStream *stream = streams->data; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1234 | if (stream->candidates_prepared == FALSE) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1235 | g_list_free(streams); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1236 | prepared = FALSE; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1237 | break; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1238 | } |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1239 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1240 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1241 | return prepared; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1242 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1243 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1244 | #endif |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1245 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1246 | |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1247 | gboolean |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1248 | purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec) |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1249 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1250 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1251 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1252 | |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
1253 | return purple_media_backend_set_send_codec( |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
1254 | media->priv->backend, sess_id, codec); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1255 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1256 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1257 | #endif |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1258 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1259 | |
|
26137
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1260 | gboolean |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1261 | purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id) |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1262 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1263 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1264 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1265 | |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29596
diff
changeset
|
1266 | return purple_media_backend_codecs_ready( |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29596
diff
changeset
|
1267 | media->priv->backend, sess_id); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1268 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1269 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1270 | #endif |
|
26137
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1271 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1272 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1273 | gboolean |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1274 | purple_media_is_initiator(PurpleMedia *media, |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1275 | const gchar *sess_id, const gchar *participant) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1276 | { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1277 | #ifdef USE_VV |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1278 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1279 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1280 | if (sess_id == NULL && participant == NULL) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1281 | return media->priv->initiator; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1282 | else if (sess_id != NULL && participant == NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1283 | PurpleMediaSession *session = |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1284 | purple_media_get_session(media, sess_id); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1285 | return session != NULL ? session->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1286 | } else if (sess_id != NULL && participant != NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1287 | PurpleMediaStream *stream = purple_media_get_stream( |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1288 | media, sess_id, participant); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1289 | return stream != NULL ? stream->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1290 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1291 | #endif |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1292 | return FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1293 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1294 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1295 | gboolean |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1296 | purple_media_accepted(PurpleMedia *media, const gchar *sess_id, |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1297 | const gchar *participant) |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1298 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1299 | #ifdef USE_VV |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1300 | gboolean accepted = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1301 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1302 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1303 | |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1304 | if (sess_id == NULL && participant == NULL) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1305 | GList *streams = media->priv->streams; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1306 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1307 | for (; streams; streams = g_list_next(streams)) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1308 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1309 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1310 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1311 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1312 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1313 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1314 | } else if (sess_id != NULL && participant == NULL) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1315 | GList *streams = purple_media_get_streams( |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1316 | media, sess_id, NULL); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1317 | for (; streams; streams = |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1318 | g_list_delete_link(streams, streams)) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1319 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1320 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1321 | g_list_free(streams); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1322 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1323 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1324 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1325 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1326 | } else if (sess_id != NULL && participant != NULL) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1327 | PurpleMediaStream *stream = purple_media_get_stream( |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1328 | media, sess_id, participant); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1329 | if (stream == NULL || stream->accepted == FALSE) |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1330 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1331 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1332 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1333 | return accepted; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1334 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1335 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1336 | #endif |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1337 | } |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1338 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1339 | void purple_media_set_input_volume(PurpleMedia *media, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1340 | const gchar *session_id, double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1341 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1342 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1343 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1344 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1345 | |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1346 | purple_media_backend_fs2_set_input_volume( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1347 | PURPLE_MEDIA_BACKEND_FS2( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1348 | media->priv->backend), |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1349 | session_id, level); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1350 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1351 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1352 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1353 | void purple_media_set_output_volume(PurpleMedia *media, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1354 | const gchar *session_id, const gchar *participant, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1355 | double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1356 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1357 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1358 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1359 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1360 | |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1361 | purple_media_backend_fs2_set_output_volume( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1362 | PURPLE_MEDIA_BACKEND_FS2( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1363 | media->priv->backend), |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1364 | session_id, participant, level); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1365 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1366 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1367 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1368 | gulong |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1369 | purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1370 | const gchar *participant, gulong window_id) |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1371 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1372 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1373 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1374 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1375 | return purple_media_manager_set_output_window(media->priv->manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1376 | media, session_id, participant, window_id); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1377 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1378 | return 0; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1379 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1380 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1381 | |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1382 | void |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1383 | purple_media_remove_output_windows(PurpleMedia *media) |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1384 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1385 | #ifdef USE_VV |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1386 | GList *iter = media->priv->streams; |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1387 | for (; iter; iter = g_list_next(iter)) { |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1388 | PurpleMediaStream *stream = iter->data; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1389 | purple_media_manager_remove_output_windows( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1390 | media->priv->manager, media, |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1391 | stream->session->id, stream->participant); |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1392 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1393 | |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1394 | iter = purple_media_get_session_ids(media); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1395 | for (; iter; iter = g_list_delete_link(iter, iter)) { |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1396 | gchar *session_name = iter->data; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1397 | purple_media_manager_remove_output_windows( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1398 | media->priv->manager, media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1399 | session_name, NULL); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1400 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1401 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1402 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1403 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1404 | #ifdef USE_GSTREAMER |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1405 | GstElement * |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1406 | purple_media_get_tee(PurpleMedia *media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1407 | const gchar *session_id, const gchar *participant) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1408 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1409 | #ifdef USE_VV |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1410 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1411 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1412 | if (PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1413 | return purple_media_backend_fs2_get_tee( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1414 | PURPLE_MEDIA_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
|
1415 | media->priv->backend), |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1416 | session_id, participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1417 | g_return_val_if_reached(NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1418 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1419 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1420 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1421 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1422 | #endif /* USE_GSTREAMER */ |
|
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1423 |