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