Mon, 23 Mar 2009 01:43:25 +0000
merge of '245d9650bb2b49362661175fadae2e236a795d01'
and 'dec1e2779682c6daf7cfb0f93e61fa8fe9a518c0'
| 19883 | 1 | /** |
| 19889 | 2 | * @file media.c Media API |
| 19883 | 3 | * @ingroup core |
|
26105
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
4 | */ |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
5 | |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
6 | /* purple |
| 19883 | 7 | * |
| 8 | * Purple is the legal property of its developers, whose names are too numerous | |
| 9 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 10 | * source distribution. | |
| 11 | * | |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 25 | */ | |
| 26 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
27 | #include <string.h> |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
28 | |
| 19889 | 29 | #include "internal.h" |
| 30 | ||
| 19883 | 31 | #include "connection.h" |
| 32 | #include "media.h" | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
33 | #include "marshallers.h" |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26112
diff
changeset
|
34 | #include "mediamanager.h" |
|
26256
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26253
diff
changeset
|
35 | #include "network.h" |
| 19883 | 36 | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
37 | #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
|
38 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
39 | #ifdef USE_VV |
| 19883 | 40 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
41 | #include <gst/farsight/fs-conference-iface.h> |
| 19883 | 42 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
43 | /** @copydoc _PurpleMediaSession */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
44 | typedef struct _PurpleMediaSession PurpleMediaSession; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
45 | /** @copydoc _PurpleMediaStream */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
46 | typedef struct _PurpleMediaStream PurpleMediaStream; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
47 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
48 | struct _PurpleMediaSession |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
49 | { |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
50 | gchar *id; |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
51 | PurpleMedia *media; |
|
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
|
52 | GstElement *src; |
|
26321
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
53 | GstElement *tee; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
54 | FsSession *session; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
55 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
56 | PurpleMediaSessionType type; |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
57 | |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
58 | gulong window_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
|
59 | }; |
|
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
|
60 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
61 | struct _PurpleMediaStream |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
62 | { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
63 | PurpleMediaSession *session; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
64 | gchar *participant; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
65 | FsStream *stream; |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
66 | GstElement *src; |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
67 | GstElement *tee; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
68 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
69 | GList *local_candidates; |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
70 | GList *remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
71 | |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
72 | gboolean accepted; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
73 | gboolean candidates_prepared; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
74 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
75 | GList *active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
76 | GList *active_remote_candidates; |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
77 | |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
78 | gulong window_id; |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
79 | guint connected_cb_id; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
80 | }; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
81 | |
| 19883 | 82 | struct _PurpleMediaPrivate |
| 83 | { | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
84 | PurpleMediaManager *manager; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
85 | PurpleConnection *pc; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
86 | FsConference *conference; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
87 | gboolean initiator; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
88 | gpointer prpl_data; |
| 19883 | 89 | |
|
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
|
90 | GHashTable *sessions; /* PurpleMediaSession table */ |
|
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
|
91 | GHashTable *participants; /* FsParticipant table */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
92 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
93 | GList *streams; /* PurpleMediaStream table */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
94 | |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
95 | GstElement *confbin; |
| 19883 | 96 | }; |
| 97 | ||
| 98 | #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) | |
| 99 | ||
| 100 | static void purple_media_class_init (PurpleMediaClass *klass); | |
| 101 | static void purple_media_init (PurpleMedia *media); | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
102 | static void purple_media_dispose (GObject *object); |
| 19883 | 103 | static void purple_media_finalize (GObject *object); |
| 104 | static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 105 | static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
| 106 | ||
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
107 | static void purple_media_new_local_candidate_cb(FsStream *stream, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
108 | FsCandidate *local_candidate, PurpleMediaSession *session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
109 | static void purple_media_candidates_prepared_cb(FsStream *stream, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
110 | PurpleMediaSession *session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
111 | static void purple_media_candidate_pair_established_cb(FsStream *stream, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
112 | FsCandidate *native_candidate, FsCandidate *remote_candidate, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
113 | PurpleMediaSession *session); |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
114 | static gboolean media_bus_call(GstBus *bus, |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
115 | GstMessage *msg, PurpleMedia *media); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
116 | |
| 19883 | 117 | static GObjectClass *parent_class = NULL; |
| 118 | ||
| 119 | ||
| 120 | ||
| 121 | enum { | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
122 | ERROR, |
|
26266
069e72982f87
Added the accepted signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26265
diff
changeset
|
123 | ACCEPTED, |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
124 | CANDIDATES_PREPARED, |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
125 | CODECS_CHANGED, |
|
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
|
126 | NEW_CANDIDATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
127 | STATE_CHANGED, |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
128 | STREAM_INFO, |
| 19883 | 129 | LAST_SIGNAL |
| 130 | }; | |
| 131 | static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
| 132 | ||
| 133 | enum { | |
| 134 | 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
|
135 | PROP_MANAGER, |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
136 | PROP_CONNECTION, |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
137 | PROP_CONFERENCE, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
138 | PROP_INITIATOR, |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
139 | PROP_PRPL_DATA, |
| 19883 | 140 | }; |
| 141 | ||
| 142 | GType | |
| 143 | purple_media_get_type() | |
| 144 | { | |
| 145 | static GType type = 0; | |
| 146 | ||
| 147 | if (type == 0) { | |
| 148 | static const GTypeInfo info = { | |
| 149 | sizeof(PurpleMediaClass), | |
| 150 | NULL, | |
| 151 | NULL, | |
| 152 | (GClassInitFunc) purple_media_class_init, | |
| 153 | NULL, | |
| 154 | NULL, | |
| 155 | sizeof(PurpleMedia), | |
| 156 | 0, | |
|
22071
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
157 | (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
|
158 | NULL |
| 19883 | 159 | }; |
| 160 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
| 161 | } | |
| 162 | return type; | |
| 163 | } | |
| 164 | ||
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
165 | GType |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
166 | purple_media_state_changed_get_type() |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
167 | { |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
168 | static GType type = 0; |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
169 | if (type == 0) { |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
170 | static const GEnumValue values[] = { |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
171 | { PURPLE_MEDIA_STATE_NEW, |
|
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
172 | "PURPLE_MEDIA_STATE_NEW", "new" }, |
|
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
173 | { PURPLE_MEDIA_STATE_CONNECTED, |
|
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
174 | "PURPLE_MEDIA_STATE_CONNECTED", "connected" }, |
|
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
175 | { PURPLE_MEDIA_STATE_END, |
|
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
176 | "PURPLE_MEDIA_STATE_END", "end" }, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
177 | { 0, NULL, NULL } |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
178 | }; |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
179 | type = g_enum_register_static("PurpleMediaState", values); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
180 | } |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
181 | return type; |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
182 | } |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
183 | |
|
26447
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
184 | GType |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
185 | purple_media_info_type_get_type() |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
186 | { |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
187 | static GType type = 0; |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
188 | if (type == 0) { |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
189 | static const GEnumValue values[] = { |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
190 | { PURPLE_MEDIA_INFO_HANGUP, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
191 | "PURPLE_MEDIA_INFO_HANGUP", "hangup" }, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
192 | { PURPLE_MEDIA_INFO_REJECT, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
193 | "PURPLE_MEDIA_INFO_REJECT", "reject" }, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
194 | { PURPLE_MEDIA_INFO_MUTE, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
195 | "PURPLE_MEDIA_INFO_MUTE", "mute" }, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
196 | { PURPLE_MEDIA_INFO_HOLD, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
197 | "PURPLE_MEDIA_INFO_HOLD", "hold" }, |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
198 | { 0, NULL, NULL } |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
199 | }; |
|
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
200 | type = g_enum_register_static("PurpleMediaInfoType", values); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
201 | } |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
202 | return type; |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
203 | } |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
204 | |
| 19883 | 205 | static void |
| 206 | purple_media_class_init (PurpleMediaClass *klass) | |
| 207 | { | |
| 208 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
| 209 | parent_class = g_type_class_peek_parent(klass); | |
| 210 | ||
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
211 | gobject_class->dispose = purple_media_dispose; |
| 19883 | 212 | gobject_class->finalize = purple_media_finalize; |
| 213 | gobject_class->set_property = purple_media_set_property; | |
| 214 | gobject_class->get_property = purple_media_get_property; | |
| 215 | ||
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
216 | 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
|
217 | 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
|
218 | "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
|
219 | "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
|
220 | PURPLE_TYPE_MEDIA_MANAGER, |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
221 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
222 | |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
223 | g_object_class_install_property(gobject_class, PROP_CONNECTION, |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
224 | g_param_spec_pointer("connection", |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
225 | "PurpleConnection", |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
226 | "The connection this media session is on.", |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
227 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
228 | |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
229 | g_object_class_install_property(gobject_class, PROP_CONFERENCE, |
|
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
230 | g_param_spec_object("conference", |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
231 | "Farsight conference", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
232 | "The FsConference associated with this media.", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
233 | FS_TYPE_CONFERENCE, |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
234 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
| 19883 | 235 | |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
236 | g_object_class_install_property(gobject_class, PROP_INITIATOR, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
237 | g_param_spec_boolean("initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
238 | "initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
239 | "If the local user initiated the conference.", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
240 | FALSE, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
241 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
242 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
243 | 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
|
244 | g_param_spec_pointer("prpl-data", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
245 | "gpointer", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
246 | "Data the prpl plugin set on the media session.", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
247 | G_PARAM_READWRITE)); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
248 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
249 | purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
250 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
251 | g_cclosure_marshal_VOID__STRING, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
252 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
26266
069e72982f87
Added the accepted signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26265
diff
changeset
|
253 | purple_media_signals[ACCEPTED] = g_signal_new("accepted", G_TYPE_FROM_CLASS(klass), |
|
069e72982f87
Added the accepted signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26265
diff
changeset
|
254 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
069e72982f87
Added the accepted signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26265
diff
changeset
|
255 | purple_smarshal_VOID__STRING_STRING, |
|
069e72982f87
Added the accepted signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26265
diff
changeset
|
256 | G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
257 | 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
|
258 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
259 | purple_smarshal_VOID__STRING_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
260 | G_TYPE_NONE, 2, G_TYPE_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
261 | G_TYPE_STRING); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
262 | 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
|
263 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
264 | g_cclosure_marshal_VOID__STRING, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
265 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
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
|
266 | 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
|
267 | 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
|
268 | 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
|
269 | 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
|
270 | G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
271 | 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
|
272 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
273 | purple_smarshal_VOID__ENUM_STRING_STRING, |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
274 | 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
|
275 | G_TYPE_STRING, G_TYPE_STRING); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
276 | 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
|
277 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
278 | purple_smarshal_VOID__ENUM_STRING_STRING, |
|
26447
d966eb10953d
Use the right enum for the stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26446
diff
changeset
|
279 | G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_INFO_TYPE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
280 | G_TYPE_STRING, G_TYPE_STRING); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
281 | g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
| 19883 | 282 | } |
| 283 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
284 | |
| 19883 | 285 | static void |
| 286 | purple_media_init (PurpleMedia *media) | |
| 287 | { | |
| 288 | 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
|
289 | memset(media->priv, 0, sizeof(*media->priv)); |
| 19883 | 290 | } |
| 291 | ||
| 292 | static void | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
293 | purple_media_stream_free(PurpleMediaStream *stream) |
|
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 (stream == 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 | |
|
26280
9c7d0dc8268e
Set the purple_media_connected_cb timeout to a high priority and remove
Michael Ruprecht <maiku@pidgin.im>
parents:
26279
diff
changeset
|
298 | /* Remove the connected_cb timeout */ |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
299 | if (stream->connected_cb_id != 0) |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
300 | purple_timeout_remove(stream->connected_cb_id); |
|
26280
9c7d0dc8268e
Set the purple_media_connected_cb timeout to a high priority and remove
Michael Ruprecht <maiku@pidgin.im>
parents:
26279
diff
changeset
|
301 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
302 | g_free(stream->participant); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
303 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
304 | if (stream->local_candidates) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
305 | fs_candidate_list_destroy(stream->local_candidates); |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
306 | if (stream->remote_candidates) |
|
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
307 | fs_candidate_list_destroy(stream->remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
308 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
309 | if (stream->active_local_candidates) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
310 | fs_candidate_list_destroy(stream->active_local_candidates); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
311 | if (stream->active_remote_candidates) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
312 | fs_candidate_list_destroy(stream->active_remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
313 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
314 | g_free(stream); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
315 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
316 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
317 | static void |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
318 | purple_media_session_free(PurpleMediaSession *session) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
319 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
320 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
321 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
322 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
323 | g_free(session->id); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
324 | g_free(session); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
325 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
326 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
327 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
328 | purple_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
329 | { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
330 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
331 | GList *iter = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
332 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
333 | purple_debug_info("media","purple_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
334 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
335 | 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
|
336 | |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
337 | if (priv->confbin) { |
|
26426
4909c56fe88e
Fix some GStreamer timing issues.
Michael Ruprecht <maiku@pidgin.im>
parents:
26425
diff
changeset
|
338 | gst_element_set_locked_state(priv->confbin, TRUE); |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
339 | gst_element_set_state(GST_ELEMENT(priv->confbin), |
|
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
340 | GST_STATE_NULL); |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
341 | gst_bin_remove(GST_BIN(purple_media_manager_get_pipeline( |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
342 | priv->manager)), priv->confbin); |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
343 | priv->confbin = NULL; |
|
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
344 | priv->conference = NULL; |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
345 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
346 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
347 | for (iter = priv->streams; iter; iter = g_list_next(iter)) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
348 | PurpleMediaStream *stream = iter->data; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
349 | if (stream->stream) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
350 | g_object_unref(stream->stream); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
351 | stream->stream = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
352 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
353 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
354 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
355 | if (priv->sessions) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
356 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
357 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
358 | PurpleMediaSession *session = sessions->data; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
359 | if (session->session) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
360 | g_object_unref(session->session); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
361 | session->session = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
362 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
363 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
364 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
365 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
366 | if (priv->participants) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
367 | GList *participants = g_hash_table_get_values(priv->participants); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
368 | for (; participants; participants = g_list_delete_link(participants, participants)) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
369 | g_object_unref(participants->data); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
370 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
371 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
372 | if (priv->manager) { |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
373 | GstElement *pipeline = purple_media_manager_get_pipeline( |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
374 | priv->manager); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
375 | GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
376 | g_signal_handlers_disconnect_matched(G_OBJECT(bus), |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
377 | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
378 | 0, 0, 0, media_bus_call, media); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
379 | gst_object_unref(bus); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
380 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
381 | 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
|
382 | 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
|
383 | } |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
384 | |
| 26412 | 385 | G_OBJECT_CLASS(parent_class)->dispose(media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
386 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
387 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
388 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
389 | purple_media_finalize(GObject *media) |
| 19883 | 390 | { |
|
23711
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
391 | 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
|
392 | 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
|
393 | |
|
26181
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
394 | 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
|
395 | purple_media_stream_free(priv->streams->data); |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
396 | |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
397 | if (priv->sessions) { |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
398 | 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
|
399 | 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
|
400 | 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
|
401 | } |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
402 | g_hash_table_destroy(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
403 | } |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
404 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
405 | G_OBJECT_CLASS(parent_class)->finalize(media); |
| 19883 | 406 | } |
| 407 | ||
| 408 | static void | |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
409 | purple_media_setup_pipeline(PurpleMedia *media) |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
410 | { |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
411 | GstBus *bus; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
412 | gchar *name; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
413 | GstElement *pipeline; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
414 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
415 | if (media->priv->conference == NULL || media->priv->manager == NULL) |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
416 | return; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
417 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
418 | pipeline = purple_media_manager_get_pipeline(media->priv->manager); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
419 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
420 | name = g_strdup_printf("conf_%p", |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
421 | media->priv->conference); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
422 | media->priv->confbin = gst_bin_new(name); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
423 | g_free(name); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
424 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
425 | bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
426 | g_signal_connect(G_OBJECT(bus), "message", |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
427 | G_CALLBACK(media_bus_call), media); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
428 | gst_object_unref(bus); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
429 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
430 | gst_bin_add(GST_BIN(pipeline), |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
431 | media->priv->confbin); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
432 | gst_bin_add(GST_BIN(media->priv->confbin), |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
433 | GST_ELEMENT(media->priv->conference)); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
434 | gst_element_set_state(GST_ELEMENT(media->priv->confbin), |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
435 | GST_STATE_PLAYING); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
436 | } |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
437 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
438 | static void |
| 19883 | 439 | purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
| 440 | { | |
| 441 | PurpleMedia *media; | |
| 442 | 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
|
443 | |
| 19883 | 444 | media = PURPLE_MEDIA(object); |
| 445 | ||
| 446 | 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
|
447 | 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
|
448 | media->priv->manager = g_value_get_object(value); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
449 | g_object_ref(media->priv->manager); |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
450 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
451 | purple_media_setup_pipeline(media); |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
452 | break; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
453 | case PROP_CONNECTION: |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
454 | media->priv->pc = g_value_get_pointer(value); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
455 | break; |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
456 | case PROP_CONFERENCE: { |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
457 | if (media->priv->conference) |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
458 | gst_object_unref(media->priv->conference); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
459 | media->priv->conference = g_value_get_object(value); |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
460 | gst_object_ref(media->priv->conference); |
|
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
461 | |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
462 | purple_media_setup_pipeline(media); |
| 19883 | 463 | break; |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
464 | } |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
465 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
466 | media->priv->initiator = g_value_get_boolean(value); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
467 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
468 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
469 | 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
|
470 | break; |
| 19883 | 471 | default: |
| 472 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
| 473 | break; | |
| 474 | } | |
| 475 | } | |
| 476 | ||
| 477 | static void | |
| 478 | purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 479 | { | |
| 480 | PurpleMedia *media; | |
| 481 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
| 482 | ||
| 483 | media = PURPLE_MEDIA(object); | |
| 484 | ||
| 485 | 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
|
486 | 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
|
487 | 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
|
488 | break; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
489 | case PROP_CONNECTION: |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
490 | g_value_set_pointer(value, media->priv->pc); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
491 | break; |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
492 | case PROP_CONFERENCE: |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
493 | g_value_set_object(value, media->priv->conference); |
| 19883 | 494 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
495 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
496 | g_value_set_boolean(value, media->priv->initiator); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
497 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
498 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
499 | 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
|
500 | break; |
| 19883 | 501 | default: |
| 502 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
| 503 | break; | |
| 504 | } | |
| 505 | ||
| 506 | } | |
| 507 | ||
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
508 | PurpleMediaCandidate * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
509 | purple_media_candidate_new(const gchar *foundation, guint component_id, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
510 | PurpleMediaCandidateType type, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
511 | PurpleMediaNetworkProtocol proto, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
512 | const gchar *ip, guint port) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
513 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
514 | PurpleMediaCandidate *candidate = g_new0(PurpleMediaCandidate, 1); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
515 | candidate->foundation = g_strdup(foundation); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
516 | candidate->component_id = component_id; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
517 | candidate->type = type; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
518 | candidate->proto = proto; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
519 | candidate->ip = g_strdup(ip); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
520 | candidate->port = port; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
521 | return candidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
522 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
523 | |
|
26435
dec1e2779682
Disapprove part of the revision that shouldn't be there.
Michael Ruprecht <maiku@pidgin.im>
parents:
26434
diff
changeset
|
524 | static PurpleMediaCandidate * |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
525 | purple_media_candidate_copy(PurpleMediaCandidate *candidate) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
526 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
527 | PurpleMediaCandidate *new_candidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
528 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
529 | if (candidate == NULL) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
530 | return NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
531 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
532 | new_candidate = g_new0(PurpleMediaCandidate, 1); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
533 | new_candidate->foundation = g_strdup(candidate->foundation); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
534 | new_candidate->component_id = candidate->component_id; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
535 | new_candidate->ip = g_strdup(candidate->ip); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
536 | new_candidate->port = candidate->port; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
537 | new_candidate->base_ip = g_strdup(candidate->base_ip); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
538 | new_candidate->base_port = candidate->base_port; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
539 | new_candidate->proto = candidate->proto; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
540 | new_candidate->priority = candidate->priority; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
541 | new_candidate->type = candidate->type; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
542 | new_candidate->username = g_strdup(candidate->username); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
543 | new_candidate->password = g_strdup(candidate->password); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
544 | new_candidate->ttl = candidate->ttl; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
545 | return new_candidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
546 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
547 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
548 | static void |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
549 | purple_media_candidate_free(PurpleMediaCandidate *candidate) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
550 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
551 | if (candidate == NULL) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
552 | return; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
553 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
554 | g_free((gchar*)candidate->foundation); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
555 | g_free((gchar*)candidate->ip); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
556 | g_free((gchar*)candidate->base_ip); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
557 | g_free((gchar*)candidate->username); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
558 | g_free((gchar*)candidate->password); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
559 | g_free(candidate); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
560 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
561 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
562 | static FsCandidate * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
563 | purple_media_candidate_to_fs(PurpleMediaCandidate *candidate) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
564 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
565 | FsCandidate *fscandidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
566 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
567 | if (candidate == NULL) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
568 | return NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
569 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
570 | fscandidate = fs_candidate_new(candidate->foundation, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
571 | candidate->component_id, candidate->type, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
572 | candidate->proto, candidate->ip, candidate->port); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
573 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
574 | fscandidate->base_ip = g_strdup(candidate->base_ip); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
575 | fscandidate->base_port = candidate->base_port; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
576 | fscandidate->priority = candidate->priority; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
577 | fscandidate->username = g_strdup(candidate->username); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
578 | fscandidate->password = g_strdup(candidate->password); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
579 | fscandidate->ttl = candidate->ttl; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
580 | return fscandidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
581 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
582 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
583 | static PurpleMediaCandidate * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
584 | purple_media_candidate_from_fs(FsCandidate *fscandidate) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
585 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
586 | PurpleMediaCandidate *candidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
587 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
588 | if (fscandidate == NULL) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
589 | return NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
590 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
591 | candidate = purple_media_candidate_new(fscandidate->foundation, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
592 | fscandidate->component_id, fscandidate->type, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
593 | fscandidate->proto, fscandidate->ip, fscandidate->port); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
594 | candidate->base_ip = g_strdup(fscandidate->base_ip); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
595 | candidate->base_port = fscandidate->base_port; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
596 | candidate->priority = fscandidate->priority; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
597 | candidate->username = g_strdup(fscandidate->username); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
598 | candidate->password = g_strdup(fscandidate->password); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
599 | candidate->ttl = fscandidate->ttl; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
600 | return candidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
601 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
602 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
603 | static GList * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
604 | purple_media_candidate_list_from_fs(GList *candidates) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
605 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
606 | GList *new_list = NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
607 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
608 | for (; candidates; candidates = g_list_next(candidates)) { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
609 | new_list = g_list_prepend(new_list, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
610 | purple_media_candidate_from_fs( |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
611 | candidates->data)); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
612 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
613 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
614 | new_list = g_list_reverse(new_list); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
615 | return new_list; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
616 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
617 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
618 | static GList * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
619 | purple_media_candidate_list_to_fs(GList *candidates) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
620 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
621 | GList *new_list = NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
622 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
623 | for (; candidates; candidates = g_list_next(candidates)) { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
624 | new_list = g_list_prepend(new_list, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
625 | purple_media_candidate_to_fs( |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
626 | candidates->data)); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
627 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
628 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
629 | new_list = g_list_reverse(new_list); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
630 | return new_list; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
631 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
632 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
633 | GList * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
634 | purple_media_candidate_list_copy(GList *candidates) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
635 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
636 | GList *new_list = NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
637 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
638 | for (; candidates; candidates = g_list_next(candidates)) { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
639 | new_list = g_list_prepend(new_list, g_boxed_copy( |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
640 | PURPLE_TYPE_MEDIA_CANDIDATE, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
641 | candidates->data)); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
642 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
643 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
644 | new_list = g_list_reverse(new_list); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
645 | return new_list; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
646 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
647 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
648 | void |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
649 | purple_media_candidate_list_free(GList *candidates) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
650 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
651 | for (; candidates; candidates = |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
652 | g_list_delete_link(candidates, candidates)) { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
653 | g_boxed_free(PURPLE_TYPE_MEDIA_CANDIDATE, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
654 | candidates->data); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
655 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
656 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
657 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
658 | GType |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
659 | purple_media_candidate_get_type() |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
660 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
661 | static GType type = 0; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
662 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
663 | if (type == 0) { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
664 | type = g_boxed_type_register_static("PurpleMediaCandidate", |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
665 | (GBoxedCopyFunc)purple_media_candidate_copy, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
666 | (GBoxedFreeFunc)purple_media_candidate_free); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
667 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
668 | return type; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
669 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
670 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
671 | static FsMediaType |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
672 | purple_media_to_fs_media_type(PurpleMediaSessionType type) |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
673 | { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
674 | if (type & PURPLE_MEDIA_AUDIO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
675 | return FS_MEDIA_TYPE_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
676 | else if (type & PURPLE_MEDIA_VIDEO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
677 | return FS_MEDIA_TYPE_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
678 | else |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
679 | return 0; |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
680 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
681 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
682 | static FsStreamDirection |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
683 | purple_media_to_fs_stream_direction(PurpleMediaSessionType type) |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
684 | { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
685 | if ((type & PURPLE_MEDIA_AUDIO) == PURPLE_MEDIA_AUDIO || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
686 | (type & PURPLE_MEDIA_VIDEO) == PURPLE_MEDIA_VIDEO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
687 | return FS_DIRECTION_BOTH; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
688 | else if ((type & PURPLE_MEDIA_SEND_AUDIO) || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
689 | (type & PURPLE_MEDIA_SEND_VIDEO)) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
690 | return FS_DIRECTION_SEND; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
691 | else if ((type & PURPLE_MEDIA_RECV_AUDIO) || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
692 | (type & PURPLE_MEDIA_RECV_VIDEO)) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
693 | return FS_DIRECTION_RECV; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
694 | else |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
695 | return FS_DIRECTION_NONE; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
696 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
697 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
698 | static PurpleMediaSessionType |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
699 | purple_media_from_fs(FsMediaType type, FsStreamDirection direction) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
700 | { |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
701 | PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
702 | if (type == FS_MEDIA_TYPE_AUDIO) { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
703 | if (direction & FS_DIRECTION_SEND) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
704 | result |= PURPLE_MEDIA_SEND_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
705 | if (direction & FS_DIRECTION_RECV) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
706 | result |= PURPLE_MEDIA_RECV_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
707 | } else if (type == FS_MEDIA_TYPE_VIDEO) { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
708 | if (direction & FS_DIRECTION_SEND) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
709 | result |= PURPLE_MEDIA_SEND_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
710 | if (direction & FS_DIRECTION_RECV) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
711 | result |= PURPLE_MEDIA_RECV_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
712 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
713 | return result; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
714 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
715 | |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
716 | void |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
717 | purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
718 | const gchar *name, const gchar *value) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
719 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
720 | PurpleMediaCodecParameter *new_param; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
721 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
722 | g_return_if_fail(codec != NULL); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
723 | g_return_if_fail(name != NULL && value != NULL); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
724 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
725 | new_param = g_new0(PurpleMediaCodecParameter, 1); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
726 | new_param->name = g_strdup(name); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
727 | new_param->value = g_strdup(value); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
728 | codec->optional_params = g_list_append( |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
729 | codec->optional_params, new_param); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
730 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
731 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
732 | void |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
733 | purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
734 | PurpleMediaCodecParameter *param) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
735 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
736 | g_return_if_fail(codec != NULL && param != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
737 | |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
738 | g_free(param->name); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
739 | g_free(param->value); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
740 | g_free(param); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
741 | |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
742 | codec->optional_params = |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
743 | g_list_remove(codec->optional_params, param); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
744 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
745 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
746 | PurpleMediaCodecParameter * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
747 | purple_media_codec_get_optional_parameter(PurpleMediaCodec *codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
748 | const gchar *name, const gchar *value) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
749 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
750 | GList *iter; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
751 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
752 | g_return_val_if_fail(codec != NULL, NULL); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
753 | g_return_val_if_fail(name != NULL, NULL); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
754 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
755 | for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
756 | PurpleMediaCodecParameter *param = iter->data; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
757 | if (!g_ascii_strcasecmp(param->name, name) && |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
758 | (value == NULL || |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
759 | !g_ascii_strcasecmp(param->value, value))) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
760 | return param; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
761 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
762 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
763 | return NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
764 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
765 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
766 | PurpleMediaCodec * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
767 | purple_media_codec_new(int id, const char *encoding_name, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
768 | PurpleMediaSessionType media_type, guint clock_rate) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
769 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
770 | PurpleMediaCodec *codec = g_new0(PurpleMediaCodec, 1); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
771 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
772 | codec->id = id; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
773 | codec->encoding_name = g_strdup(encoding_name); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
774 | codec->media_type = media_type; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
775 | codec->clock_rate = clock_rate; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
776 | return codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
777 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
778 | |
|
26435
dec1e2779682
Disapprove part of the revision that shouldn't be there.
Michael Ruprecht <maiku@pidgin.im>
parents:
26434
diff
changeset
|
779 | static PurpleMediaCodec * |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
780 | purple_media_codec_copy(PurpleMediaCodec *codec) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
781 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
782 | PurpleMediaCodec *new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
783 | GList *iter; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
784 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
785 | if (codec == NULL) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
786 | return NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
787 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
788 | new_codec = purple_media_codec_new(codec->id, codec->encoding_name, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
789 | codec->media_type, codec->clock_rate); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
790 | new_codec->channels = codec->channels; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
791 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
792 | for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
793 | PurpleMediaCodecParameter *param = |
|
26235
10cecb64ea88
Manipulate optional parameters properly.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
794 | (PurpleMediaCodecParameter*)iter->data; |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
795 | purple_media_codec_add_optional_parameter(new_codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
796 | param->name, param->value); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
797 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
798 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
799 | return new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
800 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
801 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
802 | static void |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
803 | purple_media_codec_free(PurpleMediaCodec *codec) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
804 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
805 | if (codec == NULL) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
806 | return; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
807 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
808 | g_free(codec->encoding_name); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
809 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
810 | for (; codec->optional_params; codec->optional_params = |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
811 | g_list_delete_link(codec->optional_params, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
812 | codec->optional_params)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
813 | purple_media_codec_remove_optional_parameter(codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
814 | codec->optional_params->data); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
815 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
816 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
817 | g_free(codec); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
818 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
819 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
820 | static FsCodec * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
821 | purple_media_codec_to_fs(const PurpleMediaCodec *codec) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
822 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
823 | FsCodec *new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
824 | GList *iter; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
825 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
826 | if (codec == NULL) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
827 | return NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
828 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
829 | new_codec = fs_codec_new(codec->id, codec->encoding_name, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
830 | purple_media_to_fs_media_type(codec->media_type), |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
831 | codec->clock_rate); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
832 | new_codec->channels = codec->channels; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
833 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
834 | for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
835 | PurpleMediaCodecParameter *param = |
|
26235
10cecb64ea88
Manipulate optional parameters properly.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
836 | (PurpleMediaCodecParameter*)iter->data; |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
837 | fs_codec_add_optional_parameter(new_codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
838 | param->name, param->value); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
839 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
840 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
841 | return new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
842 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
843 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
844 | static PurpleMediaCodec * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
845 | purple_media_codec_from_fs(const FsCodec *codec) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
846 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
847 | PurpleMediaCodec *new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
848 | GList *iter; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
849 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
850 | if (codec == NULL) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
851 | return NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
852 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
853 | new_codec = purple_media_codec_new(codec->id, codec->encoding_name, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
854 | purple_media_from_fs(codec->media_type, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
855 | FS_DIRECTION_BOTH), codec->clock_rate); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
856 | new_codec->channels = codec->channels; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
857 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
858 | for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
|
26235
10cecb64ea88
Manipulate optional parameters properly.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
859 | FsCodecParameter *param = (FsCodecParameter*)iter->data; |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
860 | purple_media_codec_add_optional_parameter(new_codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
861 | param->name, param->value); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
862 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
863 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
864 | return new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
865 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
866 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
867 | gchar * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
868 | purple_media_codec_to_string(const PurpleMediaCodec *codec) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
869 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
870 | FsCodec *fscodec = purple_media_codec_to_fs(codec); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
871 | gchar *str = fs_codec_to_string(fscodec); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
872 | fs_codec_destroy(fscodec); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
873 | return str; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
874 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
875 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
876 | static GList * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
877 | purple_media_codec_list_from_fs(GList *codecs) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
878 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
879 | GList *new_list = NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
880 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
881 | for (; codecs; codecs = g_list_next(codecs)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
882 | new_list = g_list_prepend(new_list, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
883 | purple_media_codec_from_fs( |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
884 | codecs->data)); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
885 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
886 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
887 | new_list = g_list_reverse(new_list); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
888 | return new_list; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
889 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
890 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
891 | static GList * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
892 | purple_media_codec_list_to_fs(GList *codecs) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
893 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
894 | GList *new_list = NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
895 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
896 | for (; codecs; codecs = g_list_next(codecs)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
897 | new_list = g_list_prepend(new_list, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
898 | purple_media_codec_to_fs( |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
899 | codecs->data)); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
900 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
901 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
902 | new_list = g_list_reverse(new_list); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
903 | return new_list; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
904 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
905 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
906 | GList * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
907 | purple_media_codec_list_copy(GList *codecs) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
908 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
909 | GList *new_list = NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
910 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
911 | for (; codecs; codecs = g_list_next(codecs)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
912 | new_list = g_list_prepend(new_list, g_boxed_copy( |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
913 | PURPLE_TYPE_MEDIA_CODEC, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
914 | codecs->data)); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
915 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
916 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
917 | new_list = g_list_reverse(new_list); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
918 | return new_list; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
919 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
920 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
921 | void |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
922 | purple_media_codec_list_free(GList *codecs) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
923 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
924 | for (; codecs; codecs = |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
925 | g_list_delete_link(codecs, codecs)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
926 | g_boxed_free(PURPLE_TYPE_MEDIA_CODEC, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
927 | codecs->data); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
928 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
929 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
930 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
931 | GType |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
932 | purple_media_codec_get_type() |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
933 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
934 | static GType type = 0; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
935 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
936 | if (type == 0) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
937 | type = g_boxed_type_register_static("PurpleMediaCodec", |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
938 | (GBoxedCopyFunc)purple_media_codec_copy, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
939 | (GBoxedFreeFunc)purple_media_codec_free); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
940 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
941 | return type; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
942 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
943 | |
|
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
|
944 | 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
|
945 | 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
|
946 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
947 | 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
|
948 | 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
|
949 | 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
|
950 | } |
|
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
|
951 | |
|
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 | static FsParticipant* |
|
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 | purple_media_get_participant(PurpleMedia *media, const gchar *name) |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
954 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
955 | 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
|
956 | return (FsParticipant*) (media->priv->participants) ? |
|
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
|
957 | g_hash_table_lookup(media->priv->participants, name) : 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
|
958 | } |
|
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
|
959 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
960 | static PurpleMediaStream* |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
961 | 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
|
962 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
963 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
964 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
965 | 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
|
966 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
967 | streams = media->priv->streams; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
968 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
969 | for (; streams; streams = g_list_next(streams)) { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
970 | PurpleMediaStream *stream = streams->data; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
971 | if (!strcmp(stream->session->id, session) && |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
972 | !strcmp(stream->participant, participant)) |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
973 | return stream; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
974 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
975 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
976 | 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
|
977 | } |
|
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
|
978 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
979 | static GList * |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
980 | 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
|
981 | const gchar *participant) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
982 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
983 | GList *streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
984 | GList *ret = NULL; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
985 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
986 | 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
|
987 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
988 | streams = media->priv->streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
989 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
990 | 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
|
991 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
992 | if ((session == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
993 | !strcmp(stream->session->id, session)) && |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
994 | (participant == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
995 | !strcmp(stream->participant, participant))) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
996 | 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
|
997 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
998 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
999 | return ret; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1000 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1001 | |
|
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
|
1002 | 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
|
1003 | 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
|
1004 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1005 | 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
|
1006 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1007 | |
|
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
|
1008 | 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
|
1009 | purple_debug_info("media", "Creating hash table for sessions\n"); |
|
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
|
1010 | media->priv->sessions = g_hash_table_new(g_str_hash, g_str_equal); |
|
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
|
1011 | } |
|
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
|
1012 | 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
|
1013 | } |
|
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
|
1014 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1015 | static gboolean |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1016 | purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1017 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1018 | 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
|
1019 | 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
|
1020 | } |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1021 | |
|
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
|
1022 | static FsParticipant * |
|
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
|
1023 | purple_media_add_participant(PurpleMedia *media, const gchar *name) |
|
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
|
1024 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1025 | FsParticipant *participant; |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1026 | GError *err = 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
|
1027 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1028 | 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
|
1029 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1030 | participant = purple_media_get_participant(media, name); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1031 | |
|
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
|
1032 | if (participant) |
|
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
|
1033 | return participant; |
|
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
|
1034 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1035 | participant = fs_conference_new_participant(media->priv->conference, |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
1036 | (gchar*)name, &err); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1037 | |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1038 | if (err) { |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1039 | purple_debug_error("media", "Error creating participant: %s\n", |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1040 | err->message); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1041 | g_error_free(err); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1042 | return NULL; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1043 | } |
|
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
|
1044 | |
|
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
|
1045 | if (!media->priv->participants) { |
|
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
|
1046 | purple_debug_info("media", "Creating hash table for participants\n"); |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
1047 | media->priv->participants = g_hash_table_new_full(g_str_hash, |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
1048 | g_str_equal, 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
|
1049 | } |
|
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
|
1050 | |
|
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
|
1051 | g_hash_table_insert(media->priv->participants, g_strdup(name), participant); |
|
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
|
1052 | |
|
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
|
1053 | return participant; |
|
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
|
1054 | } |
|
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
|
1055 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1056 | static PurpleMediaStream * |
|
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
|
1057 | purple_media_insert_stream(PurpleMediaSession *session, const gchar *name, FsStream *stream) |
|
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
|
1058 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1059 | PurpleMediaStream *media_stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1060 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1061 | 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
|
1062 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1063 | media_stream = g_new0(PurpleMediaStream, 1); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
1064 | media_stream->stream = stream; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
1065 | media_stream->participant = g_strdup(name); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
1066 | media_stream->session = session; |
|
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
|
1067 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
1068 | session->media->priv->streams = |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
1069 | 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
|
1070 | |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1071 | 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
|
1072 | } |
|
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
|
1073 | |
|
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
|
1074 | 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
|
1075 | purple_media_insert_local_candidate(PurpleMediaSession *session, const gchar *name, |
|
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
|
1076 | FsCandidate *candidate) |
|
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
|
1077 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1078 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1079 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1080 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1081 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1082 | 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
|
1083 | 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
|
1084 | } |
|
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
|
1085 | |
|
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
|
1086 | GList * |
|
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
|
1087 | purple_media_get_session_names(PurpleMedia *media) |
|
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
|
1088 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1089 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
| 26332 | 1090 | return media->priv->sessions != NULL ? |
| 1091 | g_hash_table_get_keys(media->priv->sessions) : 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
|
1092 | } |
|
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
|
1093 | |
|
26452
825493ce644e
Remove purple_media_set_src/sink from the public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26451
diff
changeset
|
1094 | static 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
|
1095 | purple_media_set_src(PurpleMedia *media, const gchar *sess_id, GstElement *src) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1096 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1097 | PurpleMediaSession *session; |
|
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
|
1098 | GstPad *sinkpad; |
|
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
|
1099 | GstPad *srcpad; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1100 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1101 | 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
|
1102 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1103 | 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
|
1104 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1105 | if (session == NULL) { |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1106 | purple_debug_warning("media", "purple_media_set_src: trying" |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1107 | " to set src on non-existent session\n"); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1108 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1109 | } |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1110 | |
|
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
|
1111 | if (session->src) |
|
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
|
1112 | gst_object_unref(session->src); |
|
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
|
1113 | session->src = src; |
|
26426
4909c56fe88e
Fix some GStreamer timing issues.
Michael Ruprecht <maiku@pidgin.im>
parents:
26425
diff
changeset
|
1114 | gst_element_set_locked_state(session->src, TRUE); |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
1115 | gst_bin_add(GST_BIN(session->media->priv->confbin), |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1116 | session->src); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1117 | |
|
26321
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
1118 | session->tee = gst_element_factory_make("tee", NULL); |
|
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
1119 | gst_bin_add(GST_BIN(session->media->priv->confbin), session->tee); |
|
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
1120 | gst_element_link(session->src, session->tee); |
|
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
1121 | gst_element_set_state(session->tee, GST_STATE_PLAYING); |
|
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
1122 | |
|
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
|
1123 | g_object_get(session->session, "sink-pad", &sinkpad, NULL); |
|
26321
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
1124 | srcpad = gst_element_get_request_pad(session->tee, "src%d"); |
|
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
|
1125 | purple_debug_info("media", "connecting pad: %s\n", |
|
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
|
1126 | gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK |
|
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
|
1127 | ? "success" : "failure"); |
|
26426
4909c56fe88e
Fix some GStreamer timing issues.
Michael Ruprecht <maiku@pidgin.im>
parents:
26425
diff
changeset
|
1128 | gst_element_set_locked_state(session->src, FALSE); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1129 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1130 | |
|
26452
825493ce644e
Remove purple_media_set_src/sink from the public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26451
diff
changeset
|
1131 | #if 0 |
|
825493ce644e
Remove purple_media_set_src/sink from the public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26451
diff
changeset
|
1132 | static void |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1133 | purple_media_set_sink(PurpleMedia *media, const gchar *sess_id, |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1134 | const gchar *participant, GstElement *sink) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1135 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1136 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1137 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1138 | 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
|
1139 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1140 | stream = purple_media_get_stream(media, sess_id, participant); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1141 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1142 | if (stream == NULL) { |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1143 | purple_debug_warning("media", "purple_media_set_sink: trying" |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1144 | " to set sink on non-existent stream\n"); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1145 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1146 | } |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1147 | |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1148 | if (stream->sink) |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1149 | gst_object_unref(stream->sink); |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1150 | stream->sink = sink; |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
1151 | gst_bin_add(GST_BIN(stream->session->media->priv->confbin), |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1152 | stream->sink); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1153 | } |
|
26452
825493ce644e
Remove purple_media_set_src/sink from the public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26451
diff
changeset
|
1154 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1155 | |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1156 | 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
|
1157 | 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
|
1158 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1159 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1160 | 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
|
1161 | 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
|
1162 | return (session != NULL) ? session->src : NULL; |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1163 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1164 | |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1165 | static PurpleMediaSession * |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1166 | purple_media_session_from_fs_stream(PurpleMedia *media, FsStream *stream) |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1167 | { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1168 | FsSession *fssession; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1169 | GList *values; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1170 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1171 | 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
|
1172 | g_return_val_if_fail(FS_IS_STREAM(stream), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1173 | |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1174 | g_object_get(stream, "session", &fssession, NULL); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1175 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1176 | values = g_hash_table_get_values(media->priv->sessions); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1177 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1178 | for (; values; values = g_list_delete_link(values, values)) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1179 | PurpleMediaSession *session = values->data; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1180 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1181 | if (session->session == fssession) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1182 | g_list_free(values); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1183 | g_object_unref(fssession); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1184 | return session; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1185 | } |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1186 | } |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1187 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1188 | g_object_unref(fssession); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1189 | return NULL; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1190 | } |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1191 | |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1192 | static gboolean |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1193 | media_bus_call(GstBus *bus, GstMessage *msg, PurpleMedia *media) |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1194 | { |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1195 | switch(GST_MESSAGE_TYPE(msg)) { |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1196 | case GST_MESSAGE_ELEMENT: { |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1197 | if (!FS_IS_CONFERENCE(GST_MESSAGE_SRC(msg)) || |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1198 | !PURPLE_IS_MEDIA(media) || |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1199 | media->priv->conference != |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1200 | FS_CONFERENCE(GST_MESSAGE_SRC(msg))) |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1201 | break; |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
1202 | |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1203 | if (gst_structure_has_name(msg->structure, "farsight-error")) { |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1204 | FsError error_no; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1205 | gst_structure_get_enum(msg->structure, "error-no", |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1206 | FS_TYPE_ERROR, (gint*)&error_no); |
|
26132
1dce93db50e3
Silence FS_ERROR_UNKNOWN_CNAME error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26131
diff
changeset
|
1207 | /* |
|
1dce93db50e3
Silence FS_ERROR_UNKNOWN_CNAME error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26131
diff
changeset
|
1208 | * Unknown CName is only a problem for the |
|
1dce93db50e3
Silence FS_ERROR_UNKNOWN_CNAME error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26131
diff
changeset
|
1209 | * multicast transmitter which isn't used. |
|
1dce93db50e3
Silence FS_ERROR_UNKNOWN_CNAME error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26131
diff
changeset
|
1210 | */ |
|
1dce93db50e3
Silence FS_ERROR_UNKNOWN_CNAME error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26131
diff
changeset
|
1211 | if (error_no != FS_ERROR_UNKNOWN_CNAME) |
|
1dce93db50e3
Silence FS_ERROR_UNKNOWN_CNAME error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26131
diff
changeset
|
1212 | purple_debug_error("media", "farsight-error: %i: %s\n", error_no, |
|
1dce93db50e3
Silence FS_ERROR_UNKNOWN_CNAME error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26131
diff
changeset
|
1213 | gst_structure_get_string(msg->structure, "error-msg")); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1214 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1215 | "farsight-new-local-candidate")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1216 | FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1217 | FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "candidate")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1218 | PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1219 | purple_media_new_local_candidate_cb(stream, local_candidate, session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1220 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1221 | "farsight-local-candidates-prepared")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1222 | FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1223 | PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1224 | purple_media_candidates_prepared_cb(stream, session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1225 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1226 | "farsight-new-active-candidate-pair")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1227 | FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1228 | FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "local-candidate")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1229 | FsCandidate *remote_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "remote-candidate")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1230 | PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1231 | purple_media_candidate_pair_established_cb(stream, local_candidate, remote_candidate, session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1232 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1233 | "farsight-recv-codecs-changed")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1234 | GList *codecs = g_value_get_boxed(gst_structure_get_value(msg->structure, "codecs")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1235 | FsCodec *codec = codecs->data; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1236 | purple_debug_info("media", "farsight-recv-codecs-changed: %s\n", codec->encoding_name); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1237 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1238 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1239 | "farsight-component-state-changed")) { |
|
26297
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1240 | FsStreamState fsstate = g_value_get_enum(gst_structure_get_value(msg->structure, "state")); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1241 | guint component = g_value_get_uint(gst_structure_get_value(msg->structure, "component")); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1242 | const gchar *state; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1243 | switch (fsstate) { |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1244 | case FS_STREAM_STATE_FAILED: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1245 | state = "FAILED"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1246 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1247 | case FS_STREAM_STATE_DISCONNECTED: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1248 | state = "DISCONNECTED"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1249 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1250 | case FS_STREAM_STATE_GATHERING: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1251 | state = "GATHERING"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1252 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1253 | case FS_STREAM_STATE_CONNECTING: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1254 | state = "CONNECTING"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1255 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1256 | case FS_STREAM_STATE_CONNECTED: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1257 | state = "CONNECTED"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1258 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1259 | case FS_STREAM_STATE_READY: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1260 | state = "READY"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1261 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1262 | default: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1263 | state = "UNKNOWN"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1264 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1265 | } |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1266 | purple_debug_info("media", "farsight-component-state-changed: component: %u state: %s\n", component, state); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1267 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1268 | "farsight-send-codec-changed")) { |
|
26297
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1269 | FsCodec *codec = g_value_get_boxed(gst_structure_get_value(msg->structure, "codec")); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1270 | gchar *codec_str = fs_codec_to_string(codec); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1271 | purple_debug_info("media", "farsight-send-codec-changed: codec: %s\n", codec_str); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1272 | g_free(codec_str); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1273 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1274 | "farsight-codecs-changed")) { |
|
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
|
1275 | GList *sessions = g_hash_table_get_values(PURPLE_MEDIA(media)->priv->sessions); |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1276 | FsSession *fssession = g_value_get_object(gst_structure_get_value(msg->structure, "session")); |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1277 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1278 | PurpleMediaSession *session = sessions->data; |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1279 | if (session->session == fssession) { |
|
26436
2e5e9f45924c
Remove the ready-new signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26434
diff
changeset
|
1280 | gchar *session_id = g_strdup(session->id); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
1281 | g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, session_id); |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
1282 | g_free(session_id); |
|
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
|
1283 | g_list_free(sessions); |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1284 | break; |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1285 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1286 | } |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1287 | } |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1288 | break; |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1289 | } |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1290 | default: |
|
26120
b4ab036ab9fe
Remove a bunch of extraneous GstBus messages from the debug output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26119
diff
changeset
|
1291 | break; |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1292 | } |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1293 | |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1294 | return TRUE; |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1295 | } |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1296 | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1297 | 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
|
1298 | purple_media_get_pipeline(PurpleMedia *media) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1299 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1300 | 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
|
1301 | |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1302 | return purple_media_manager_get_pipeline(media->priv->manager); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1303 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1304 | |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1305 | PurpleConnection * |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1306 | purple_media_get_connection(PurpleMedia *media) |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1307 | { |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1308 | PurpleConnection *pc; |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1309 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1310 | g_object_get(G_OBJECT(media), "connection", &pc, NULL); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1311 | return pc; |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1312 | } |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1313 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1314 | gpointer |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1315 | purple_media_get_prpl_data(PurpleMedia *media) |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1316 | { |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1317 | gpointer prpl_data; |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1318 | 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
|
1319 | 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
|
1320 | return prpl_data; |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1321 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1322 | |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1323 | void |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1324 | 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
|
1325 | { |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1326 | 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
|
1327 | g_object_set(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
|
1328 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1329 | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1330 | void |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1331 | purple_media_error(PurpleMedia *media, const gchar *error, ...) |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1332 | { |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1333 | va_list args; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1334 | gchar *message; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1335 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1336 | 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
|
1337 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1338 | va_start(args, error); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1339 | message = g_strdup_vprintf(error, args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1340 | va_end(args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1341 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1342 | purple_debug_error("media", "%s\n", message); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1343 | g_signal_emit(media, purple_media_signals[ERROR], 0, message); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1344 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1345 | g_free(message); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1346 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1347 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1348 | void |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1349 | purple_media_accept(PurpleMedia *media) |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1350 | { |
|
26209
618cc6a7cff2
Wait to send media until both sides have accepted.
Michael Ruprecht <maiku@pidgin.im>
parents:
26200
diff
changeset
|
1351 | GList *streams; |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1352 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1353 | 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
|
1354 | |
|
26209
618cc6a7cff2
Wait to send media until both sides have accepted.
Michael Ruprecht <maiku@pidgin.im>
parents:
26200
diff
changeset
|
1355 | streams = media->priv->streams; |
|
618cc6a7cff2
Wait to send media until both sides have accepted.
Michael Ruprecht <maiku@pidgin.im>
parents:
26200
diff
changeset
|
1356 | |
|
618cc6a7cff2
Wait to send media until both sides have accepted.
Michael Ruprecht <maiku@pidgin.im>
parents:
26200
diff
changeset
|
1357 | for (; streams; streams = g_list_next(streams)) { |
|
26257
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1358 | PurpleMediaStream *stream = streams->data; |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1359 | g_object_set(G_OBJECT(stream->stream), "direction", |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1360 | purple_media_to_fs_stream_direction( |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1361 | stream->session->type), NULL); |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1362 | stream->accepted = TRUE; |
|
26209
618cc6a7cff2
Wait to send media until both sides have accepted.
Michael Ruprecht <maiku@pidgin.im>
parents:
26200
diff
changeset
|
1363 | } |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1364 | |
|
26432
cc99744b301d
Move accepted signal emission to after it's set to accepted.
Michael Ruprecht <maiku@pidgin.im>
parents:
26430
diff
changeset
|
1365 | g_signal_emit(media, purple_media_signals[ACCEPTED], |
|
cc99744b301d
Move accepted signal emission to after it's set to accepted.
Michael Ruprecht <maiku@pidgin.im>
parents:
26430
diff
changeset
|
1366 | 0, NULL, NULL); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1367 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1368 | |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1369 | void |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1370 | purple_media_hangup(PurpleMedia *media) |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1371 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1372 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1373 | g_signal_emit(media, purple_media_signals[STREAM_INFO], |
|
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1374 | 0, PURPLE_MEDIA_INFO_HANGUP, |
|
26237
9f5f3c147950
Added reject and hangup states to the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26235
diff
changeset
|
1375 | NULL, NULL); |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
1376 | purple_media_end(media, NULL, NULL); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1377 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1378 | |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1379 | void |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1380 | purple_media_reject(PurpleMedia *media) |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1381 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1382 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1383 | g_signal_emit(media, purple_media_signals[STREAM_INFO], |
|
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1384 | 0, PURPLE_MEDIA_INFO_REJECT, |
|
26237
9f5f3c147950
Added reject and hangup states to the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26235
diff
changeset
|
1385 | NULL, NULL); |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
1386 | purple_media_end(media, NULL, NULL); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1387 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1388 | |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1389 | void |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
1390 | 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
|
1391 | 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
|
1392 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1393 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1394 | if (session_id == NULL && participant == NULL) { |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
1395 | 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
|
1396 | 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
|
1397 | NULL, NULL); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1398 | g_object_unref(media); |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1399 | } |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1400 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1401 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1402 | static void |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1403 | purple_media_new_local_candidate_cb(FsStream *stream, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1404 | FsCandidate *local_candidate, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1405 | 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
|
1406 | { |
|
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
|
1407 | gchar *name; |
|
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
|
1408 | FsParticipant *participant; |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1409 | PurpleMediaCandidate *candidate; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1410 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1411 | g_return_if_fail(FS_IS_STREAM(stream)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1412 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1413 | |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1414 | purple_debug_info("media", "got new local candidate: %s\n", local_candidate->foundation); |
|
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
|
1415 | g_object_get(stream, "participant", &participant, 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
|
1416 | g_object_get(participant, "cname", &name, 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
|
1417 | g_object_unref(participant); |
|
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
|
1418 | |
|
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
|
1419 | purple_media_insert_local_candidate(session, name, fs_candidate_copy(local_candidate)); |
|
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
|
1420 | |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1421 | candidate = purple_media_candidate_from_fs(local_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
|
1422 | g_signal_emit(session->media, purple_media_signals[NEW_CANDIDATE], |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
1423 | 0, session->id, name, candidate); |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1424 | purple_media_candidate_free(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
|
1425 | |
|
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
|
1426 | g_free(name); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1427 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1428 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1429 | static void |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1430 | purple_media_candidates_prepared_cb(FsStream *stream, 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
|
1431 | { |
|
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
|
1432 | gchar *name; |
|
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
|
1433 | FsParticipant *participant; |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1434 | PurpleMediaStream *stream_data; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1435 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1436 | g_return_if_fail(FS_IS_STREAM(stream)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1437 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1438 | |
|
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
|
1439 | g_object_get(stream, "participant", &participant, 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
|
1440 | g_object_get(participant, "cname", &name, 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
|
1441 | g_object_unref(participant); |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1442 | |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1443 | stream_data = purple_media_get_stream(session->media, session->id, name); |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1444 | stream_data->candidates_prepared = TRUE; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1445 | |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1446 | g_signal_emit(session->media, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1447 | purple_media_signals[CANDIDATES_PREPARED], |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1448 | 0, session->id, name); |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1449 | |
|
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
|
1450 | g_free(name); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1451 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1452 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1453 | /* 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
|
1454 | * 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
|
1455 | static void |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1456 | purple_media_candidate_pair_established_cb(FsStream *fsstream, |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1457 | FsCandidate *native_candidate, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1458 | FsCandidate *remote_candidate, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1459 | 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
|
1460 | { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1461 | gchar *name; |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1462 | FsParticipant *participant; |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1463 | PurpleMediaStream *stream; |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1464 | GList *iter; |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
1465 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1466 | g_return_if_fail(FS_IS_STREAM(fsstream)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1467 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1468 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1469 | g_object_get(fsstream, "participant", &participant, NULL); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1470 | g_object_get(participant, "cname", &name, NULL); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1471 | g_object_unref(participant); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1472 | |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1473 | stream = purple_media_get_stream(session->media, session->id, name); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1474 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1475 | iter = stream->active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1476 | for(; iter; iter = g_list_next(iter)) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1477 | FsCandidate *c = iter->data; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1478 | if (native_candidate->component_id == c->component_id) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1479 | fs_candidate_destroy(c); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1480 | stream->active_local_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1481 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1482 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1483 | stream->active_local_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1484 | fs_candidate_copy(native_candidate)); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1485 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1486 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1487 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1488 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1489 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1490 | stream->active_local_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1491 | fs_candidate_copy(native_candidate)); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1492 | |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1493 | iter = stream->active_remote_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1494 | for(; iter; iter = g_list_next(iter)) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1495 | FsCandidate *c = iter->data; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1496 | if (native_candidate->component_id == c->component_id) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1497 | fs_candidate_destroy(c); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1498 | stream->active_remote_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1499 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1500 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1501 | stream->active_remote_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1502 | fs_candidate_copy(remote_candidate)); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1503 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1504 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1505 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1506 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1507 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1508 | stream->active_remote_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1509 | fs_candidate_copy(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
|
1510 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1511 | 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
|
1512 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1513 | |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1514 | static gboolean |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1515 | purple_media_connected_cb(PurpleMediaStream *stream) |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1516 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1517 | g_return_val_if_fail(stream != NULL, FALSE); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1518 | |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1519 | stream->connected_cb_id = 0; |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1520 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1521 | purple_media_manager_create_output_window( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1522 | stream->session->media->priv->manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1523 | stream->session->media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1524 | stream->session->id, stream->participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1525 | |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1526 | g_signal_emit(stream->session->media, |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1527 | purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
1528 | 0, PURPLE_MEDIA_STATE_CONNECTED, |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1529 | stream->session->id, stream->participant); |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1530 | return FALSE; |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1531 | } |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1532 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1533 | static void |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1534 | purple_media_src_pad_added_cb(FsStream *fsstream, GstPad *srcpad, |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1535 | FsCodec *codec, PurpleMediaStream *stream) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1536 | { |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1537 | PurpleMediaPrivate *priv; |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1538 | GstPad *sinkpad; |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1539 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1540 | g_return_if_fail(FS_IS_STREAM(fsstream)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1541 | g_return_if_fail(stream != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1542 | |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1543 | priv = stream->session->media->priv; |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1544 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1545 | if (stream->src == NULL) { |
| 26340 | 1546 | GstElement *sink = NULL; |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1547 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1548 | if (codec->media_type == FS_MEDIA_TYPE_AUDIO) { |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1549 | /* |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1550 | * Should this instead be: |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1551 | * audioconvert ! audioresample ! liveadder ! |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1552 | * audioresample ! audioconvert ! realsink |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1553 | */ |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1554 | stream->src = gst_element_factory_make( |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1555 | "liveadder", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1556 | sink = purple_media_manager_get_element(priv->manager, |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1557 | PURPLE_MEDIA_RECV_AUDIO); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1558 | } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) { |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1559 | stream->src = gst_element_factory_make( |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1560 | "fsfunnel", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1561 | sink = gst_element_factory_make( |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1562 | "fakesink", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1563 | g_object_set(G_OBJECT(sink), "async", FALSE, NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1564 | } |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1565 | stream->tee = gst_element_factory_make("tee", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1566 | gst_bin_add_many(GST_BIN(priv->confbin), |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1567 | stream->src, stream->tee, sink, NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1568 | gst_element_sync_state_with_parent(sink); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1569 | gst_element_sync_state_with_parent(stream->tee); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1570 | gst_element_sync_state_with_parent(stream->src); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1571 | gst_element_link_many(stream->src, stream->tee, sink, NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1572 | } |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1573 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1574 | sinkpad = gst_element_get_request_pad(stream->src, "sink%d"); |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1575 | gst_pad_link(srcpad, sinkpad); |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1576 | gst_object_unref(sinkpad); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1577 | |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1578 | stream->connected_cb_id = purple_timeout_add(0, |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1579 | (GSourceFunc)purple_media_connected_cb, stream); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1580 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1581 | |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1582 | static gboolean |
|
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
|
1583 | purple_media_add_stream_internal(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
|
1584 | const gchar *who, FsMediaType type, |
|
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
|
1585 | FsStreamDirection type_direction, |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1586 | const gchar *transmitter, |
|
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1587 | 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
|
1588 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1589 | 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
|
1590 | FsParticipant *participant = NULL; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1591 | PurpleMediaStream *stream = NULL; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1592 | FsStreamDirection *direction = NULL; |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1593 | PurpleMediaSessionType session_type; |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1594 | gboolean is_nice = !strcmp(transmitter, "nice"); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1595 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1596 | 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
|
1597 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1598 | 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
|
1599 | |
|
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
|
1600 | if (!session) { |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1601 | GError *err = NULL; |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1602 | GList *codec_conf = NULL; |
|
26148
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1603 | gchar *filename = 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
|
1604 | |
|
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
|
1605 | 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
|
1606 | |
|
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
|
1607 | session->session = fs_conference_new_session(media->priv->conference, type, &err); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1608 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1609 | if (err != NULL) { |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1610 | purple_media_error(media, "Error creating session: %s\n", err->message); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1611 | g_error_free(err); |
|
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
|
1612 | g_free(session); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1613 | return FALSE; |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1614 | } |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1615 | |
|
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
|
1616 | /* XXX: SPEEX has a latency of 5 or 6 seconds for me */ |
|
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
|
1617 | #if 0 |
|
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
|
1618 | /* SPEEX is added through the configuration */ |
|
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
|
1619 | codec_conf = g_list_prepend(codec_conf, fs_codec_new(FS_CODEC_ID_ANY, |
|
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
|
1620 | "SPEEX", FS_MEDIA_TYPE_AUDIO, 8000)); |
|
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
|
1621 | codec_conf = g_list_prepend(codec_conf, fs_codec_new(FS_CODEC_ID_ANY, |
|
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
|
1622 | "SPEEX", FS_MEDIA_TYPE_AUDIO, 16000)); |
|
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
|
1623 | #endif |
|
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
|
1624 | |
|
26148
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1625 | filename = g_build_filename(purple_user_dir(), "fs-codec.conf", NULL); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1626 | codec_conf = fs_codec_list_from_keyfile(filename, &err); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1627 | g_free(filename); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1628 | |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1629 | if (err != NULL) { |
|
26296
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1630 | if (err->code == 4) |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1631 | purple_debug_info("media", "Couldn't read " |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1632 | "fs-codec.conf: %s\n", |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1633 | err->message); |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1634 | else |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1635 | purple_debug_error("media", "Error reading " |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1636 | "fs-codec.conf: %s\n", |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1637 | err->message); |
|
26148
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1638 | g_error_free(err); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1639 | } |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1640 | |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1641 | fs_session_set_codec_preferences(session->session, codec_conf, 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
|
1642 | |
|
26180
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1643 | /* |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1644 | * Removes a 5-7 second delay before |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1645 | * receiving the src-pad-added signal. |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1646 | * Only works for non-multicast FsRtpSessions. |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1647 | */ |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1648 | if (is_nice || !strcmp(transmitter, "rawudp")) |
|
26180
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1649 | g_object_set(G_OBJECT(session->session), |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1650 | "no-rtcp-timeout", 0, NULL); |
|
23726
43a5e1a3131d
Temporary fix to remove a 5-7 second delay when initiating a media session.
Michael Ruprecht <maiku@pidgin.im>
parents:
23724
diff
changeset
|
1651 | |
|
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
|
1652 | fs_codec_list_destroy(codec_conf); |
|
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
|
1653 | |
|
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
|
1654 | 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
|
1655 | session->media = media; |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
1656 | session->type = purple_media_from_fs(type, type_direction); |
|
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
|
1657 | |
|
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
|
1658 | purple_media_add_session(media, session); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1659 | 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
|
1660 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1661 | session->id, NULL); |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1662 | |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1663 | session_type = purple_media_from_fs(type, FS_DIRECTION_SEND); |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1664 | purple_media_set_src(media, session->id, |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1665 | purple_media_manager_get_element( |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
1666 | media->priv->manager, session_type)); |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1667 | gst_element_set_state(session->src, GST_STATE_PLAYING); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1668 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1669 | purple_media_manager_create_output_window( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1670 | media->priv->manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1671 | session->media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1672 | 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
|
1673 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1674 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1675 | if (!(participant = purple_media_add_participant(media, who))) { |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1676 | purple_media_remove_session(media, session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1677 | g_free(session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1678 | return FALSE; |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1679 | } else { |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1680 | 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
|
1681 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1682 | NULL, who); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1683 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1684 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1685 | stream = purple_media_get_stream(media, sess_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
|
1686 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1687 | if (!stream) { |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1688 | GError *err = NULL; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1689 | FsStream *fsstream = NULL; |
|
26256
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26253
diff
changeset
|
1690 | const gchar *stun_ip = purple_network_get_stun_ip(); |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1691 | const gchar *turn_ip = purple_network_get_turn_ip(); |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1692 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1693 | if (stun_ip || turn_ip) { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1694 | guint new_num_params = |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1695 | (stun_ip && is_nice) && turn_ip ? |
|
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1696 | num_params + 2 : num_params + 1; |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1697 | guint next_param_index = num_params; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1698 | GParameter *param = g_new0(GParameter, new_num_params); |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1699 | memcpy(param, params, sizeof(GParameter) * num_params); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1700 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1701 | if (stun_ip) { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1702 | purple_debug_info("media", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1703 | "setting property stun-ip on new stream: %s\n", stun_ip); |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1704 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1705 | param[next_param_index].name = "stun-ip"; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1706 | g_value_init(¶m[next_param_index].value, G_TYPE_STRING); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1707 | g_value_set_string(¶m[next_param_index].value, stun_ip); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1708 | next_param_index++; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1709 | } |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1710 | |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1711 | if (turn_ip && is_nice) { |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1712 | GValueArray *relay_info = g_value_array_new(0); |
|
26263
725845e88ebf
Removed a couple of warnings
Marcus Lundblad <malu@pidgin.im>
parents:
26262
diff
changeset
|
1713 | GValue value; |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1714 | gint turn_port = |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1715 | purple_prefs_get_int("/purple/network/turn_port"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1716 | const gchar *username = |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1717 | purple_prefs_get_string("/purple/network/turn_username"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1718 | const gchar *password = |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1719 | purple_prefs_get_string("/purple/network/turn_password"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1720 | GstStructure *turn_setup = gst_structure_new("relay-info", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1721 | "ip", G_TYPE_STRING, turn_ip, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1722 | "port", G_TYPE_UINT, turn_port, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1723 | "username", G_TYPE_STRING, username, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1724 | "password", G_TYPE_STRING, password, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1725 | NULL); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1726 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1727 | if (turn_setup) { |
|
26263
725845e88ebf
Removed a couple of warnings
Marcus Lundblad <malu@pidgin.im>
parents:
26262
diff
changeset
|
1728 | memset(&value, 0, sizeof(GValue)); |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1729 | g_value_init(&value, GST_TYPE_STRUCTURE); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1730 | gst_value_set_structure(&value, turn_setup); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1731 | relay_info = g_value_array_append(relay_info, &value); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1732 | gst_structure_free(turn_setup); |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1733 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1734 | purple_debug_info("media", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1735 | "setting property relay-info on new stream\n"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1736 | param[next_param_index].name = "relay-info"; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1737 | g_value_init(¶m[next_param_index].value, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1738 | G_TYPE_VALUE_ARRAY); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1739 | g_value_set_boxed(¶m[next_param_index].value, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1740 | relay_info); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1741 | g_value_array_free(relay_info); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1742 | } else { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1743 | purple_debug_error("media", "Error relay info"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1744 | g_object_unref(participant); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1745 | g_hash_table_remove(media->priv->participants, who); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1746 | purple_media_remove_session(media, session); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1747 | g_free(session); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1748 | return FALSE; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1749 | } |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1750 | } |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1751 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1752 | fsstream = fs_session_new_stream(session->session, |
|
26257
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1753 | participant, type_direction & |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1754 | FS_DIRECTION_RECV, transmitter, |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1755 | new_num_params, param, &err); |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1756 | g_free(param); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1757 | } else { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1758 | fsstream = fs_session_new_stream(session->session, |
|
26257
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1759 | participant, type_direction & |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1760 | FS_DIRECTION_RECV, transmitter, |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1761 | num_params, params, &err); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1762 | } |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1763 | |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1764 | if (err) { |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1765 | purple_debug_error("media", "Error creating stream: %s\n", |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1766 | err->message); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1767 | g_error_free(err); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1768 | g_object_unref(participant); |
|
26129
18c8f2cfb52b
Properly free PurpleMedia when there's an error creating an FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26125
diff
changeset
|
1769 | g_hash_table_remove(media->priv->participants, who); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1770 | purple_media_remove_session(media, session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1771 | g_free(session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1772 | return FALSE; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1773 | } |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1774 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1775 | stream = purple_media_insert_stream(session, who, fsstream); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1776 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1777 | /* callback for source pad added (new stream source ready) */ |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1778 | g_signal_connect(G_OBJECT(fsstream), |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1779 | "src-pad-added", G_CALLBACK(purple_media_src_pad_added_cb), stream); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1780 | |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1781 | 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
|
1782 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1783 | 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
|
1784 | } else if (*direction != type_direction) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1785 | /* change direction */ |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1786 | g_object_set(stream->stream, "direction", type_direction, NULL); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1787 | } |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1788 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1789 | return TRUE; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1790 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1791 | |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1792 | gboolean |
|
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
|
1793 | purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, const gchar *who, |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
1794 | PurpleMediaSessionType type, |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1795 | const gchar *transmitter, |
|
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1796 | 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
|
1797 | { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1798 | FsStreamDirection type_direction; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1799 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1800 | 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
|
1801 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1802 | if (type & PURPLE_MEDIA_AUDIO) { |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
1803 | type_direction = purple_media_to_fs_stream_direction(type & PURPLE_MEDIA_AUDIO); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1804 | |
|
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
|
1805 | if (!purple_media_add_stream_internal(media, sess_id, who, |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1806 | FS_MEDIA_TYPE_AUDIO, type_direction, |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1807 | transmitter, num_params, params)) { |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1808 | return FALSE; |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1809 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1810 | } |
|
26134
2def4b29fcfe
purple_media_add_stream should only add a stream to one session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26133
diff
changeset
|
1811 | else if (type & PURPLE_MEDIA_VIDEO) { |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
1812 | type_direction = purple_media_to_fs_stream_direction(type & PURPLE_MEDIA_VIDEO); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1813 | |
|
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
|
1814 | if (!purple_media_add_stream_internal(media, sess_id, who, |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1815 | FS_MEDIA_TYPE_VIDEO, type_direction, |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1816 | transmitter, num_params, params)) { |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1817 | return FALSE; |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1818 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1819 | } |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1820 | return TRUE; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1821 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1822 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1823 | 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
|
1824 | purple_media_remove_stream(PurpleMedia *media, const gchar *sess_id, const gchar *who) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1825 | { |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1826 | /* Add state-changed end emits in here when this is implemented */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1827 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1828 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
1829 | 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
|
1830 | 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
|
1831 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1832 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1833 | 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
|
1834 | 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
|
1835 | return session->type; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1836 | } |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1837 | /* 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
|
1838 | GList * |
|
26160
46bc5e18d59c
Combine get_*_codecs functions to mirror Farsight 2.
Michael Ruprecht <maiku@pidgin.im>
parents:
26151
diff
changeset
|
1839 | 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
|
1840 | { |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1841 | GList *fscodecs; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1842 | GList *codecs; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1843 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1844 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1845 | 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
|
1846 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1847 | 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
|
1848 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1849 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1850 | return NULL; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1851 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1852 | g_object_get(G_OBJECT(session->session), |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1853 | "codecs", &fscodecs, NULL); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1854 | codecs = purple_media_codec_list_from_fs(fscodecs); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1855 | fs_codec_list_destroy(fscodecs); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1856 | return codecs; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1857 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1858 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1859 | GList * |
|
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
|
1860 | purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *name) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1861 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1862 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1863 | 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
|
1864 | stream = purple_media_get_stream(media, sess_id, name); |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1865 | return purple_media_candidate_list_from_fs(stream->local_candidates); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1866 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1867 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1868 | 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
|
1869 | purple_media_add_remote_candidates(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
|
1870 | const gchar *name, 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
|
1871 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1872 | PurpleMediaStream *stream; |
|
26258
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1873 | GError *err = NULL; |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1874 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1875 | 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
|
1876 | stream = purple_media_get_stream(media, sess_id, name); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1877 | |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
1878 | stream->remote_candidates = g_list_concat(stream->remote_candidates, |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1879 | purple_media_candidate_list_to_fs(remote_candidates)); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1880 | |
|
26258
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1881 | fs_stream_set_remote_candidates(stream->stream, |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1882 | stream->remote_candidates, &err); |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1883 | |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1884 | if (err) { |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1885 | purple_debug_error("media", "Error adding remote" |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1886 | " candidates: %s\n", err->message); |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1887 | g_error_free(err); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1888 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1889 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1890 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1891 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1892 | purple_media_get_active_local_candidates(PurpleMedia *media, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1893 | const gchar *sess_id, const gchar *name) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1894 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1895 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1896 | 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
|
1897 | stream = purple_media_get_stream(media, sess_id, name); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1898 | return purple_media_candidate_list_from_fs( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1899 | stream->active_local_candidates); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1900 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1901 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1902 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1903 | purple_media_get_active_remote_candidates(PurpleMedia *media, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1904 | const gchar *sess_id, const gchar *name) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1905 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1906 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1907 | 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
|
1908 | stream = purple_media_get_stream(media, sess_id, name); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1909 | return purple_media_candidate_list_from_fs( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1910 | stream->active_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
|
1911 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1912 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1913 | gboolean |
|
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
|
1914 | purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, const gchar *name, 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
|
1915 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1916 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1917 | FsStream *fsstream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1918 | GList *fscodecs; |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1919 | GError *err = NULL; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1920 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1921 | 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
|
1922 | stream = purple_media_get_stream(media, sess_id, name); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1923 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1924 | if (stream == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1925 | return FALSE; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1926 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1927 | fsstream = stream->stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1928 | fscodecs = purple_media_codec_list_to_fs(codecs); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1929 | fs_stream_set_remote_codecs(fsstream, fscodecs, &err); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1930 | fs_codec_list_destroy(fscodecs); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1931 | |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1932 | if (err) { |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1933 | purple_debug_error("media", "Error setting remote codecs: %s\n", |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1934 | err->message); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1935 | g_error_free(err); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1936 | return FALSE; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1937 | } |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1938 | return TRUE; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1939 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1940 | |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1941 | gboolean |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1942 | purple_media_candidates_prepared(PurpleMedia *media, |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1943 | 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
|
1944 | { |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1945 | GList *streams; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1946 | gboolean prepared = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1947 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1948 | 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
|
1949 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1950 | 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
|
1951 | |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1952 | 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
|
1953 | PurpleMediaStream *stream = streams->data; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1954 | if (stream->candidates_prepared == FALSE) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1955 | g_list_free(streams); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1956 | prepared = FALSE; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1957 | break; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1958 | } |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1959 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1960 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1961 | return prepared; |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1962 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1963 | |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1964 | gboolean |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1965 | 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
|
1966 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1967 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1968 | FsCodec *fscodec; |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1969 | GError *err = NULL; |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1970 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1971 | 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
|
1972 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1973 | 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
|
1974 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1975 | if (session != NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1976 | return FALSE; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1977 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1978 | fscodec = purple_media_codec_to_fs(codec); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1979 | fs_session_set_send_codec(session->session, fscodec, &err); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1980 | fs_codec_destroy(fscodec); |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1981 | |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1982 | if (err) { |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1983 | purple_debug_error("media", "Error setting send codec\n"); |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1984 | g_error_free(err); |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1985 | return FALSE; |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1986 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1987 | return TRUE; |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1988 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1989 | |
|
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
|
1990 | 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
|
1991 | 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
|
1992 | { |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1993 | gboolean ret; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1994 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1995 | 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
|
1996 | |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1997 | if (sess_id != NULL) { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1998 | PurpleMediaSession *session; |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1999 | session = purple_media_get_session(media, sess_id); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2000 | |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2001 | if (session == NULL) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2002 | return FALSE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2003 | |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2004 | g_object_get(session->session, "codecs-ready", &ret, NULL); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2005 | } else { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2006 | GList *values = g_hash_table_get_values(media->priv->sessions); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2007 | for (; values; values = g_list_delete_link(values, values)) { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2008 | PurpleMediaSession *session = values->data; |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2009 | g_object_get(session->session, |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2010 | "codecs-ready", &ret, NULL); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2011 | if (ret == FALSE) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2012 | break; |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2013 | } |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2014 | if (values != NULL) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2015 | g_list_free(values); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2016 | } |
|
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
|
2017 | return ret; |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
2018 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
2019 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2020 | gboolean |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2021 | 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
|
2022 | 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
|
2023 | { |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2024 | gboolean accepted = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2025 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2026 | 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
|
2027 | |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2028 | 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
|
2029 | GList *streams = media->priv->streams; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2030 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2031 | 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
|
2032 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2033 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2034 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2035 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2036 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2037 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2038 | } 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
|
2039 | 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
|
2040 | media, sess_id, NULL); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2041 | for (; streams; streams = |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2042 | 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
|
2043 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2044 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2045 | g_list_free(streams); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2046 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2047 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2048 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2049 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2050 | } 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
|
2051 | 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
|
2052 | media, sess_id, participant); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2053 | 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
|
2054 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2055 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2056 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2057 | return accepted; |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2058 | } |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2059 | |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2060 | void purple_media_mute(PurpleMedia *media, gboolean active) |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2061 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2062 | GList *sessions; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2063 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2064 | 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
|
2065 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2066 | sessions = g_hash_table_get_values(media->priv->sessions); |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2067 | purple_debug_info("media", "Turning mute %s\n", active ? "on" : "off"); |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2068 | |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2069 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2070 | PurpleMediaSession *session = sessions->data; |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2071 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2072 | GstElement *volume = gst_bin_get_by_name( |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2073 | GST_BIN(session->src), |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26112
diff
changeset
|
2074 | "purpleaudioinputvolume"); |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2075 | g_object_set(volume, "mute", active, NULL); |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2076 | } |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2077 | } |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2078 | } |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26102
diff
changeset
|
2079 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2080 | 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
|
2081 | 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
|
2082 | { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2083 | GList *sessions; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2084 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2085 | 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
|
2086 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2087 | if (session_id == NULL) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2088 | sessions = g_hash_table_get_values(media->priv->sessions); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2089 | else |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2090 | sessions = g_list_append(NULL, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2091 | purple_media_get_session(media, session_id)); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2092 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2093 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2094 | PurpleMediaSession *session = sessions->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2095 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2096 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2097 | GstElement *volume = gst_bin_get_by_name( |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2098 | GST_BIN(session->src), |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2099 | "purpleaudioinputvolume"); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2100 | g_object_set(volume, "volume", level, NULL); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2101 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2102 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2103 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2104 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2105 | 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
|
2106 | 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
|
2107 | double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2108 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2109 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2110 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2111 | 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
|
2112 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2113 | streams = purple_media_get_streams(media, |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2114 | session_id, participant); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2115 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2116 | for (; streams; streams = g_list_delete_link(streams, streams)) { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2117 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2118 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2119 | if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO) { |
|
26458
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2120 | GstElement *tee = stream->tee; |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2121 | GstIterator *iter = gst_element_iterate_src_pads(tee); |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2122 | GstPad *sinkpad; |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2123 | while (gst_iterator_next(iter, (gpointer)&sinkpad) |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2124 | == GST_ITERATOR_OK) { |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2125 | GstPad *peer = gst_pad_get_peer(sinkpad); |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2126 | GstElement *volume; |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2127 | |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2128 | if (peer == NULL) { |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2129 | gst_object_unref(sinkpad); |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2130 | continue; |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2131 | } |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2132 | |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2133 | volume = gst_bin_get_by_name(GST_BIN( |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2134 | GST_OBJECT_PARENT(peer)), |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2135 | "purpleaudiooutputvolume"); |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2136 | g_object_set(volume, "volume", level, NULL); |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2137 | gst_object_unref(peer); |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2138 | gst_object_unref(sinkpad); |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2139 | } |
|
a14d8285383c
Have purple_media_set_output_volume handle all sinks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26456
diff
changeset
|
2140 | gst_iterator_free(iter); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2141 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2142 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2143 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2144 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2145 | gulong |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
2146 | 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
|
2147 | 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
|
2148 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2149 | 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
|
2150 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2151 | 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
|
2152 | media, session_id, participant, window_id); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2153 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2154 | |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2155 | void |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2156 | 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
|
2157 | { |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2158 | GList *iter = media->priv->streams; |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2159 | 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
|
2160 | 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
|
2161 | 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
|
2162 | media->priv->manager, media, |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2163 | stream->session->id, stream->participant); |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2164 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2165 | |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2166 | iter = purple_media_get_session_names(media); |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2167 | 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
|
2168 | 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
|
2169 | 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
|
2170 | 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
|
2171 | session_name, NULL); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2172 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2173 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2174 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2175 | GstElement * |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2176 | 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
|
2177 | 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
|
2178 | { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2179 | 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
|
2180 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2181 | if (session_id != NULL && participant == NULL) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2182 | PurpleMediaSession *session = |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2183 | purple_media_get_session(media, session_id); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2184 | return (session != NULL) ? session->tee : NULL; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2185 | } else if (session_id != NULL && participant != NULL) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2186 | PurpleMediaStream *stream = |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2187 | purple_media_get_stream(media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2188 | session_id, participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2189 | return (stream != NULL) ? stream->tee : NULL; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2190 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2191 | g_return_val_if_reached(NULL); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2192 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2193 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
2194 | #endif /* USE_VV */ |