Mercurial > pidgin.yaz
annotate libpurple/media.c @ 26484:081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Thu, 02 Apr 2009 00:11:49 +0000 |
parents | 341864c1d1f9 |
children | f0de2405c2f1 |
rev | line source |
---|---|
25546 | 1 /** |
25552 | 2 * @file media.c Media API |
25546 | 3 * @ingroup core |
25715
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25713
diff
changeset
|
4 */ |
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25713
diff
changeset
|
5 |
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25713
diff
changeset
|
6 /* purple |
25546 | 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 | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
27 #include <string.h> |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
28 |
25552 | 29 #include "internal.h" |
30 | |
25546 | 31 #include "connection.h" |
26431
1ae3af12095a
Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26430
diff
changeset
|
32 #include "marshallers.h" |
25546 | 33 #include "media.h" |
26431
1ae3af12095a
Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26430
diff
changeset
|
34 #include "media-gst.h" |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
35 #include "mediamanager.h" |
26132
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26129
diff
changeset
|
36 #include "network.h" |
25546 | 37 |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
38 #include "debug.h" |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
39 |
25654
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25651
diff
changeset
|
40 #ifdef USE_VV |
25546 | 41 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
42 #include <gst/farsight/fs-conference-iface.h> |
25546 | 43 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
44 /** @copydoc _PurpleMediaSession */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
45 typedef struct _PurpleMediaSession PurpleMediaSession; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
46 /** @copydoc _PurpleMediaStream */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
47 typedef struct _PurpleMediaStream PurpleMediaStream; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
48 |
26481
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
49 /** The media class */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
50 struct _PurpleMediaClass |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
51 { |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
52 GObjectClass parent_class; /**< The parent class. */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
53 }; |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
54 |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
55 /** The media class's private data */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
56 struct _PurpleMedia |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
57 { |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
58 GObject parent; /**< The parent of this object. */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
59 PurpleMediaPrivate *priv; /**< The private data of this object. */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
60 }; |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26475
diff
changeset
|
61 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
62 struct _PurpleMediaSession |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
63 { |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
64 gchar *id; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
65 PurpleMedia *media; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
66 GstElement *src; |
26197
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
67 GstElement *tee; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
68 FsSession *session; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
69 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
70 PurpleMediaSessionType type; |
26466
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
71 gboolean initiator; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
72 }; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
73 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
74 struct _PurpleMediaStream |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
75 { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
76 PurpleMediaSession *session; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
77 gchar *participant; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
78 FsStream *stream; |
26191
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
79 GstElement *src; |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
80 GstElement *tee; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
81 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
82 GList *local_candidates; |
26076
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26071
diff
changeset
|
83 GList *remote_candidates; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
84 |
26466
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
85 gboolean initiator; |
26391
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
86 gboolean accepted; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
87 gboolean candidates_prepared; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
88 |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
89 GList *active_local_candidates; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
90 GList *active_remote_candidates; |
26135
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26134
diff
changeset
|
91 |
26200
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26199
diff
changeset
|
92 guint connected_cb_id; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
93 }; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
94 #endif |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
95 |
25546 | 96 struct _PurpleMediaPrivate |
97 { | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
98 #ifdef USE_VV |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
99 PurpleMediaManager *manager; |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
100 PurpleConnection *pc; |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
101 FsConference *conference; |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
102 gboolean initiator; |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
103 gpointer prpl_data; |
25546 | 104 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
105 GHashTable *sessions; /* PurpleMediaSession table */ |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
106 GHashTable *participants; /* FsParticipant table */ |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
107 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
108 GList *streams; /* PurpleMediaStream table */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
109 |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
110 GstElement *confbin; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
111 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
112 gpointer dummy; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
113 #endif |
25546 | 114 }; |
115 | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
116 #ifdef USE_VV |
25546 | 117 #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) |
118 | |
119 static void purple_media_class_init (PurpleMediaClass *klass); | |
120 static void purple_media_init (PurpleMedia *media); | |
26087
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
121 static void purple_media_dispose (GObject *object); |
25546 | 122 static void purple_media_finalize (GObject *object); |
123 static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
124 static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
125 | |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
126 static void purple_media_new_local_candidate_cb(FsStream *stream, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
127 FsCandidate *local_candidate, PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
128 static void purple_media_candidates_prepared_cb(FsStream *stream, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
129 PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
130 static void purple_media_candidate_pair_established_cb(FsStream *stream, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
131 FsCandidate *native_candidate, FsCandidate *remote_candidate, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
132 PurpleMediaSession *session); |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
133 static gboolean media_bus_call(GstBus *bus, |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
134 GstMessage *msg, PurpleMedia *media); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
135 |
25546 | 136 static GObjectClass *parent_class = NULL; |
137 | |
138 | |
139 | |
140 enum { | |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
141 ERROR, |
26142
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26141
diff
changeset
|
142 ACCEPTED, |
26380
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
143 CANDIDATES_PREPARED, |
26141
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26140
diff
changeset
|
144 CODECS_CHANGED, |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
145 NEW_CANDIDATE, |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
146 STATE_CHANGED, |
26402
8b4394e84633
Add stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26401
diff
changeset
|
147 STREAM_INFO, |
25546 | 148 LAST_SIGNAL |
149 }; | |
150 static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
151 | |
152 enum { | |
153 PROP_0, | |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
154 PROP_MANAGER, |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
155 PROP_CONNECTION, |
26061
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
156 PROP_CONFERENCE, |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
157 PROP_INITIATOR, |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
158 PROP_PRPL_DATA, |
25546 | 159 }; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
160 #endif |
25546 | 161 |
162 GType | |
163 purple_media_get_type() | |
164 { | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
165 #ifdef USE_VV |
25546 | 166 static GType type = 0; |
167 | |
168 if (type == 0) { | |
169 static const GTypeInfo info = { | |
170 sizeof(PurpleMediaClass), | |
171 NULL, | |
172 NULL, | |
173 (GClassInitFunc) purple_media_class_init, | |
174 NULL, | |
175 NULL, | |
176 sizeof(PurpleMedia), | |
177 0, | |
25560
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25552
diff
changeset
|
178 (GInstanceInitFunc) purple_media_init, |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25552
diff
changeset
|
179 NULL |
25546 | 180 }; |
181 type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
182 } | |
183 return type; | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
184 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
185 return G_TYPE_NONE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
186 #endif |
25546 | 187 } |
188 | |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
189 GType |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
190 purple_media_state_changed_get_type() |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
191 { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
192 static GType type = 0; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
193 if (type == 0) { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
194 static const GEnumValue values[] = { |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
195 { PURPLE_MEDIA_STATE_NEW, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
196 "PURPLE_MEDIA_STATE_NEW", "new" }, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
197 { PURPLE_MEDIA_STATE_CONNECTED, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
198 "PURPLE_MEDIA_STATE_CONNECTED", "connected" }, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
199 { PURPLE_MEDIA_STATE_END, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
200 "PURPLE_MEDIA_STATE_END", "end" }, |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
201 { 0, NULL, NULL } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
202 }; |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
203 type = g_enum_register_static("PurpleMediaState", values); |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
204 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
205 return type; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
206 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
207 |
26409
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
208 GType |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
209 purple_media_info_type_get_type() |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
210 { |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
211 static GType type = 0; |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
212 if (type == 0) { |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
213 static const GEnumValue values[] = { |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
214 { PURPLE_MEDIA_INFO_HANGUP, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
215 "PURPLE_MEDIA_INFO_HANGUP", "hangup" }, |
26449
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26448
diff
changeset
|
216 { PURPLE_MEDIA_INFO_ACCEPT, |
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26448
diff
changeset
|
217 "PURPLE_MEDIA_INFO_ACCEPT", "accept" }, |
26409
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
218 { PURPLE_MEDIA_INFO_REJECT, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
219 "PURPLE_MEDIA_INFO_REJECT", "reject" }, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
220 { PURPLE_MEDIA_INFO_MUTE, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
221 "PURPLE_MEDIA_INFO_MUTE", "mute" }, |
26449
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26448
diff
changeset
|
222 { PURPLE_MEDIA_INFO_UNMUTE, |
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26448
diff
changeset
|
223 "PURPLE_MEDIA_INFO_UNMUTE", "unmute" }, |
26409
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
224 { PURPLE_MEDIA_INFO_HOLD, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
225 "PURPLE_MEDIA_INFO_HOLD", "hold" }, |
26449
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26448
diff
changeset
|
226 { PURPLE_MEDIA_INFO_UNHOLD, |
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26448
diff
changeset
|
227 "PURPLE_MEDIA_INFO_HOLD", "unhold" }, |
26409
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
228 { 0, NULL, NULL } |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
229 }; |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26408
diff
changeset
|
230 type = g_enum_register_static("PurpleMediaInfoType", values); |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
231 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
232 return type; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
233 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
234 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
235 #ifdef USE_VV |
25546 | 236 static void |
237 purple_media_class_init (PurpleMediaClass *klass) | |
238 { | |
239 GObjectClass *gobject_class = (GObjectClass*)klass; | |
240 parent_class = g_type_class_peek_parent(klass); | |
241 | |
26087
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
242 gobject_class->dispose = purple_media_dispose; |
25546 | 243 gobject_class->finalize = purple_media_finalize; |
244 gobject_class->set_property = purple_media_set_property; | |
245 gobject_class->get_property = purple_media_get_property; | |
246 | |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
247 g_object_class_install_property(gobject_class, PROP_MANAGER, |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
248 g_param_spec_object("manager", |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
249 "Purple Media Manager", |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
250 "The media manager that contains this media session.", |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
251 PURPLE_TYPE_MEDIA_MANAGER, |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
252 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
253 |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
254 g_object_class_install_property(gobject_class, PROP_CONNECTION, |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
255 g_param_spec_pointer("connection", |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
256 "PurpleConnection", |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
257 "The connection this media session is on.", |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
258 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
259 |
26061
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
260 g_object_class_install_property(gobject_class, PROP_CONFERENCE, |
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
261 g_param_spec_object("conference", |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
262 "Farsight conference", |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
263 "The FsConference associated with this media.", |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
264 FS_TYPE_CONFERENCE, |
26470
de03cce95e17
Make the conference property write only.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26469
diff
changeset
|
265 G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE)); |
25546 | 266 |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
267 g_object_class_install_property(gobject_class, PROP_INITIATOR, |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
268 g_param_spec_boolean("initiator", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
269 "initiator", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
270 "If the local user initiated the conference.", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
271 FALSE, |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
272 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
273 |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
274 g_object_class_install_property(gobject_class, PROP_PRPL_DATA, |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
275 g_param_spec_pointer("prpl-data", |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
276 "gpointer", |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
277 "Data the prpl plugin set on the media session.", |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
278 G_PARAM_READWRITE)); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
279 |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
280 purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
281 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
282 g_cclosure_marshal_VOID__STRING, |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
283 G_TYPE_NONE, 1, G_TYPE_STRING); |
26142
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26141
diff
changeset
|
284 purple_media_signals[ACCEPTED] = g_signal_new("accepted", G_TYPE_FROM_CLASS(klass), |
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26141
diff
changeset
|
285 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26141
diff
changeset
|
286 purple_smarshal_VOID__STRING_STRING, |
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26141
diff
changeset
|
287 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); |
26380
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
288 purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
289 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
290 purple_smarshal_VOID__STRING_STRING, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
291 G_TYPE_NONE, 2, G_TYPE_STRING, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
292 G_TYPE_STRING); |
26141
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26140
diff
changeset
|
293 purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass), |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26140
diff
changeset
|
294 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26140
diff
changeset
|
295 g_cclosure_marshal_VOID__STRING, |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26140
diff
changeset
|
296 G_TYPE_NONE, 1, G_TYPE_STRING); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
297 purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass), |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
298 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
299 purple_smarshal_VOID__POINTER_POINTER_OBJECT, |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
300 G_TYPE_NONE, 3, G_TYPE_POINTER, |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
301 G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
302 purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
303 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
304 purple_smarshal_VOID__ENUM_STRING_STRING, |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
305 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE, |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
306 G_TYPE_STRING, G_TYPE_STRING); |
26402
8b4394e84633
Add stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26401
diff
changeset
|
307 purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass), |
8b4394e84633
Add stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26401
diff
changeset
|
308 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
26448
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
309 purple_smarshal_VOID__ENUM_STRING_STRING_BOOLEAN, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
310 G_TYPE_NONE, 4, PURPLE_MEDIA_TYPE_INFO_TYPE, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
311 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
312 g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
25546 | 313 } |
314 | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
315 |
25546 | 316 static void |
317 purple_media_init (PurpleMedia *media) | |
318 { | |
319 media->priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
26368
d8a7c7d9ac8a
Zero out the proper size for the PurpleMediaPrivate structure.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26216
diff
changeset
|
320 memset(media->priv, 0, sizeof(*media->priv)); |
25546 | 321 } |
322 | |
323 static void | |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
324 purple_media_stream_free(PurpleMediaStream *stream) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
325 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
326 if (stream == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
327 return; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
328 |
26156
1199abde956b
Set the purple_media_connected_cb timeout to a high priority and remove
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26155
diff
changeset
|
329 /* Remove the connected_cb timeout */ |
26200
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26199
diff
changeset
|
330 if (stream->connected_cb_id != 0) |
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26199
diff
changeset
|
331 purple_timeout_remove(stream->connected_cb_id); |
26156
1199abde956b
Set the purple_media_connected_cb timeout to a high priority and remove
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26155
diff
changeset
|
332 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
333 g_free(stream->participant); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
334 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
335 if (stream->local_candidates) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
336 fs_candidate_list_destroy(stream->local_candidates); |
26076
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26071
diff
changeset
|
337 if (stream->remote_candidates) |
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26071
diff
changeset
|
338 fs_candidate_list_destroy(stream->remote_candidates); |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
339 |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
340 if (stream->active_local_candidates) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
341 fs_candidate_list_destroy(stream->active_local_candidates); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
342 if (stream->active_remote_candidates) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
343 fs_candidate_list_destroy(stream->active_remote_candidates); |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
344 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
345 g_free(stream); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
346 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
347 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
348 static void |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
349 purple_media_session_free(PurpleMediaSession *session) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
350 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
351 if (session == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
352 return; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
353 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
354 g_free(session->id); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
355 g_free(session); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
356 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
357 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
358 static void |
26087
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
359 purple_media_dispose(GObject *media) |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
360 { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
361 PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
362 GList *iter = NULL; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
363 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
364 purple_debug_info("media","purple_media_dispose\n"); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
365 |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
366 purple_media_manager_remove_media(priv->manager, PURPLE_MEDIA(media)); |
26087
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
367 |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
368 if (priv->confbin) { |
26388
5906409c4b69
Fix some GStreamer timing issues.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26387
diff
changeset
|
369 gst_element_set_locked_state(priv->confbin, TRUE); |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
370 gst_element_set_state(GST_ELEMENT(priv->confbin), |
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
371 GST_STATE_NULL); |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
372 gst_bin_remove(GST_BIN(purple_media_manager_get_pipeline( |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
373 priv->manager)), priv->confbin); |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
374 priv->confbin = NULL; |
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
375 priv->conference = NULL; |
26087
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
376 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
377 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
378 for (iter = priv->streams; iter; iter = g_list_next(iter)) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
379 PurpleMediaStream *stream = iter->data; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
380 if (stream->stream) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
381 g_object_unref(stream->stream); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
382 stream->stream = NULL; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
383 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
384 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
385 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
386 if (priv->sessions) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
387 GList *sessions = g_hash_table_get_values(priv->sessions); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
388 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
389 PurpleMediaSession *session = sessions->data; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
390 if (session->session) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
391 g_object_unref(session->session); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
392 session->session = NULL; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
393 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
394 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
395 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
396 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
397 if (priv->participants) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
398 GList *participants = g_hash_table_get_values(priv->participants); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
399 for (; participants; participants = g_list_delete_link(participants, participants)) |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
400 g_object_unref(participants->data); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
401 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
402 |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
403 if (priv->manager) { |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
404 GstElement *pipeline = purple_media_manager_get_pipeline( |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
405 priv->manager); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
406 GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
407 g_signal_handlers_disconnect_matched(G_OBJECT(bus), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
408 G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
409 0, 0, 0, media_bus_call, media); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
410 gst_object_unref(bus); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
411 |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
412 g_object_unref(priv->manager); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
413 priv->manager = NULL; |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
414 } |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
415 |
26374 | 416 G_OBJECT_CLASS(parent_class)->dispose(media); |
26087
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
417 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
418 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
419 static void |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
420 purple_media_finalize(GObject *media) |
25546 | 421 { |
25661
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
422 PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
423 purple_debug_info("media","purple_media_finalize\n"); |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
424 |
26057
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26056
diff
changeset
|
425 for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams)) |
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26056
diff
changeset
|
426 purple_media_stream_free(priv->streams->data); |
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26056
diff
changeset
|
427 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
428 if (priv->sessions) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
429 GList *sessions = g_hash_table_get_values(priv->sessions); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
430 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
431 purple_media_session_free(sessions->data); |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
432 } |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
433 g_hash_table_destroy(priv->sessions); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
434 } |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
435 |
26087
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26086
diff
changeset
|
436 G_OBJECT_CLASS(parent_class)->finalize(media); |
25546 | 437 } |
438 | |
439 static void | |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
440 purple_media_setup_pipeline(PurpleMedia *media) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
441 { |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
442 GstBus *bus; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
443 gchar *name; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
444 GstElement *pipeline; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
445 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
446 if (media->priv->conference == NULL || media->priv->manager == NULL) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
447 return; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
448 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
449 pipeline = purple_media_manager_get_pipeline(media->priv->manager); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
450 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
451 name = g_strdup_printf("conf_%p", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
452 media->priv->conference); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
453 media->priv->confbin = gst_bin_new(name); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
454 g_free(name); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
455 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
456 bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
457 g_signal_connect(G_OBJECT(bus), "message", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
458 G_CALLBACK(media_bus_call), media); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
459 gst_object_unref(bus); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
460 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
461 gst_bin_add(GST_BIN(pipeline), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
462 media->priv->confbin); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
463 gst_bin_add(GST_BIN(media->priv->confbin), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
464 GST_ELEMENT(media->priv->conference)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
465 gst_element_set_state(GST_ELEMENT(media->priv->confbin), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
466 GST_STATE_PLAYING); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
467 } |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
468 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
469 static void |
25546 | 470 purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
471 { | |
472 PurpleMedia *media; | |
473 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
474 |
25546 | 475 media = PURPLE_MEDIA(object); |
476 | |
477 switch (prop_id) { | |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
478 case PROP_MANAGER: |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
479 media->priv->manager = g_value_get_object(value); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
480 g_object_ref(media->priv->manager); |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
481 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
482 purple_media_setup_pipeline(media); |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
483 break; |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
484 case PROP_CONNECTION: |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
485 media->priv->pc = g_value_get_pointer(value); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
486 break; |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
487 case PROP_CONFERENCE: { |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
488 if (media->priv->conference) |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
489 gst_object_unref(media->priv->conference); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
490 media->priv->conference = g_value_get_object(value); |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
491 gst_object_ref(media->priv->conference); |
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
492 |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
493 purple_media_setup_pipeline(media); |
25546 | 494 break; |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
495 } |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
496 case PROP_INITIATOR: |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
497 media->priv->initiator = g_value_get_boolean(value); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
498 break; |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
499 case PROP_PRPL_DATA: |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
500 media->priv->prpl_data = g_value_get_pointer(value); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
501 break; |
25546 | 502 default: |
503 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
504 break; | |
505 } | |
506 } | |
507 | |
508 static void | |
509 purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
510 { | |
511 PurpleMedia *media; | |
512 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
513 | |
514 media = PURPLE_MEDIA(object); | |
515 | |
516 switch (prop_id) { | |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
517 case PROP_MANAGER: |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
518 g_value_set_object(value, media->priv->manager); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26185
diff
changeset
|
519 break; |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
520 case PROP_CONNECTION: |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
521 g_value_set_pointer(value, media->priv->pc); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
522 break; |
26061
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
523 case PROP_CONFERENCE: |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
524 g_value_set_object(value, media->priv->conference); |
25546 | 525 break; |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
526 case PROP_INITIATOR: |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
527 g_value_set_boolean(value, media->priv->initiator); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
528 break; |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
529 case PROP_PRPL_DATA: |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
530 g_value_set_pointer(value, media->priv->prpl_data); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
531 break; |
25546 | 532 default: |
533 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
534 break; | |
535 } | |
536 | |
537 } | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
538 #endif |
25546 | 539 |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
540 PurpleMediaCandidate * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
541 purple_media_candidate_new(const gchar *foundation, guint component_id, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
542 PurpleMediaCandidateType type, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
543 PurpleMediaNetworkProtocol proto, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
544 const gchar *ip, guint port) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
545 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
546 PurpleMediaCandidate *candidate = g_new0(PurpleMediaCandidate, 1); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
547 candidate->foundation = g_strdup(foundation); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
548 candidate->component_id = component_id; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
549 candidate->type = type; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
550 candidate->proto = proto; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
551 candidate->ip = g_strdup(ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
552 candidate->port = port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
553 return candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
554 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
555 |
26397
c0499eb4dd4d
Disapprove part of the revision that shouldn't be there.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26396
diff
changeset
|
556 static PurpleMediaCandidate * |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
557 purple_media_candidate_copy(PurpleMediaCandidate *candidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
558 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
559 PurpleMediaCandidate *new_candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
560 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
561 if (candidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
562 return NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
563 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
564 new_candidate = g_new0(PurpleMediaCandidate, 1); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
565 new_candidate->foundation = g_strdup(candidate->foundation); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
566 new_candidate->component_id = candidate->component_id; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
567 new_candidate->ip = g_strdup(candidate->ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
568 new_candidate->port = candidate->port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
569 new_candidate->base_ip = g_strdup(candidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
570 new_candidate->base_port = candidate->base_port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
571 new_candidate->proto = candidate->proto; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
572 new_candidate->priority = candidate->priority; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
573 new_candidate->type = candidate->type; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
574 new_candidate->username = g_strdup(candidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
575 new_candidate->password = g_strdup(candidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
576 new_candidate->ttl = candidate->ttl; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
577 return new_candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
578 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
579 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
580 static void |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
581 purple_media_candidate_free(PurpleMediaCandidate *candidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
582 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
583 if (candidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
584 return; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
585 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
586 g_free((gchar*)candidate->foundation); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
587 g_free((gchar*)candidate->ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
588 g_free((gchar*)candidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
589 g_free((gchar*)candidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
590 g_free((gchar*)candidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
591 g_free(candidate); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
592 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
593 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
594 #ifdef USE_VV |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
595 static FsCandidate * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
596 purple_media_candidate_to_fs(PurpleMediaCandidate *candidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
597 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
598 FsCandidate *fscandidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
599 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
600 if (candidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
601 return NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
602 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
603 fscandidate = fs_candidate_new(candidate->foundation, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
604 candidate->component_id, candidate->type, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
605 candidate->proto, candidate->ip, candidate->port); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
606 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
607 fscandidate->base_ip = g_strdup(candidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
608 fscandidate->base_port = candidate->base_port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
609 fscandidate->priority = candidate->priority; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
610 fscandidate->username = g_strdup(candidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
611 fscandidate->password = g_strdup(candidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
612 fscandidate->ttl = candidate->ttl; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
613 return fscandidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
614 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
615 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
616 static PurpleMediaCandidate * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
617 purple_media_candidate_from_fs(FsCandidate *fscandidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
618 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
619 PurpleMediaCandidate *candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
620 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
621 if (fscandidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
622 return NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
623 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
624 candidate = purple_media_candidate_new(fscandidate->foundation, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
625 fscandidate->component_id, fscandidate->type, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
626 fscandidate->proto, fscandidate->ip, fscandidate->port); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
627 candidate->base_ip = g_strdup(fscandidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
628 candidate->base_port = fscandidate->base_port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
629 candidate->priority = fscandidate->priority; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
630 candidate->username = g_strdup(fscandidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
631 candidate->password = g_strdup(fscandidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
632 candidate->ttl = fscandidate->ttl; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
633 return candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
634 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
635 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
636 static GList * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
637 purple_media_candidate_list_from_fs(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
638 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
639 GList *new_list = NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
640 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
641 for (; candidates; candidates = g_list_next(candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
642 new_list = g_list_prepend(new_list, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
643 purple_media_candidate_from_fs( |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
644 candidates->data)); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
645 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
646 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
647 new_list = g_list_reverse(new_list); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
648 return new_list; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
649 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
650 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
651 static GList * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
652 purple_media_candidate_list_to_fs(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
653 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
654 GList *new_list = NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
655 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
656 for (; candidates; candidates = g_list_next(candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
657 new_list = g_list_prepend(new_list, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
658 purple_media_candidate_to_fs( |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
659 candidates->data)); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
660 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
661 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
662 new_list = g_list_reverse(new_list); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
663 return new_list; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
664 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
665 #endif |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
666 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
667 GList * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
668 purple_media_candidate_list_copy(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
669 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
670 GList *new_list = NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
671 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
672 for (; candidates; candidates = g_list_next(candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
673 new_list = g_list_prepend(new_list, g_boxed_copy( |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
674 PURPLE_TYPE_MEDIA_CANDIDATE, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
675 candidates->data)); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
676 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
677 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
678 new_list = g_list_reverse(new_list); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
679 return new_list; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
680 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
681 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
682 void |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
683 purple_media_candidate_list_free(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
684 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
685 for (; candidates; candidates = |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
686 g_list_delete_link(candidates, candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
687 g_boxed_free(PURPLE_TYPE_MEDIA_CANDIDATE, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
688 candidates->data); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
689 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
690 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
691 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
692 GType |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
693 purple_media_candidate_get_type() |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
694 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
695 static GType type = 0; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
696 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
697 if (type == 0) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
698 type = g_boxed_type_register_static("PurpleMediaCandidate", |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
699 (GBoxedCopyFunc)purple_media_candidate_copy, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
700 (GBoxedFreeFunc)purple_media_candidate_free); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
701 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
702 return type; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
703 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
704 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
705 #ifdef USE_VV |
26099
b6457b2a8e14
Make FsStreamDirection and FsMediaType conversion functions static.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26097
diff
changeset
|
706 static FsMediaType |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
707 purple_media_to_fs_media_type(PurpleMediaSessionType type) |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
708 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
709 if (type & PURPLE_MEDIA_AUDIO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
710 return FS_MEDIA_TYPE_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
711 else if (type & PURPLE_MEDIA_VIDEO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
712 return FS_MEDIA_TYPE_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
713 else |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
714 return 0; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
715 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
716 |
26099
b6457b2a8e14
Make FsStreamDirection and FsMediaType conversion functions static.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26097
diff
changeset
|
717 static FsStreamDirection |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
718 purple_media_to_fs_stream_direction(PurpleMediaSessionType type) |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
719 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
720 if ((type & PURPLE_MEDIA_AUDIO) == PURPLE_MEDIA_AUDIO || |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
721 (type & PURPLE_MEDIA_VIDEO) == PURPLE_MEDIA_VIDEO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
722 return FS_DIRECTION_BOTH; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
723 else if ((type & PURPLE_MEDIA_SEND_AUDIO) || |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
724 (type & PURPLE_MEDIA_SEND_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
725 return FS_DIRECTION_SEND; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
726 else if ((type & PURPLE_MEDIA_RECV_AUDIO) || |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
727 (type & PURPLE_MEDIA_RECV_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
728 return FS_DIRECTION_RECV; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
729 else |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
730 return FS_DIRECTION_NONE; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
731 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
732 |
26099
b6457b2a8e14
Make FsStreamDirection and FsMediaType conversion functions static.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26097
diff
changeset
|
733 static PurpleMediaSessionType |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
734 purple_media_from_fs(FsMediaType type, FsStreamDirection direction) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
735 { |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
736 PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
737 if (type == FS_MEDIA_TYPE_AUDIO) { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
738 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
739 result |= PURPLE_MEDIA_SEND_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
740 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
741 result |= PURPLE_MEDIA_RECV_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
742 } else if (type == FS_MEDIA_TYPE_VIDEO) { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
743 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
744 result |= PURPLE_MEDIA_SEND_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
745 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
746 result |= PURPLE_MEDIA_RECV_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
747 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
748 return result; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
749 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
750 #endif |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
751 |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
752 void |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
753 purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
754 const gchar *name, const gchar *value) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
755 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
756 PurpleMediaCodecParameter *new_param; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
757 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
758 g_return_if_fail(codec != NULL); |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
759 g_return_if_fail(name != NULL && value != NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
760 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
761 new_param = g_new0(PurpleMediaCodecParameter, 1); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
762 new_param->name = g_strdup(name); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
763 new_param->value = g_strdup(value); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
764 codec->optional_params = g_list_append( |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
765 codec->optional_params, new_param); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
766 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
767 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
768 void |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
769 purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
770 PurpleMediaCodecParameter *param) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
771 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
772 g_return_if_fail(codec != NULL && param != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
773 |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
774 g_free(param->name); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
775 g_free(param->value); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
776 g_free(param); |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
777 |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
778 codec->optional_params = |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
779 g_list_remove(codec->optional_params, param); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
780 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
781 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
782 PurpleMediaCodecParameter * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
783 purple_media_codec_get_optional_parameter(PurpleMediaCodec *codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
784 const gchar *name, const gchar *value) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
785 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
786 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
787 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
788 g_return_val_if_fail(codec != NULL, NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
789 g_return_val_if_fail(name != NULL, NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
790 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
791 for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
792 PurpleMediaCodecParameter *param = iter->data; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
793 if (!g_ascii_strcasecmp(param->name, name) && |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
794 (value == NULL || |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
795 !g_ascii_strcasecmp(param->value, value))) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
796 return param; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
797 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
798 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
799 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
800 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
801 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
802 PurpleMediaCodec * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
803 purple_media_codec_new(int id, const char *encoding_name, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
804 PurpleMediaSessionType media_type, guint clock_rate) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
805 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
806 PurpleMediaCodec *codec = g_new0(PurpleMediaCodec, 1); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
807 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
808 codec->id = id; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
809 codec->encoding_name = g_strdup(encoding_name); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
810 codec->media_type = media_type; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
811 codec->clock_rate = clock_rate; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
812 return codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
813 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
814 |
26397
c0499eb4dd4d
Disapprove part of the revision that shouldn't be there.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26396
diff
changeset
|
815 static PurpleMediaCodec * |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
816 purple_media_codec_copy(PurpleMediaCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
817 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
818 PurpleMediaCodec *new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
819 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
820 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
821 if (codec == NULL) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
822 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
823 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
824 new_codec = purple_media_codec_new(codec->id, codec->encoding_name, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
825 codec->media_type, codec->clock_rate); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
826 new_codec->channels = codec->channels; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
827 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
828 for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
829 PurpleMediaCodecParameter *param = |
26109
5275c7ef9edf
Manipulate optional parameters properly.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26108
diff
changeset
|
830 (PurpleMediaCodecParameter*)iter->data; |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
831 purple_media_codec_add_optional_parameter(new_codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
832 param->name, param->value); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
833 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
834 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
835 return new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
836 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
837 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
838 static void |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
839 purple_media_codec_free(PurpleMediaCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
840 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
841 if (codec == NULL) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
842 return; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
843 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
844 g_free(codec->encoding_name); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
845 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
846 for (; codec->optional_params; codec->optional_params = |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
847 g_list_delete_link(codec->optional_params, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
848 codec->optional_params)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
849 purple_media_codec_remove_optional_parameter(codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
850 codec->optional_params->data); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
851 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
852 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
853 g_free(codec); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
854 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
855 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
856 #ifdef USE_VV |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
857 static FsCodec * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
858 purple_media_codec_to_fs(const PurpleMediaCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
859 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
860 FsCodec *new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
861 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
862 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
863 if (codec == NULL) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
864 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
865 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
866 new_codec = fs_codec_new(codec->id, codec->encoding_name, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
867 purple_media_to_fs_media_type(codec->media_type), |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
868 codec->clock_rate); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
869 new_codec->channels = codec->channels; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
870 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
871 for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
872 PurpleMediaCodecParameter *param = |
26109
5275c7ef9edf
Manipulate optional parameters properly.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26108
diff
changeset
|
873 (PurpleMediaCodecParameter*)iter->data; |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
874 fs_codec_add_optional_parameter(new_codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
875 param->name, param->value); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
876 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
877 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
878 return new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
879 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
880 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
881 static PurpleMediaCodec * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
882 purple_media_codec_from_fs(const FsCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
883 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
884 PurpleMediaCodec *new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
885 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
886 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
887 if (codec == NULL) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
888 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
889 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
890 new_codec = purple_media_codec_new(codec->id, codec->encoding_name, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
891 purple_media_from_fs(codec->media_type, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
892 FS_DIRECTION_BOTH), codec->clock_rate); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
893 new_codec->channels = codec->channels; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
894 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
895 for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
26109
5275c7ef9edf
Manipulate optional parameters properly.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26108
diff
changeset
|
896 FsCodecParameter *param = (FsCodecParameter*)iter->data; |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
897 purple_media_codec_add_optional_parameter(new_codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
898 param->name, param->value); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
899 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
900 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
901 return new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
902 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
903 #endif |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
904 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
905 gchar * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
906 purple_media_codec_to_string(const PurpleMediaCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
907 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
908 #ifdef USE_VV |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
909 FsCodec *fscodec = purple_media_codec_to_fs(codec); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
910 gchar *str = fs_codec_to_string(fscodec); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
911 fs_codec_destroy(fscodec); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
912 return str; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
913 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
914 return g_strdup(""); |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
915 #endif |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
916 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
917 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
918 #ifdef USE_VV |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
919 static GList * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
920 purple_media_codec_list_from_fs(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
921 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
922 GList *new_list = NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
923 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
924 for (; codecs; codecs = g_list_next(codecs)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
925 new_list = g_list_prepend(new_list, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
926 purple_media_codec_from_fs( |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
927 codecs->data)); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
928 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
929 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
930 new_list = g_list_reverse(new_list); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
931 return new_list; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
932 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
933 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
934 static GList * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
935 purple_media_codec_list_to_fs(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
936 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
937 GList *new_list = NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
938 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
939 for (; codecs; codecs = g_list_next(codecs)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
940 new_list = g_list_prepend(new_list, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
941 purple_media_codec_to_fs( |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
942 codecs->data)); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
943 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
944 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
945 new_list = g_list_reverse(new_list); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
946 return new_list; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
947 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
948 #endif |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
949 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
950 GList * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
951 purple_media_codec_list_copy(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
952 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
953 GList *new_list = NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
954 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
955 for (; codecs; codecs = g_list_next(codecs)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
956 new_list = g_list_prepend(new_list, g_boxed_copy( |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
957 PURPLE_TYPE_MEDIA_CODEC, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
958 codecs->data)); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
959 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
960 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
961 new_list = g_list_reverse(new_list); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
962 return new_list; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
963 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
964 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
965 void |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
966 purple_media_codec_list_free(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
967 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
968 for (; codecs; codecs = |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
969 g_list_delete_link(codecs, codecs)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
970 g_boxed_free(PURPLE_TYPE_MEDIA_CODEC, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
971 codecs->data); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
972 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
973 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
974 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
975 GType |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
976 purple_media_codec_get_type() |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
977 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
978 static GType type = 0; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
979 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
980 if (type == 0) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
981 type = g_boxed_type_register_static("PurpleMediaCodec", |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
982 (GBoxedCopyFunc)purple_media_codec_copy, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
983 (GBoxedFreeFunc)purple_media_codec_free); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
984 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
985 return type; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
986 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
987 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
988 #ifdef USE_VV |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
989 static PurpleMediaSession* |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
990 purple_media_get_session(PurpleMedia *media, const gchar *sess_id) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
991 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
992 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
993 return (PurpleMediaSession*) (media->priv->sessions) ? |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
994 g_hash_table_lookup(media->priv->sessions, sess_id) : NULL; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
995 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
996 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
997 static FsParticipant* |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
998 purple_media_get_participant(PurpleMedia *media, const gchar *name) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
999 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1000 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1001 return (FsParticipant*) (media->priv->participants) ? |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1002 g_hash_table_lookup(media->priv->participants, name) : NULL; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1003 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1004 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1005 static PurpleMediaStream* |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1006 purple_media_get_stream(PurpleMedia *media, const gchar *session, const gchar *participant) |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1007 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1008 GList *streams; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1009 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1010 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1011 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1012 streams = media->priv->streams; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1013 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1014 for (; streams; streams = g_list_next(streams)) { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1015 PurpleMediaStream *stream = streams->data; |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1016 if (!strcmp(stream->session->id, session) && |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1017 !strcmp(stream->participant, participant)) |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1018 return stream; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1019 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1020 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1021 return NULL; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1022 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1023 |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1024 static GList * |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1025 purple_media_get_streams(PurpleMedia *media, const gchar *session, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1026 const gchar *participant) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1027 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1028 GList *streams; |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1029 GList *ret = NULL; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1030 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1031 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1032 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1033 streams = media->priv->streams; |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1034 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1035 for (; streams; streams = g_list_next(streams)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1036 PurpleMediaStream *stream = streams->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1037 if ((session == NULL || |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1038 !strcmp(stream->session->id, session)) && |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1039 (participant == NULL || |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1040 !strcmp(stream->participant, participant))) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1041 ret = g_list_append(ret, stream); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1042 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1043 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1044 return ret; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1045 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1046 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1047 static void |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1048 purple_media_add_session(PurpleMedia *media, PurpleMediaSession *session) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1049 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1050 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1051 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1052 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1053 if (!media->priv->sessions) { |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1054 purple_debug_info("media", "Creating hash table for sessions\n"); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1055 media->priv->sessions = g_hash_table_new(g_str_hash, g_str_equal); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1056 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1057 g_hash_table_insert(media->priv->sessions, g_strdup(session->id), session); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1058 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1059 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1060 static gboolean |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1061 purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1062 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1063 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1064 return g_hash_table_remove(media->priv->sessions, session->id); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1065 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1066 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1067 static FsParticipant * |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1068 purple_media_add_participant(PurpleMedia *media, const gchar *name) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1069 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1070 FsParticipant *participant; |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1071 GError *err = NULL; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1072 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1073 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1074 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1075 participant = purple_media_get_participant(media, name); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1076 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1077 if (participant) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1078 return participant; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1079 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1080 participant = fs_conference_new_participant(media->priv->conference, |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1081 (gchar*)name, &err); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1082 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1083 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1084 purple_debug_error("media", "Error creating participant: %s\n", |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1085 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1086 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1087 return NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1088 } |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1089 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1090 if (!media->priv->participants) { |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1091 purple_debug_info("media", "Creating hash table for participants\n"); |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1092 media->priv->participants = g_hash_table_new_full(g_str_hash, |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1093 g_str_equal, g_free, NULL); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1094 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1095 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1096 g_hash_table_insert(media->priv->participants, g_strdup(name), participant); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1097 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1098 return participant; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1099 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1100 |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1101 static PurpleMediaStream * |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1102 purple_media_insert_stream(PurpleMediaSession *session, const gchar *name, FsStream *stream) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1103 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1104 PurpleMediaStream *media_stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1105 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1106 g_return_val_if_fail(session != NULL, NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1107 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1108 media_stream = g_new0(PurpleMediaStream, 1); |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1109 media_stream->stream = stream; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1110 media_stream->participant = g_strdup(name); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1111 media_stream->session = session; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1112 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1113 session->media->priv->streams = |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
1114 g_list_append(session->media->priv->streams, media_stream); |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1115 |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1116 return media_stream; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1117 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1118 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1119 static void |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1120 purple_media_insert_local_candidate(PurpleMediaSession *session, const gchar *name, |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1121 FsCandidate *candidate) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1122 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1123 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1124 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1125 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1126 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1127 stream = purple_media_get_stream(session->media, session->id, name); |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1128 stream->local_candidates = g_list_append(stream->local_candidates, candidate); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1129 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1130 #endif |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1131 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1132 GList * |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1133 purple_media_get_session_names(PurpleMedia *media) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1134 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1135 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1136 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
26208 | 1137 return media->priv->sessions != NULL ? |
1138 g_hash_table_get_keys(media->priv->sessions) : NULL; | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1139 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1140 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1141 #endif |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1142 } |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1143 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1144 #ifdef USE_VV |
26414
89002b47a0df
Remove purple_media_set_src/sink from the public API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26413
diff
changeset
|
1145 static void |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1146 purple_media_set_src(PurpleMedia *media, const gchar *sess_id, GstElement *src) |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1147 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1148 PurpleMediaSession *session; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1149 GstPad *sinkpad; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1150 GstPad *srcpad; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1151 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1152 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
26471
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1153 g_return_if_fail(GST_IS_ELEMENT(src)); |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1154 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1155 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1156 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1157 if (session == NULL) { |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1158 purple_debug_warning("media", "purple_media_set_src: trying" |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1159 " to set src on non-existent session\n"); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1160 return; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1161 } |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1162 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1163 if (session->src) |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1164 gst_object_unref(session->src); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1165 session->src = src; |
26388
5906409c4b69
Fix some GStreamer timing issues.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26387
diff
changeset
|
1166 gst_element_set_locked_state(session->src, TRUE); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1167 |
26197
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
1168 session->tee = gst_element_factory_make("tee", NULL); |
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
1169 gst_bin_add(GST_BIN(session->media->priv->confbin), session->tee); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1170 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1171 /* This supposedly isn't necessary, but it silences some warnings */ |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1172 if (GST_ELEMENT_PARENT(session->media->priv->confbin) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1173 == GST_ELEMENT_PARENT(session->src)) { |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1174 GstPad *pad = gst_element_get_static_pad(session->tee, "sink"); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1175 GstPad *ghost = gst_ghost_pad_new(NULL, pad); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1176 gst_object_unref(pad); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1177 gst_pad_set_active(ghost, TRUE); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1178 gst_element_add_pad(session->media->priv->confbin, ghost); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1179 } |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1180 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1181 gst_element_link(session->src, session->media->priv->confbin); |
26197
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
1182 gst_element_set_state(session->tee, GST_STATE_PLAYING); |
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
1183 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1184 g_object_get(session->session, "sink-pad", &sinkpad, NULL); |
26197
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
1185 srcpad = gst_element_get_request_pad(session->tee, "src%d"); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1186 purple_debug_info("media", "connecting pad: %s\n", |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1187 gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1188 ? "success" : "failure"); |
26388
5906409c4b69
Fix some GStreamer timing issues.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26387
diff
changeset
|
1189 gst_element_set_locked_state(session->src, FALSE); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26454
diff
changeset
|
1190 gst_object_unref(session->src); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1191 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1192 #endif |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1193 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1194 GstElement * |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1195 purple_media_get_src(PurpleMedia *media, const gchar *sess_id) |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1196 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1197 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1198 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1199 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1200 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1201 return (session != NULL) ? session->src : NULL; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1202 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1203 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1204 #endif |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1205 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1206 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1207 #ifdef USE_VV |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1208 static PurpleMediaSession * |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1209 purple_media_session_from_fs_stream(PurpleMedia *media, FsStream *stream) |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1210 { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1211 FsSession *fssession; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1212 GList *values; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1213 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1214 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1215 g_return_val_if_fail(FS_IS_STREAM(stream), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1216 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1217 g_object_get(stream, "session", &fssession, NULL); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1218 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1219 values = g_hash_table_get_values(media->priv->sessions); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1220 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1221 for (; values; values = g_list_delete_link(values, values)) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1222 PurpleMediaSession *session = values->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1223 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1224 if (session->session == fssession) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1225 g_list_free(values); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1226 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1227 return session; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1228 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1229 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1230 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1231 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1232 return NULL; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1233 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1234 |
25692
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1235 static gboolean |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
1236 media_bus_call(GstBus *bus, GstMessage *msg, PurpleMedia *media) |
25692
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1237 { |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1238 switch(GST_MESSAGE_TYPE(msg)) { |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1239 case GST_MESSAGE_ELEMENT: { |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
1240 if (!FS_IS_CONFERENCE(GST_MESSAGE_SRC(msg)) || |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
1241 !PURPLE_IS_MEDIA(media) || |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
1242 media->priv->conference != |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
1243 FS_CONFERENCE(GST_MESSAGE_SRC(msg))) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26191
diff
changeset
|
1244 break; |
26152
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26146
diff
changeset
|
1245 |
25692
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1246 if (gst_structure_has_name(msg->structure, "farsight-error")) { |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1247 FsError error_no; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1248 gst_structure_get_enum(msg->structure, "error-no", |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1249 FS_TYPE_ERROR, (gint*)&error_no); |
26008
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
1250 /* |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
1251 * Unknown CName is only a problem for the |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
1252 * multicast transmitter which isn't used. |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
1253 */ |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
1254 if (error_no != FS_ERROR_UNKNOWN_CNAME) |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
1255 purple_debug_error("media", "farsight-error: %i: %s\n", error_no, |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
1256 gst_structure_get_string(msg->structure, "error-msg")); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1257 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1258 "farsight-new-local-candidate")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1259 FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1260 FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "candidate")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1261 PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1262 purple_media_new_local_candidate_cb(stream, local_candidate, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1263 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1264 "farsight-local-candidates-prepared")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1265 FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1266 PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1267 purple_media_candidates_prepared_cb(stream, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1268 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1269 "farsight-new-active-candidate-pair")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1270 FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1271 FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "local-candidate")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1272 FsCandidate *remote_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "remote-candidate")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1273 PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1274 purple_media_candidate_pair_established_cb(stream, local_candidate, remote_candidate, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1275 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1276 "farsight-recv-codecs-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1277 GList *codecs = g_value_get_boxed(gst_structure_get_value(msg->structure, "codecs")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1278 FsCodec *codec = codecs->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1279 purple_debug_info("media", "farsight-recv-codecs-changed: %s\n", codec->encoding_name); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1280 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1281 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1282 "farsight-component-state-changed")) { |
26173
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1283 FsStreamState fsstate = g_value_get_enum(gst_structure_get_value(msg->structure, "state")); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1284 guint component = g_value_get_uint(gst_structure_get_value(msg->structure, "component")); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1285 const gchar *state; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1286 switch (fsstate) { |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1287 case FS_STREAM_STATE_FAILED: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1288 state = "FAILED"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1289 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1290 case FS_STREAM_STATE_DISCONNECTED: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1291 state = "DISCONNECTED"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1292 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1293 case FS_STREAM_STATE_GATHERING: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1294 state = "GATHERING"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1295 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1296 case FS_STREAM_STATE_CONNECTING: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1297 state = "CONNECTING"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1298 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1299 case FS_STREAM_STATE_CONNECTED: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1300 state = "CONNECTED"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1301 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1302 case FS_STREAM_STATE_READY: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1303 state = "READY"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1304 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1305 default: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1306 state = "UNKNOWN"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1307 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1308 } |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1309 purple_debug_info("media", "farsight-component-state-changed: component: %u state: %s\n", component, state); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1310 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1311 "farsight-send-codec-changed")) { |
26173
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1312 FsCodec *codec = g_value_get_boxed(gst_structure_get_value(msg->structure, "codec")); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1313 gchar *codec_str = fs_codec_to_string(codec); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1314 purple_debug_info("media", "farsight-send-codec-changed: codec: %s\n", codec_str); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26172
diff
changeset
|
1315 g_free(codec_str); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1316 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1317 "farsight-codecs-changed")) { |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1318 GList *sessions = g_hash_table_get_values(PURPLE_MEDIA(media)->priv->sessions); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1319 FsSession *fssession = g_value_get_object(gst_structure_get_value(msg->structure, "session")); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1320 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1321 PurpleMediaSession *session = sessions->data; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1322 if (session->session == fssession) { |
26398
bd9fa96c47dc
Remove the ready-new signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26396
diff
changeset
|
1323 gchar *session_id = g_strdup(session->id); |
26141
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26140
diff
changeset
|
1324 g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, session_id); |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26140
diff
changeset
|
1325 g_free(session_id); |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1326 g_list_free(sessions); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1327 break; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1328 } |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1329 } |
25692
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1330 } |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1331 break; |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1332 } |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1333 default: |
25732
d6bda7b63eac
Remove a bunch of extraneous GstBus messages from the debug output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25731
diff
changeset
|
1334 break; |
25692
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1335 } |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1336 |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1337 return TRUE; |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1338 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1339 #endif |
25692
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25687
diff
changeset
|
1340 |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1341 PurpleConnection * |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1342 purple_media_get_connection(PurpleMedia *media) |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1343 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1344 #ifdef USE_VV |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1345 PurpleConnection *pc; |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1346 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1347 g_object_get(G_OBJECT(media), "connection", &pc, NULL); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1348 return pc; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1349 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1350 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1351 #endif |
26203
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1352 } |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26200
diff
changeset
|
1353 |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1354 gpointer |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1355 purple_media_get_prpl_data(PurpleMedia *media) |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1356 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1357 #ifdef USE_VV |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1358 gpointer prpl_data; |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1359 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1360 g_object_get(G_OBJECT(media), "prpl-data", &prpl_data, NULL); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1361 return prpl_data; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1362 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1363 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1364 #endif |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1365 } |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1366 |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1367 void |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1368 purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data) |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1369 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1370 #ifdef USE_VV |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1371 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1372 g_object_set(G_OBJECT(media), "prpl-data", prpl_data, NULL); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1373 #endif |
26204
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1374 } |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
1375 |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1376 void |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1377 purple_media_error(PurpleMedia *media, const gchar *error, ...) |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1378 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1379 #ifdef USE_VV |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1380 va_list args; |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1381 gchar *message; |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1382 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1383 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1384 |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1385 va_start(args, error); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1386 message = g_strdup_vprintf(error, args); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1387 va_end(args); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1388 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1389 purple_debug_error("media", "%s\n", message); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1390 g_signal_emit(media, purple_media_signals[ERROR], 0, message); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1391 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1392 g_free(message); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1393 #endif |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1394 } |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1395 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1396 void |
26140
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26139
diff
changeset
|
1397 purple_media_end(PurpleMedia *media, |
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26139
diff
changeset
|
1398 const gchar *session_id, const gchar *participant) |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1399 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1400 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1401 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
26145
685c8f5f85c7
Separate PidginMedia from PidginConversation.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26143
diff
changeset
|
1402 if (session_id == NULL && participant == NULL) { |
26140
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26139
diff
changeset
|
1403 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
1404 0, PURPLE_MEDIA_STATE_END, |
26140
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26139
diff
changeset
|
1405 NULL, NULL); |
26145
685c8f5f85c7
Separate PidginMedia from PidginConversation.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26143
diff
changeset
|
1406 g_object_unref(media); |
685c8f5f85c7
Separate PidginMedia from PidginConversation.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26143
diff
changeset
|
1407 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1408 #endif |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1409 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
1410 |
26448
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1411 void |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1412 purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1413 const gchar *session_id, const gchar *participant, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1414 gboolean local) |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1415 { |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1416 #ifdef USE_VV |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1417 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1418 |
26450
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1419 if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1420 GList *streams; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1421 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1422 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1423 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1424 streams = purple_media_get_streams(media, |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1425 session_id, participant); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1426 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1427 for (; streams; streams = |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1428 g_list_delete_link(streams, streams)) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1429 PurpleMediaStream *stream = streams->data; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1430 g_object_set(G_OBJECT(stream->stream), "direction", |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1431 purple_media_to_fs_stream_direction( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1432 stream->session->type), NULL); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1433 stream->accepted = TRUE; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1434 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1435 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1436 g_signal_emit(media, purple_media_signals[ACCEPTED], |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1437 0, NULL, NULL); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1438 } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE || |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1439 type == PURPLE_MEDIA_INFO_UNMUTE)) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1440 GList *sessions; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1441 gboolean active = (type == PURPLE_MEDIA_INFO_MUTE); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1442 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1443 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
26448
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1444 |
26450
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1445 if (session_id == NULL) |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1446 sessions = g_hash_table_get_values( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1447 media->priv->sessions); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1448 else |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1449 sessions = g_list_prepend(NULL, |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1450 purple_media_get_session( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1451 media, session_id)); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1452 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1453 purple_debug_info("media", "Turning mute %s\n", |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1454 active ? "on" : "off"); |
26448
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1455 |
26450
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1456 for (; sessions; sessions = g_list_delete_link( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1457 sessions, sessions)) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1458 PurpleMediaSession *session = sessions->data; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1459 if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1460 GstElement *volume = gst_bin_get_by_name( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1461 GST_BIN(session->src), |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1462 "purpleaudioinputvolume"); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1463 g_object_set(volume, "mute", active, NULL); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1464 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1465 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1466 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1467 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1468 g_signal_emit(media, purple_media_signals[STREAM_INFO], |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1469 0, type, session_id, participant, local); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1470 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1471 if (type == PURPLE_MEDIA_INFO_HANGUP || |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1472 type == PURPLE_MEDIA_INFO_REJECT) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26449
diff
changeset
|
1473 purple_media_end(media, session_id, participant); |
26448
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1474 } |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1475 #endif |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1476 } |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26442
diff
changeset
|
1477 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1478 #ifdef USE_VV |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1479 static void |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1480 purple_media_new_local_candidate_cb(FsStream *stream, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1481 FsCandidate *local_candidate, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1482 PurpleMediaSession *session) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1483 { |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1484 gchar *name; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1485 FsParticipant *participant; |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
1486 PurpleMediaCandidate *candidate; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1487 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1488 g_return_if_fail(FS_IS_STREAM(stream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1489 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1490 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1491 purple_debug_info("media", "got new local candidate: %s\n", local_candidate->foundation); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1492 g_object_get(stream, "participant", &participant, NULL); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1493 g_object_get(participant, "cname", &name, NULL); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1494 g_object_unref(participant); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1495 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1496 purple_media_insert_local_candidate(session, name, fs_candidate_copy(local_candidate)); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1497 |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
1498 candidate = purple_media_candidate_from_fs(local_candidate); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1499 g_signal_emit(session->media, purple_media_signals[NEW_CANDIDATE], |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1500 0, session->id, name, candidate); |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
1501 purple_media_candidate_free(candidate); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1502 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1503 g_free(name); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1504 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1505 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1506 static void |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1507 purple_media_candidates_prepared_cb(FsStream *stream, PurpleMediaSession *session) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1508 { |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1509 gchar *name; |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1510 FsParticipant *participant; |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1511 PurpleMediaStream *stream_data; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1512 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1513 g_return_if_fail(FS_IS_STREAM(stream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1514 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1515 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1516 g_object_get(stream, "participant", &participant, NULL); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1517 g_object_get(participant, "cname", &name, NULL); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1518 g_object_unref(participant); |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1519 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1520 stream_data = purple_media_get_stream(session->media, session->id, name); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1521 stream_data->candidates_prepared = TRUE; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1522 |
26380
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
1523 g_signal_emit(session->media, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
1524 purple_media_signals[CANDIDATES_PREPARED], |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
1525 0, session->id, name); |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26374
diff
changeset
|
1526 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1527 g_free(name); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1528 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1529 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1530 /* callback called when a pair of transport candidates (local and remote) |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1531 * has been established */ |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1532 static void |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1533 purple_media_candidate_pair_established_cb(FsStream *fsstream, |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1534 FsCandidate *native_candidate, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1535 FsCandidate *remote_candidate, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1536 PurpleMediaSession *session) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1537 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1538 gchar *name; |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1539 FsParticipant *participant; |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1540 PurpleMediaStream *stream; |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1541 GList *iter; |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1542 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1543 g_return_if_fail(FS_IS_STREAM(fsstream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1544 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1545 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1546 g_object_get(fsstream, "participant", &participant, NULL); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1547 g_object_get(participant, "cname", &name, NULL); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1548 g_object_unref(participant); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1549 |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1550 stream = purple_media_get_stream(session->media, session->id, name); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1551 |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1552 iter = stream->active_local_candidates; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1553 for(; iter; iter = g_list_next(iter)) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1554 FsCandidate *c = iter->data; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1555 if (native_candidate->component_id == c->component_id) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1556 fs_candidate_destroy(c); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1557 stream->active_local_candidates = |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1558 g_list_delete_link(iter, iter); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1559 stream->active_local_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1560 stream->active_local_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1561 fs_candidate_copy(native_candidate)); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1562 break; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1563 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1564 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1565 if (iter == NULL) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1566 stream->active_local_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1567 stream->active_local_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1568 fs_candidate_copy(native_candidate)); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1569 |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1570 iter = stream->active_remote_candidates; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1571 for(; iter; iter = g_list_next(iter)) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1572 FsCandidate *c = iter->data; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1573 if (native_candidate->component_id == c->component_id) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1574 fs_candidate_destroy(c); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1575 stream->active_remote_candidates = |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1576 g_list_delete_link(iter, iter); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1577 stream->active_remote_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1578 stream->active_remote_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1579 fs_candidate_copy(remote_candidate)); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1580 break; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1581 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1582 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1583 if (iter == NULL) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1584 stream->active_remote_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1585 stream->active_remote_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1586 fs_candidate_copy(remote_candidate)); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1587 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1588 purple_debug_info("media", "candidate pair established\n"); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1589 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1590 |
26108
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1591 static gboolean |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1592 purple_media_connected_cb(PurpleMediaStream *stream) |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1593 { |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1594 g_return_val_if_fail(stream != NULL, FALSE); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1595 |
26200
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26199
diff
changeset
|
1596 stream->connected_cb_id = 0; |
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26199
diff
changeset
|
1597 |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1598 purple_media_manager_create_output_window( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1599 stream->session->media->priv->manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1600 stream->session->media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1601 stream->session->id, stream->participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1602 |
26108
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1603 g_signal_emit(stream->session->media, |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1604 purple_media_signals[STATE_CHANGED], |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
1605 0, PURPLE_MEDIA_STATE_CONNECTED, |
26108
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1606 stream->session->id, stream->participant); |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1607 return FALSE; |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1608 } |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1609 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1610 static void |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1611 purple_media_src_pad_added_cb(FsStream *fsstream, GstPad *srcpad, |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1612 FsCodec *codec, PurpleMediaStream *stream) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1613 { |
26191
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1614 PurpleMediaPrivate *priv; |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1615 GstPad *sinkpad; |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1616 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1617 g_return_if_fail(FS_IS_STREAM(fsstream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1618 g_return_if_fail(stream != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1619 |
26191
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1620 priv = stream->session->media->priv; |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1621 |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1622 if (stream->src == NULL) { |
26216 | 1623 GstElement *sink = NULL; |
26191
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1624 |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1625 if (codec->media_type == FS_MEDIA_TYPE_AUDIO) { |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1626 /* |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1627 * Should this instead be: |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1628 * audioconvert ! audioresample ! liveadder ! |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1629 * audioresample ! audioconvert ! realsink |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1630 */ |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1631 stream->src = gst_element_factory_make( |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1632 "liveadder", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1633 sink = purple_media_manager_get_element(priv->manager, |
26474
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26471
diff
changeset
|
1634 PURPLE_MEDIA_RECV_AUDIO, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26471
diff
changeset
|
1635 stream->session->media, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26471
diff
changeset
|
1636 stream->session->id, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26471
diff
changeset
|
1637 stream->participant); |
26191
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1638 } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) { |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1639 stream->src = gst_element_factory_make( |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1640 "fsfunnel", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1641 sink = gst_element_factory_make( |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1642 "fakesink", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1643 g_object_set(G_OBJECT(sink), "async", FALSE, NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1644 } |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1645 stream->tee = gst_element_factory_make("tee", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1646 gst_bin_add_many(GST_BIN(priv->confbin), |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1647 stream->src, stream->tee, sink, NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1648 gst_element_sync_state_with_parent(sink); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1649 gst_element_sync_state_with_parent(stream->tee); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1650 gst_element_sync_state_with_parent(stream->src); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1651 gst_element_link_many(stream->src, stream->tee, sink, NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1652 } |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1653 |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1654 sinkpad = gst_element_get_request_pad(stream->src, "sink%d"); |
26108
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26106
diff
changeset
|
1655 gst_pad_link(srcpad, sinkpad); |
26191
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1656 gst_object_unref(sinkpad); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
1657 |
26200
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26199
diff
changeset
|
1658 stream->connected_cb_id = purple_timeout_add(0, |
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26199
diff
changeset
|
1659 (GSourceFunc)purple_media_connected_cb, stream); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1660 } |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1661 #endif /* USE_VV */ |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1662 |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1663 gboolean |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1664 purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1665 const gchar *who, PurpleMediaSessionType type, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1666 gboolean initiator, const gchar *transmitter, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1667 guint num_params, GParameter *params) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1668 { |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1669 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1670 PurpleMediaSession *session; |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1671 FsParticipant *participant = NULL; |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1672 PurpleMediaStream *stream = NULL; |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1673 FsMediaType media_type = purple_media_to_fs_media_type(type); |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1674 FsStreamDirection type_direction = |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1675 purple_media_to_fs_stream_direction(type); |
26387
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26380
diff
changeset
|
1676 gboolean is_nice = !strcmp(transmitter, "nice"); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1677 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1678 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1679 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1680 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1681 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1682 if (!session) { |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1683 GError *err = NULL; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1684 GList *codec_conf = NULL; |
26024
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1685 gchar *filename = NULL; |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1686 PurpleMediaSessionType session_type; |
26471
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1687 GstElement *src = NULL; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1688 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1689 session = g_new0(PurpleMediaSession, 1); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1690 |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1691 session->session = fs_conference_new_session( |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1692 media->priv->conference, media_type, &err); |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1693 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1694 if (err != NULL) { |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1695 purple_media_error(media, "Error creating session: %s\n", err->message); |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1696 g_error_free(err); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1697 g_free(session); |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1698 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1699 } |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1700 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1701 /* XXX: SPEEX has a latency of 5 or 6 seconds for me */ |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1702 #if 0 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1703 /* SPEEX is added through the configuration */ |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1704 codec_conf = g_list_prepend(codec_conf, fs_codec_new(FS_CODEC_ID_ANY, |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1705 "SPEEX", FS_MEDIA_TYPE_AUDIO, 8000)); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1706 codec_conf = g_list_prepend(codec_conf, fs_codec_new(FS_CODEC_ID_ANY, |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1707 "SPEEX", FS_MEDIA_TYPE_AUDIO, 16000)); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1708 #endif |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1709 |
26024
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1710 filename = g_build_filename(purple_user_dir(), "fs-codec.conf", NULL); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1711 codec_conf = fs_codec_list_from_keyfile(filename, &err); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1712 g_free(filename); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1713 |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1714 if (err != NULL) { |
26172
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1715 if (err->code == 4) |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1716 purple_debug_info("media", "Couldn't read " |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1717 "fs-codec.conf: %s\n", |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1718 err->message); |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1719 else |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1720 purple_debug_error("media", "Error reading " |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1721 "fs-codec.conf: %s\n", |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26166
diff
changeset
|
1722 err->message); |
26024
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1723 g_error_free(err); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1724 } |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1725 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1726 fs_session_set_codec_preferences(session->session, codec_conf, NULL); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1727 |
26056
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1728 /* |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1729 * Removes a 5-7 second delay before |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1730 * receiving the src-pad-added signal. |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1731 * Only works for non-multicast FsRtpSessions. |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1732 */ |
26387
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26380
diff
changeset
|
1733 if (is_nice || !strcmp(transmitter, "rawudp")) |
26056
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1734 g_object_set(G_OBJECT(session->session), |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1735 "no-rtcp-timeout", 0, NULL); |
25676
157b30b530f4
Temporary fix to remove a 5-7 second delay when initiating a media session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25674
diff
changeset
|
1736 |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1737 fs_codec_list_destroy(codec_conf); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1738 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1739 session->id = g_strdup(sess_id); |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1740 session->media = media; |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1741 session->type = type; |
26466
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
1742 session->initiator = initiator; |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1743 |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1744 purple_media_add_session(media, session); |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1745 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
1746 0, PURPLE_MEDIA_STATE_NEW, |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1747 session->id, NULL); |
26146
4f013819e4e3
Create the media srcs inside PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26145
diff
changeset
|
1748 |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1749 session_type = purple_media_from_fs(media_type, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1750 FS_DIRECTION_SEND); |
26471
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1751 src = purple_media_manager_get_element( |
26474
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26471
diff
changeset
|
1752 media->priv->manager, session_type, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26471
diff
changeset
|
1753 media, session->id, who); |
26471
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1754 if (!GST_IS_ELEMENT(src)) { |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1755 purple_debug_error("media", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1756 "Error creating src for session %s\n", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1757 session->id); |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1758 purple_media_end(media, session->id, NULL); |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1759 return FALSE; |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1760 } |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1761 |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1762 purple_media_set_src(media, session->id, src); |
26146
4f013819e4e3
Create the media srcs inside PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26145
diff
changeset
|
1763 gst_element_set_state(session->src, GST_STATE_PLAYING); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1764 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1765 purple_media_manager_create_output_window( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1766 media->priv->manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1767 session->media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
1768 session->id, NULL); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1769 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1770 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1771 if (!(participant = purple_media_add_participant(media, who))) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1772 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1773 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1774 return FALSE; |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1775 } else { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1776 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
1777 0, PURPLE_MEDIA_STATE_NEW, |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1778 NULL, who); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1779 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1780 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1781 stream = purple_media_get_stream(media, sess_id, who); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1782 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1783 if (!stream) { |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1784 GError *err = NULL; |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1785 FsStream *fsstream = NULL; |
26132
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26129
diff
changeset
|
1786 const gchar *stun_ip = purple_network_get_stun_ip(); |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1787 const gchar *turn_ip = purple_network_get_turn_ip(); |
26138
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26137
diff
changeset
|
1788 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1789 if (stun_ip || turn_ip) { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1790 guint new_num_params = |
26387
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26380
diff
changeset
|
1791 (stun_ip && is_nice) && turn_ip ? |
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26380
diff
changeset
|
1792 num_params + 2 : num_params + 1; |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1793 guint next_param_index = num_params; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1794 GParameter *param = g_new0(GParameter, new_num_params); |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1795 memcpy(param, params, sizeof(GParameter) * num_params); |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1796 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1797 if (stun_ip) { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1798 purple_debug_info("media", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1799 "setting property stun-ip on new stream: %s\n", stun_ip); |
26138
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26137
diff
changeset
|
1800 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1801 param[next_param_index].name = "stun-ip"; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1802 g_value_init(¶m[next_param_index].value, G_TYPE_STRING); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1803 g_value_set_string(¶m[next_param_index].value, stun_ip); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1804 next_param_index++; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1805 } |
26138
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26137
diff
changeset
|
1806 |
26387
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26380
diff
changeset
|
1807 if (turn_ip && is_nice) { |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1808 GValueArray *relay_info = g_value_array_new(0); |
26139
128a3175668e
Removed a couple of warnings
Marcus Lundblad <ml@update.uu.se>
parents:
26138
diff
changeset
|
1809 GValue value; |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1810 gint turn_port = |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1811 purple_prefs_get_int("/purple/network/turn_port"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1812 const gchar *username = |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1813 purple_prefs_get_string("/purple/network/turn_username"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1814 const gchar *password = |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1815 purple_prefs_get_string("/purple/network/turn_password"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1816 GstStructure *turn_setup = gst_structure_new("relay-info", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1817 "ip", G_TYPE_STRING, turn_ip, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1818 "port", G_TYPE_UINT, turn_port, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1819 "username", G_TYPE_STRING, username, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1820 "password", G_TYPE_STRING, password, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1821 NULL); |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1822 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1823 if (turn_setup) { |
26139
128a3175668e
Removed a couple of warnings
Marcus Lundblad <ml@update.uu.se>
parents:
26138
diff
changeset
|
1824 memset(&value, 0, sizeof(GValue)); |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1825 g_value_init(&value, GST_TYPE_STRUCTURE); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1826 gst_value_set_structure(&value, turn_setup); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1827 relay_info = g_value_array_append(relay_info, &value); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1828 gst_structure_free(turn_setup); |
26138
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26137
diff
changeset
|
1829 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1830 purple_debug_info("media", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1831 "setting property relay-info on new stream\n"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1832 param[next_param_index].name = "relay-info"; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1833 g_value_init(¶m[next_param_index].value, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1834 G_TYPE_VALUE_ARRAY); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1835 g_value_set_boxed(¶m[next_param_index].value, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1836 relay_info); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1837 g_value_array_free(relay_info); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1838 } else { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1839 purple_debug_error("media", "Error relay info"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1840 g_object_unref(participant); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1841 g_hash_table_remove(media->priv->participants, who); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1842 purple_media_remove_session(media, session); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1843 g_free(session); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1844 return FALSE; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1845 } |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1846 } |
26138
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26137
diff
changeset
|
1847 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1848 fsstream = fs_session_new_stream(session->session, |
26133
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26132
diff
changeset
|
1849 participant, type_direction & |
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26132
diff
changeset
|
1850 FS_DIRECTION_RECV, transmitter, |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26135
diff
changeset
|
1851 new_num_params, param, &err); |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1852 g_free(param); |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1853 } else { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1854 fsstream = fs_session_new_stream(session->session, |
26133
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26132
diff
changeset
|
1855 participant, type_direction & |
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26132
diff
changeset
|
1856 FS_DIRECTION_RECV, transmitter, |
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26132
diff
changeset
|
1857 num_params, params, &err); |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1858 } |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1859 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1860 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1861 purple_debug_error("media", "Error creating stream: %s\n", |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1862 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1863 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1864 g_object_unref(participant); |
26005
5c30047f960e
Properly free PurpleMedia when there's an error creating an FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25737
diff
changeset
|
1865 g_hash_table_remove(media->priv->participants, who); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1866 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1867 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1868 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1869 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1870 |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1871 stream = purple_media_insert_stream(session, who, fsstream); |
26466
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
1872 stream->initiator = initiator; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1873 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1874 /* callback for source pad added (new stream source ready) */ |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1875 g_signal_connect(G_OBJECT(fsstream), |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1876 "src-pad-added", G_CALLBACK(purple_media_src_pad_added_cb), stream); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1877 |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1878 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26411
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26409
diff
changeset
|
1879 0, PURPLE_MEDIA_STATE_NEW, |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1880 session->id, who); |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1881 } else { |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1882 if (purple_media_to_fs_stream_direction(stream->session->type) |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1883 != type_direction) { |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1884 /* change direction */ |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1885 g_object_set(stream->stream, "direction", |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1886 type_direction, NULL); |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1887 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1888 } |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1889 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1890 return TRUE; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1891 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1892 return FALSE; |
26467
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26466
diff
changeset
|
1893 #endif /* USE_VV */ |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1894 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1895 |
26475
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1896 PurpleMediaManager * |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1897 purple_media_get_manager(PurpleMedia *media) |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1898 { |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1899 PurpleMediaManager *ret; |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1900 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1901 g_object_get(media, "manager", &ret, NULL); |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1902 return ret; |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1903 } |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
1904 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
1905 PurpleMediaSessionType |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1906 purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1907 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1908 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1909 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1910 g_return_val_if_fail(PURPLE_IS_MEDIA(media), PURPLE_MEDIA_NONE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1911 session = purple_media_get_session(media, sess_id); |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1912 return session->type; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1913 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1914 return PURPLE_MEDIA_NONE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1915 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1916 } |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1917 /* XXX: Should wait until codecs-ready is TRUE before using this function */ |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1918 GList * |
26036
a5f1804fcb4b
Combine get_*_codecs functions to mirror Farsight 2.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26027
diff
changeset
|
1919 purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1920 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1921 #ifdef USE_VV |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
1922 GList *fscodecs; |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1923 GList *codecs; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1924 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1925 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1926 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1927 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1928 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1929 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1930 if (session == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1931 return NULL; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1932 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1933 g_object_get(G_OBJECT(session->session), |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
1934 "codecs", &fscodecs, NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
1935 codecs = purple_media_codec_list_from_fs(fscodecs); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
1936 fs_codec_list_destroy(fscodecs); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1937 return codecs; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1938 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1939 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1940 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1941 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1942 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1943 GList * |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1944 purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *name) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1945 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1946 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1947 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1948 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1949 stream = purple_media_get_stream(media, sess_id, name); |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
1950 return purple_media_candidate_list_from_fs(stream->local_candidates); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1951 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1952 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1953 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1954 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1955 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1956 void |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1957 purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, |
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1958 const gchar *name, GList *remote_candidates) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1959 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1960 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1961 PurpleMediaStream *stream; |
26134
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1962 GError *err = NULL; |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1963 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1964 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1965 stream = purple_media_get_stream(media, sess_id, name); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
1966 |
26471
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1967 if (stream == NULL) { |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1968 purple_debug_error("media", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1969 "purple_media_add_remote_candidates: " |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1970 "couldn't find stream %s %s.\n", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1971 sess_id, name); |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1972 return; |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1973 } |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26470
diff
changeset
|
1974 |
26076
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26071
diff
changeset
|
1975 stream->remote_candidates = g_list_concat(stream->remote_candidates, |
26103
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26102
diff
changeset
|
1976 purple_media_candidate_list_to_fs(remote_candidates)); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1977 |
26134
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1978 fs_stream_set_remote_candidates(stream->stream, |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1979 stream->remote_candidates, &err); |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1980 |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1981 if (err) { |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1982 purple_debug_error("media", "Error adding remote" |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1983 " candidates: %s\n", err->message); |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26133
diff
changeset
|
1984 g_error_free(err); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1985 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1986 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1987 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1988 |
26468
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26467
diff
changeset
|
1989 #if 0 |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26467
diff
changeset
|
1990 /* |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26467
diff
changeset
|
1991 * These two functions aren't being used and I'd rather not lock in the API |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26467
diff
changeset
|
1992 * until they are needed. If they ever are. |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26467
diff
changeset
|
1993 */ |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26467
diff
changeset
|
1994 |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1995 GList * |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1996 purple_media_get_active_local_candidates(PurpleMedia *media, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
1997 const gchar *sess_id, const gchar *name) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1998 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
1999 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2000 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2001 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2002 stream = purple_media_get_stream(media, sess_id, name); |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
2003 return purple_media_candidate_list_from_fs( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
2004 stream->active_local_candidates); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2005 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2006 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2007 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2008 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2009 |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
2010 GList * |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
2011 purple_media_get_active_remote_candidates(PurpleMedia *media, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
2012 const gchar *sess_id, const gchar *name) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2013 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2014 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2015 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2016 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2017 stream = purple_media_get_stream(media, sess_id, name); |
26181
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
2018 return purple_media_candidate_list_from_fs( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26173
diff
changeset
|
2019 stream->active_remote_candidates); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2020 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2021 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2022 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2023 } |
26468
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26467
diff
changeset
|
2024 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2025 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2026 gboolean |
25671
12a16471f94e
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.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
2027 purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, const gchar *name, GList *codecs) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2028 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2029 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2030 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2031 FsStream *fsstream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2032 GList *fscodecs; |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2033 GError *err = NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2034 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2035 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2036 stream = purple_media_get_stream(media, sess_id, name); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2037 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2038 if (stream == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2039 return FALSE; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2040 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2041 fsstream = stream->stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2042 fscodecs = purple_media_codec_list_to_fs(codecs); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2043 fs_stream_set_remote_codecs(fsstream, fscodecs, &err); |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
2044 fs_codec_list_destroy(fscodecs); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2045 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2046 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2047 purple_debug_error("media", "Error setting remote codecs: %s\n", |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2048 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2049 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2050 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2051 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
2052 return TRUE; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2053 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2054 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2055 #endif |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2056 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
2057 |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
2058 gboolean |
26392
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2059 purple_media_candidates_prepared(PurpleMedia *media, |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2060 const gchar *session_id, const gchar *participant) |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
2061 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2062 #ifdef USE_VV |
26392
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2063 GList *streams; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2064 gboolean prepared = TRUE; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2065 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2066 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2067 |
26392
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2068 streams = purple_media_get_streams(media, session_id, participant); |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2069 |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2070 for (; streams; streams = g_list_delete_link(streams, streams)) { |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2071 PurpleMediaStream *stream = streams->data; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2072 if (stream->candidates_prepared == FALSE) { |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2073 g_list_free(streams); |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2074 prepared = FALSE; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2075 break; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2076 } |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
2077 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
2078 |
26392
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26391
diff
changeset
|
2079 return prepared; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2080 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2081 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2082 #endif |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
2083 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
2084 |
25712
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2085 gboolean |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
2086 purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec) |
25712
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2087 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2088 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2089 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2090 FsCodec *fscodec; |
25712
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2091 GError *err = NULL; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2092 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2093 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2094 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2095 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2096 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2097 if (session != NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2098 return FALSE; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2099 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2100 fscodec = purple_media_codec_to_fs(codec); |
26106
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
2101 fs_session_set_send_codec(session->session, fscodec, &err); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26105
diff
changeset
|
2102 fs_codec_destroy(fscodec); |
25712
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2103 |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2104 if (err) { |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2105 purple_debug_error("media", "Error setting send codec\n"); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2106 g_error_free(err); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2107 return FALSE; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2108 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2109 return TRUE; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2110 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2111 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2112 #endif |
25712
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2113 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
2114 |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
2115 gboolean |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
2116 purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id) |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
2117 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2118 #ifdef USE_VV |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
2119 gboolean ret; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2120 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2121 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2122 |
26209
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2123 if (sess_id != NULL) { |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2124 PurpleMediaSession *session; |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2125 session = purple_media_get_session(media, sess_id); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2126 |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2127 if (session == NULL) |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2128 return FALSE; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2129 |
26209
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2130 g_object_get(session->session, "codecs-ready", &ret, NULL); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2131 } else { |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2132 GList *values = g_hash_table_get_values(media->priv->sessions); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2133 for (; values; values = g_list_delete_link(values, values)) { |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2134 PurpleMediaSession *session = values->data; |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2135 g_object_get(session->session, |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2136 "codecs-ready", &ret, NULL); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2137 if (ret == FALSE) |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2138 break; |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2139 } |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2140 if (values != NULL) |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2141 g_list_free(values); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26208
diff
changeset
|
2142 } |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
2143 return ret; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2144 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2145 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2146 #endif |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
2147 } |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
2148 |
26143
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26142
diff
changeset
|
2149 gboolean |
26466
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2150 purple_media_is_initiator(PurpleMedia *media, |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2151 const gchar *sess_id, const gchar *participant) |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2152 { |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2153 #ifdef USE_VV |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2154 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2155 |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2156 if (sess_id == NULL && participant == NULL) |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2157 return media->priv->initiator; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2158 else if (sess_id != NULL && participant == NULL) { |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2159 PurpleMediaSession *session = |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2160 purple_media_get_session(media, sess_id); |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2161 return session != NULL ? session->initiator : FALSE; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2162 } else if (sess_id != NULL && participant != NULL) { |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2163 PurpleMediaStream *stream = purple_media_get_stream( |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2164 media, sess_id, participant); |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2165 return stream != NULL ? stream->initiator : FALSE; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2166 } |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2167 #endif |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2168 return FALSE; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2169 } |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2170 |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26465
diff
changeset
|
2171 gboolean |
26143
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26142
diff
changeset
|
2172 purple_media_accepted(PurpleMedia *media, const gchar *sess_id, |
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26142
diff
changeset
|
2173 const gchar *participant) |
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26142
diff
changeset
|
2174 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2175 #ifdef USE_VV |
26391
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2176 gboolean accepted = TRUE; |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2177 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2178 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2179 |
26391
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2180 if (sess_id == NULL && participant == NULL) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2181 GList *streams = media->priv->streams; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2182 |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2183 for (; streams; streams = g_list_next(streams)) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2184 PurpleMediaStream *stream = streams->data; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2185 if (stream->accepted == FALSE) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2186 accepted = FALSE; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2187 break; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2188 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2189 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2190 } else if (sess_id != NULL && participant == NULL) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2191 GList *streams = purple_media_get_streams( |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2192 media, sess_id, NULL); |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2193 for (; streams; streams = |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2194 g_list_delete_link(streams, streams)) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2195 PurpleMediaStream *stream = streams->data; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2196 if (stream->accepted == FALSE) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2197 g_list_free(streams); |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2198 accepted = FALSE; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2199 break; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2200 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2201 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2202 } else if (sess_id != NULL && participant != NULL) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2203 PurpleMediaStream *stream = purple_media_get_stream( |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2204 media, sess_id, participant); |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2205 if (stream == NULL || stream->accepted == FALSE) |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2206 accepted = FALSE; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2207 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2208 |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2209 return accepted; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2210 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2211 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2212 #endif |
26143
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26142
diff
changeset
|
2213 } |
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26142
diff
changeset
|
2214 |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2215 void purple_media_set_input_volume(PurpleMedia *media, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2216 const gchar *session_id, double level) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2217 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2218 #ifdef USE_VV |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2219 GList *sessions; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2220 |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2221 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2222 |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2223 if (session_id == NULL) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2224 sessions = g_hash_table_get_values(media->priv->sessions); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2225 else |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2226 sessions = g_list_append(NULL, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2227 purple_media_get_session(media, session_id)); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2228 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2229 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2230 PurpleMediaSession *session = sessions->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2231 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2232 if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2233 GstElement *volume = gst_bin_get_by_name( |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2234 GST_BIN(session->src), |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2235 "purpleaudioinputvolume"); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2236 g_object_set(volume, "volume", level, NULL); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2237 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2238 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2239 #endif |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2240 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2241 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2242 void purple_media_set_output_volume(PurpleMedia *media, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2243 const gchar *session_id, const gchar *participant, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2244 double level) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2245 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2246 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2247 GList *streams; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2248 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2249 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2250 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2251 streams = purple_media_get_streams(media, |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2252 session_id, participant); |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2253 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2254 for (; streams; streams = g_list_delete_link(streams, streams)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2255 PurpleMediaStream *stream = streams->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2256 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2257 if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO) { |
26420
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2258 GstElement *tee = stream->tee; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2259 GstIterator *iter = gst_element_iterate_src_pads(tee); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2260 GstPad *sinkpad; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2261 while (gst_iterator_next(iter, (gpointer)&sinkpad) |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2262 == GST_ITERATOR_OK) { |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2263 GstPad *peer = gst_pad_get_peer(sinkpad); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2264 GstElement *volume; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2265 |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2266 if (peer == NULL) { |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2267 gst_object_unref(sinkpad); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2268 continue; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2269 } |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2270 |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2271 volume = gst_bin_get_by_name(GST_BIN( |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2272 GST_OBJECT_PARENT(peer)), |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2273 "purpleaudiooutputvolume"); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2274 g_object_set(volume, "volume", level, NULL); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2275 gst_object_unref(peer); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2276 gst_object_unref(sinkpad); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2277 } |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26418
diff
changeset
|
2278 gst_iterator_free(iter); |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2279 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2280 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2281 #endif |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2282 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
2283 |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2284 gulong |
26135
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26134
diff
changeset
|
2285 purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, |
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26134
diff
changeset
|
2286 const gchar *participant, gulong window_id) |
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26134
diff
changeset
|
2287 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2288 #ifdef USE_VV |
26154
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
2289 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
26135
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26134
diff
changeset
|
2290 |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2291 return purple_media_manager_set_output_window(media->priv->manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2292 media, session_id, participant, window_id); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2293 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2294 return 0; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2295 #endif |
26157
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2296 } |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2297 |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2298 void |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2299 purple_media_remove_output_windows(PurpleMedia *media) |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2300 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2301 #ifdef USE_VV |
26157
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2302 GList *iter = media->priv->streams; |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2303 for (; iter; iter = g_list_next(iter)) { |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2304 PurpleMediaStream *stream = iter->data; |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2305 purple_media_manager_remove_output_windows( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2306 media->priv->manager, media, |
26157
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2307 stream->session->id, stream->participant); |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2308 } |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2309 |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2310 iter = purple_media_get_session_names(media); |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2311 for (; iter; iter = g_list_delete_link(iter, iter)) { |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2312 gchar *session_name = iter->data; |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2313 purple_media_manager_remove_output_windows( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2314 media->priv->manager, media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2315 session_name, NULL); |
26157
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2316 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2317 #endif |
26157
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2318 } |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26156
diff
changeset
|
2319 |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2320 GstElement * |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2321 purple_media_get_tee(PurpleMedia *media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2322 const gchar *session_id, const gchar *participant) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2323 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2324 #ifdef USE_VV |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2325 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2326 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2327 if (session_id != NULL && participant == NULL) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2328 PurpleMediaSession *session = |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2329 purple_media_get_session(media, session_id); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2330 return (session != NULL) ? session->tee : NULL; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2331 } else if (session_id != NULL && participant != NULL) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2332 PurpleMediaStream *stream = |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2333 purple_media_get_stream(media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2334 session_id, participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2335 return (stream != NULL) ? stream->tee : NULL; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2336 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2337 g_return_val_if_reached(NULL); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2338 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2339 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
2340 #endif |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2341 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26197
diff
changeset
|
2342 |