Mercurial > pidgin.yaz
annotate libpurple/media.c @ 26011:e8b8c6b14196
Simplified purple_media_get_devices.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Mon, 01 Sep 2008 03:18:26 +0000 |
parents | 3b4b9795f987 |
children | 5a774d0817d8 |
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" |
32 #include "media.h" | |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
33 #include "marshallers.h" |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
34 #include "mediamanager.h" |
25546 | 35 |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
36 #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
|
37 |
25654
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25651
diff
changeset
|
38 #ifdef USE_VV |
25546 | 39 |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
40 #include <gst/interfaces/propertyprobe.h> |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
41 #include <gst/farsight/fs-conference-iface.h> |
25546 | 42 |
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
|
43 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
|
44 { |
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
|
45 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
|
46 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
|
47 GstElement *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
|
48 GstElement *sink; |
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
|
49 FsSession *session; |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
50 /* FsStream table. Mapped by participant's name */ |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
51 GHashTable *streams; |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
52 PurpleMediaSessionType type; |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
53 /* GList of FsCandidates table. Mapped by participant's name */ |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
54 GHashTable *local_candidates; |
25696
86f05fa8a90a
Clarify the scope of two variables.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25695
diff
changeset
|
55 |
86f05fa8a90a
Clarify the scope of two variables.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25695
diff
changeset
|
56 /* |
86f05fa8a90a
Clarify the scope of two variables.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25695
diff
changeset
|
57 * These will need to be per stream when sessions with multiple |
86f05fa8a90a
Clarify the scope of two variables.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25695
diff
changeset
|
58 * streams are supported. |
86f05fa8a90a
Clarify the scope of two variables.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25695
diff
changeset
|
59 */ |
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
|
60 FsCandidate *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
|
61 FsCandidate *remote_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
|
62 }; |
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 |
25546 | 64 struct _PurpleMediaPrivate |
65 { | |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
66 FsConference *conference; |
25546 | 67 |
68 char *name; | |
69 PurpleConnection *connection; | |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
70 |
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
|
71 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
|
72 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
|
73 |
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
|
74 GstElement *pipeline; |
25546 | 75 }; |
76 | |
77 #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) | |
78 | |
79 static void purple_media_class_init (PurpleMediaClass *klass); | |
80 static void purple_media_init (PurpleMedia *media); | |
81 static void purple_media_finalize (GObject *object); | |
82 static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
83 static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
84 | |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
85 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
|
86 FsCandidate *local_candidate, PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
87 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
|
88 PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
89 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
|
90 FsCandidate *native_candidate, FsCandidate *remote_candidate, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
91 PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
92 |
25546 | 93 static GObjectClass *parent_class = NULL; |
94 | |
95 | |
96 | |
97 enum { | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
98 READY, |
25643
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
99 WAIT, |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
100 ACCEPTED, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
101 HANGUP, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
102 REJECT, |
25687
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
103 GOT_REQUEST, |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
104 GOT_HANGUP, |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
105 GOT_ACCEPT, |
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
|
106 NEW_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
|
107 CANDIDATES_PREPARED, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
108 CANDIDATE_PAIR, |
25546 | 109 LAST_SIGNAL |
110 }; | |
111 static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
112 | |
113 enum { | |
114 PROP_0, | |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
115 PROP_FS_CONFERENCE, |
25546 | 116 PROP_NAME, |
117 PROP_CONNECTION, | |
118 }; | |
119 | |
120 GType | |
121 purple_media_get_type() | |
122 { | |
123 static GType type = 0; | |
124 | |
125 if (type == 0) { | |
126 static const GTypeInfo info = { | |
127 sizeof(PurpleMediaClass), | |
128 NULL, | |
129 NULL, | |
130 (GClassInitFunc) purple_media_class_init, | |
131 NULL, | |
132 NULL, | |
133 sizeof(PurpleMedia), | |
134 0, | |
25560
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25552
diff
changeset
|
135 (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
|
136 NULL |
25546 | 137 }; |
138 type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
139 } | |
140 return type; | |
141 } | |
142 | |
143 static void | |
144 purple_media_class_init (PurpleMediaClass *klass) | |
145 { | |
146 GObjectClass *gobject_class = (GObjectClass*)klass; | |
147 parent_class = g_type_class_peek_parent(klass); | |
148 | |
149 gobject_class->finalize = purple_media_finalize; | |
150 gobject_class->set_property = purple_media_set_property; | |
151 gobject_class->get_property = purple_media_get_property; | |
152 | |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
153 g_object_class_install_property(gobject_class, PROP_FS_CONFERENCE, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
154 g_param_spec_object("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
|
155 "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
|
156 "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
|
157 FS_TYPE_CONFERENCE, |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
158 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
25546 | 159 |
160 g_object_class_install_property(gobject_class, PROP_NAME, | |
161 g_param_spec_string("screenname", | |
162 "Screenname", | |
163 "The screenname of the remote user", | |
164 NULL, | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
165 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
25546 | 166 |
167 g_object_class_install_property(gobject_class, PROP_CONNECTION, | |
168 g_param_spec_pointer("connection", | |
169 "Connection", | |
170 "The PurpleConnection associated with this session", | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
171 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
172 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
173 purple_media_signals[READY] = g_signal_new("ready", G_TYPE_FROM_CLASS(klass), |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
174 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
175 g_cclosure_marshal_VOID__VOID, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
176 G_TYPE_NONE, 0); |
25643
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
177 purple_media_signals[WAIT] = g_signal_new("wait", G_TYPE_FROM_CLASS(klass), |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
178 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
179 g_cclosure_marshal_VOID__VOID, |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
180 G_TYPE_NONE, 0); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
181 purple_media_signals[ACCEPTED] = g_signal_new("accepted", G_TYPE_FROM_CLASS(klass), |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
182 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
183 g_cclosure_marshal_VOID__VOID, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
184 G_TYPE_NONE, 0); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
185 purple_media_signals[HANGUP] = g_signal_new("hangup", G_TYPE_FROM_CLASS(klass), |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
186 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
187 g_cclosure_marshal_VOID__VOID, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
188 G_TYPE_NONE, 0); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
189 purple_media_signals[REJECT] = g_signal_new("reject", G_TYPE_FROM_CLASS(klass), |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
190 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
191 g_cclosure_marshal_VOID__VOID, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
192 G_TYPE_NONE, 0); |
25687
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
193 purple_media_signals[GOT_REQUEST] = g_signal_new("got-request", G_TYPE_FROM_CLASS(klass), |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
194 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
195 g_cclosure_marshal_VOID__VOID, |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
196 G_TYPE_NONE, 0); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
197 purple_media_signals[GOT_HANGUP] = g_signal_new("got-hangup", G_TYPE_FROM_CLASS(klass), |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
198 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
199 g_cclosure_marshal_VOID__VOID, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
200 G_TYPE_NONE, 0); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
201 purple_media_signals[GOT_ACCEPT] = g_signal_new("got-accept", G_TYPE_FROM_CLASS(klass), |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
202 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
203 g_cclosure_marshal_VOID__VOID, |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
204 G_TYPE_NONE, 0); |
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
|
205 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
|
206 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
|
207 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
|
208 G_TYPE_NONE, 3, G_TYPE_POINTER, |
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
|
209 G_TYPE_POINTER, FS_TYPE_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
|
210 purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
211 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
212 g_cclosure_marshal_VOID__VOID, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
213 G_TYPE_NONE, 0); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
214 purple_media_signals[CANDIDATE_PAIR] = g_signal_new("candidate-pair", G_TYPE_FROM_CLASS(klass), |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
215 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
216 purple_smarshal_VOID__BOXED_BOXED, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
217 G_TYPE_NONE, 2, FS_TYPE_CANDIDATE, FS_TYPE_CANDIDATE); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
218 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
219 g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
25546 | 220 } |
221 | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
222 |
25546 | 223 static void |
224 purple_media_init (PurpleMedia *media) | |
225 { | |
226 media->priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
227 memset(media->priv, 0, sizeof(media->priv)); |
25546 | 228 } |
229 | |
230 static void | |
231 purple_media_finalize (GObject *media) | |
232 { | |
25661
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
233 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
|
234 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
|
235 |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
236 purple_media_manager_remove_media(purple_media_manager_get(), |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
237 PURPLE_MEDIA(media)); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
238 |
25661
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
239 g_free(priv->name); |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
240 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
241 if (priv->sessions) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
242 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
|
243 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
244 PurpleMediaSession *session = sessions->data; |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
245 g_free(session->id); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
246 |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
247 if (session->streams) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
248 GList *streams = g_hash_table_get_values(session->streams); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
249 for (; streams; streams = g_list_delete_link(streams, streams)) |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
250 g_object_unref(streams->data); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
251 g_hash_table_destroy(session->streams); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
252 } |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
253 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
254 if (session->local_candidates) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
255 GList *candidates = g_hash_table_get_values(session->local_candidates); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
256 for (; candidates; candidates = |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
257 g_list_delete_link(candidates, candidates)) |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
258 fs_candidate_list_destroy(candidates->data); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
259 g_hash_table_destroy(session->local_candidates); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
260 } |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
261 |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
262 if (session->local_candidate) |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
263 fs_candidate_destroy(session->local_candidate); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
264 if (session->remote_candidate) |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
265 fs_candidate_destroy(session->remote_candidate); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
266 |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
267 g_free(session); |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
268 } |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
269 g_hash_table_destroy(priv->sessions); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
270 } |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
271 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
272 if (priv->participants) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
273 GList *participants = g_hash_table_get_values(priv->participants); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
274 for (; participants; participants = g_list_delete_link(participants, participants)) |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
275 g_object_unref(participants->data); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
276 g_hash_table_destroy(priv->participants); |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
277 } |
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
278 |
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
|
279 if (priv->pipeline) { |
25731
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
280 GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(priv->pipeline)); |
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
281 gst_bus_remove_signal_watch(bus); |
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
282 gst_object_unref(bus); |
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
|
283 gst_element_set_state(priv->pipeline, GST_STATE_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
|
284 gst_object_unref(priv->pipeline); |
25661
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
285 } |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
286 |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
287 gst_object_unref(priv->conference); |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
288 |
25546 | 289 parent_class->finalize(media); |
290 } | |
291 | |
292 static void | |
293 purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
294 { | |
295 PurpleMedia *media; | |
296 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
|
297 |
25546 | 298 media = PURPLE_MEDIA(object); |
299 | |
300 switch (prop_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
|
301 case PROP_FS_CONFERENCE: |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
302 if (media->priv->conference) |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
303 g_object_unref(media->priv->conference); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
304 media->priv->conference = g_value_get_object(value); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
305 g_object_ref(media->priv->conference); |
25546 | 306 break; |
307 case PROP_NAME: | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
308 g_free(media->priv->name); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
309 media->priv->name = g_value_dup_string(value); |
25546 | 310 break; |
311 case PROP_CONNECTION: | |
312 media->priv->connection = g_value_get_pointer(value); | |
313 break; | |
314 default: | |
315 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
316 break; | |
317 } | |
318 } | |
319 | |
320 static void | |
321 purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
322 { | |
323 PurpleMedia *media; | |
324 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
325 | |
326 media = PURPLE_MEDIA(object); | |
327 | |
328 switch (prop_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
|
329 case PROP_FS_CONFERENCE: |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
330 g_value_set_object(value, media->priv->conference); |
25546 | 331 break; |
332 case PROP_NAME: | |
333 g_value_set_string(value, media->priv->name); | |
334 break; | |
335 case PROP_CONNECTION: | |
336 g_value_set_pointer(value, media->priv->connection); | |
337 break; | |
338 default: | |
339 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
340 break; | |
341 } | |
342 | |
343 } | |
344 | |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
345 FsMediaType |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
346 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
|
347 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
348 if (type & PURPLE_MEDIA_AUDIO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
349 return FS_MEDIA_TYPE_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
350 else if (type & PURPLE_MEDIA_VIDEO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
351 return FS_MEDIA_TYPE_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
352 else |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
353 return 0; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
354 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
355 |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
356 FsStreamDirection |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
357 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
|
358 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
359 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
|
360 (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
|
361 return FS_DIRECTION_BOTH; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
362 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
|
363 (type & PURPLE_MEDIA_SEND_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
364 return FS_DIRECTION_SEND; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
365 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
|
366 (type & PURPLE_MEDIA_RECV_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
367 return FS_DIRECTION_RECV; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
368 else |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
369 return FS_DIRECTION_NONE; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
370 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
371 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
372 PurpleMediaSessionType |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
373 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
|
374 { |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
375 PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
376 if (type == FS_MEDIA_TYPE_AUDIO) { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
377 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
378 result |= PURPLE_MEDIA_SEND_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
379 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
380 result |= PURPLE_MEDIA_RECV_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
381 } 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
|
382 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
383 result |= PURPLE_MEDIA_SEND_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
384 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
385 result |= PURPLE_MEDIA_RECV_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
386 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
387 return result; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
388 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
389 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
390 PurpleMediaSessionType |
25687
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
391 purple_media_get_overall_type(PurpleMedia *media) |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
392 { |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
393 GList *values = g_hash_table_get_values(media->priv->sessions); |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
394 PurpleMediaSessionType type = PURPLE_MEDIA_NONE; |
25687
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
395 |
25702
a1a1f44cdecc
Fixed some memory leak issues involving GLists.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25696
diff
changeset
|
396 for (; values; values = g_list_delete_link(values, values)) { |
25687
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
397 PurpleMediaSession *session = values->data; |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
398 type |= session->type; |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
399 } |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
400 |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
401 return type; |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
402 } |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
403 |
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
|
404 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
|
405 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
|
406 { |
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
|
407 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
|
408 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
|
409 } |
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
|
410 |
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
|
411 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
|
412 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
|
413 { |
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
|
414 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
|
415 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
|
416 } |
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
|
417 |
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
|
418 static FsStream* |
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
|
419 purple_media_session_get_stream(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
|
420 { |
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
|
421 return (FsStream*) (session->streams) ? |
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
|
422 g_hash_table_lookup(session->streams, 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
|
423 } |
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
|
424 |
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
|
425 static 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
|
426 purple_media_session_get_local_candidates(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
|
427 { |
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
|
428 return (GList*) (session->local_candidates) ? |
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
|
429 g_hash_table_lookup(session->local_candidates, 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
|
430 } |
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
|
431 |
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
|
432 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
|
433 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
|
434 { |
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
|
435 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
|
436 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
|
437 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
|
438 } |
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
|
439 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
|
440 } |
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
|
441 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
442 static gboolean |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
443 purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
444 { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
445 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
|
446 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
447 |
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
|
448 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
|
449 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
|
450 { |
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
|
451 FsParticipant *participant = purple_media_get_participant(media, name); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
452 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
|
453 |
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
|
454 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
|
455 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
|
456 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
457 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
|
458 (gchar*)name, &err); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
459 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
460 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
461 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
|
462 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
463 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
464 return NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
465 } |
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
|
466 |
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
|
467 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
|
468 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
|
469 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
|
470 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
|
471 } |
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
|
472 |
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
|
473 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
|
474 |
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
|
475 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
|
476 } |
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
|
477 |
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
|
478 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
|
479 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
|
480 { |
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
|
481 if (!session->streams) { |
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
|
482 purple_debug_info("media", "Creating hash table for streams\n"); |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
483 session->streams = 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
|
484 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
|
485 } |
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
|
486 |
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
|
487 g_hash_table_insert(session->streams, g_strdup(name), 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
|
488 } |
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
|
489 |
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
|
490 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
|
491 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
|
492 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
|
493 { |
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
|
494 GList *candidates = purple_media_session_get_local_candidates(session, 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
|
495 |
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
|
496 candidates = g_list_append(candidates, 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
|
497 |
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
|
498 if (!session->local_candidates) { |
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
|
499 purple_debug_info("media", "Creating hash table for local candidates\n"); |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
500 session->local_candidates = 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
|
501 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
|
502 } |
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
|
503 |
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
|
504 g_hash_table_insert(session->local_candidates, g_strdup(name), candidates); |
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
|
505 } |
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
|
506 |
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
|
507 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
|
508 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
|
509 { |
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
|
510 return g_hash_table_get_keys(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
|
511 } |
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
|
512 |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
513 void |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
514 purple_media_get_elements(PurpleMedia *media, GstElement **audio_src, GstElement **audio_sink, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
515 GstElement **video_src, GstElement **video_sink) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
516 { |
25694
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
517 GList *values = g_hash_table_get_values(media->priv->sessions); |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
518 |
25702
a1a1f44cdecc
Fixed some memory leak issues involving GLists.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25696
diff
changeset
|
519 for (; values; values = g_list_delete_link(values, values)) { |
25694
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
520 PurpleMediaSession *session = (PurpleMediaSession*)values->data; |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
521 |
25694
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
522 if (session->type & PURPLE_MEDIA_SEND_AUDIO && audio_src) |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
523 *audio_src = session->src; |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
524 if (session->type & PURPLE_MEDIA_RECV_AUDIO && audio_sink) |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
525 *audio_sink = session->sink; |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
526 if (session->type & PURPLE_MEDIA_SEND_VIDEO && video_src) |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
527 *video_src = session->src; |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
528 if (session->type & PURPLE_MEDIA_RECV_VIDEO && video_sink) |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
529 *video_sink = session->sink; |
72e738dac5f7
Wait to set up the voice and video GUI until the responder has accepted the session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25692
diff
changeset
|
530 } |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
531 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
532 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
533 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
|
534 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
|
535 { |
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
|
536 PurpleMediaSession *session = purple_media_get_session(media, 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
|
537 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
|
538 GstPad *srcpad; |
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
|
539 |
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
|
540 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
|
541 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
|
542 session->src = 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
|
543 gst_bin_add(GST_BIN(purple_media_get_pipeline(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
|
544 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
|
545 |
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
|
546 g_object_get(session->session, "sink-pad", &sinkpad, 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
|
547 srcpad = gst_element_get_static_pad(src, "ghostsrc"); |
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
|
548 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
|
549 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
|
550 ? "success" : "failure"); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
551 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
552 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
553 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
|
554 purple_media_set_sink(PurpleMedia *media, const gchar *sess_id, GstElement *sink) |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
555 { |
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
|
556 PurpleMediaSession *session = purple_media_get_session(media, 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
|
557 if (session->sink) |
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
|
558 gst_object_unref(session->sink); |
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
|
559 session->sink = sink; |
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
|
560 gst_bin_add(GST_BIN(purple_media_get_pipeline(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
|
561 session->sink); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
562 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
563 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
564 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
|
565 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
|
566 { |
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
|
567 return purple_media_get_session(media, sess_id)->src; |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
568 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
569 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
570 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
|
571 purple_media_get_sink(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
|
572 { |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
573 return purple_media_get_session(media, sess_id)->sink; |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
574 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
575 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
576 static PurpleMediaSession * |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
577 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
|
578 { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
579 FsSession *fssession; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
580 GList *values; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
581 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
582 g_object_get(stream, "session", &fssession, NULL); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
583 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
584 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
|
585 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
586 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
|
587 PurpleMediaSession *session = values->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
588 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
589 if (session->session == fssession) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
590 g_list_free(values); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
591 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
592 return session; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
593 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
594 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
595 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
596 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
597 return NULL; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
598 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
599 |
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
|
600 static gboolean |
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
|
601 media_bus_call(GstBus *bus, GstMessage *msg, gpointer media) |
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
|
602 { |
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
|
603 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
|
604 case GST_MESSAGE_EOS: |
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
|
605 purple_debug_info("media", "End of Stream\n"); |
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
|
606 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
|
607 case GST_MESSAGE_ERROR: { |
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
|
608 gchar *debug = NULL; |
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
|
609 GError *err = NULL; |
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
|
610 |
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
|
611 gst_message_parse_error(msg, &err, &debug); |
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
|
612 |
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
|
613 purple_debug_error("media", "gst pipeline error: %s\n", err->message); |
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
|
614 g_error_free(err); |
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
|
615 |
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
|
616 if (debug) { |
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
|
617 purple_debug_error("media", "Debug details: %s\n", debug); |
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
|
618 g_free (debug); |
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
|
619 } |
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
|
620 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
|
621 } |
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
|
622 case GST_MESSAGE_ELEMENT: { |
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
|
623 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
|
624 FsError error_no; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
625 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
|
626 FS_TYPE_ERROR, (gint*)&error_no); |
26008
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
627 /* |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
628 * 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
|
629 * multicast transmitter which isn't used. |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
630 */ |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
631 if (error_no != FS_ERROR_UNKNOWN_CNAME) |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
632 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
|
633 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
|
634 } 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
|
635 "farsight-new-local-candidate")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
636 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
|
637 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
|
638 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
|
639 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
|
640 } 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
|
641 "farsight-local-candidates-prepared")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
642 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
|
643 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
|
644 purple_media_candidates_prepared_cb(stream, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
645 } 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
|
646 "farsight-new-active-candidate-pair")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
647 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
|
648 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
|
649 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
|
650 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
|
651 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
|
652 } 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
|
653 "farsight-recv-codecs-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
654 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
|
655 FsCodec *codec = codecs->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
656 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
|
657 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
658 } 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
|
659 "farsight-component-state-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
660 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
661 } 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
|
662 "farsight-send-codec-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
663 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
664 } 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
|
665 "farsight-codecs-changed")) { |
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
|
666 } |
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
|
667 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
|
668 } |
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
|
669 default: |
25732
d6bda7b63eac
Remove a bunch of extraneous GstBus messages from the debug output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25731
diff
changeset
|
670 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
|
671 } |
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
|
672 |
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
|
673 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
|
674 } |
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
|
675 |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
676 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
|
677 purple_media_get_pipeline(PurpleMedia *media) |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
678 { |
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
|
679 if (!media->priv->pipeline) { |
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
|
680 GstBus *bus; |
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
|
681 media->priv->pipeline = gst_pipeline_new(media->priv->name); |
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
|
682 bus = gst_pipeline_get_bus(GST_PIPELINE(media->priv->pipeline)); |
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
|
683 gst_bus_add_signal_watch(GST_BUS(bus)); |
25731
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
684 g_signal_connect(G_OBJECT(bus), "message", |
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
685 G_CALLBACK(media_bus_call), 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
|
686 gst_object_unref(bus); |
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
|
687 |
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
|
688 gst_bin_add(GST_BIN(media->priv->pipeline), GST_ELEMENT(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
|
689 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
690 |
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
|
691 return media->priv->pipeline; |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
692 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
693 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
694 PurpleConnection * |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
695 purple_media_get_connection(PurpleMedia *media) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
696 { |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
697 PurpleConnection *gc; |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
698 g_object_get(G_OBJECT(media), "connection", &gc, NULL); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
699 return gc; |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
700 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
701 |
25730
e4261bc6788d
Fixed a compile warning.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25728
diff
changeset
|
702 char * |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
703 purple_media_get_screenname(PurpleMedia *media) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
704 { |
25730
e4261bc6788d
Fixed a compile warning.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25728
diff
changeset
|
705 char *ret; |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
706 g_object_get(G_OBJECT(media), "screenname", &ret, NULL); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
707 return ret; |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
708 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
709 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
710 void |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
711 purple_media_ready(PurpleMedia *media) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
712 { |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
713 g_signal_emit(media, purple_media_signals[READY], 0); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
714 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
715 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
716 void |
25643
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
717 purple_media_wait(PurpleMedia *media) |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
718 { |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
719 g_signal_emit(media, purple_media_signals[WAIT], 0); |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
720 } |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
721 |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
722 void |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
723 purple_media_accept(PurpleMedia *media) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
724 { |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
725 g_signal_emit(media, purple_media_signals[ACCEPTED], 0); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
726 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
727 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
728 void |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
729 purple_media_hangup(PurpleMedia *media) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
730 { |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
731 g_signal_emit(media, purple_media_signals[HANGUP], 0); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
732 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
733 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
734 void |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
735 purple_media_reject(PurpleMedia *media) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
736 { |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
737 g_signal_emit(media, purple_media_signals[REJECT], 0); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
738 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
739 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
740 void |
25687
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
741 purple_media_got_request(PurpleMedia *media) |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
742 { |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
743 g_signal_emit(media, purple_media_signals[GOT_REQUEST], 0); |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
744 } |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
745 |
ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25686
diff
changeset
|
746 void |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
747 purple_media_got_hangup(PurpleMedia *media) |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
748 { |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
749 g_signal_emit(media, purple_media_signals[GOT_HANGUP], 0); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
750 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
751 |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
752 void |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
753 purple_media_got_accept(PurpleMedia *media) |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
754 { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
755 g_signal_emit(media, purple_media_signals[GOT_ACCEPT], 0); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
756 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
757 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
758 GList* |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
759 purple_media_get_devices(const gchar *plugin) |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
760 { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
761 GObjectClass *klass; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
762 GstPropertyProbe *probe; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
763 const GParamSpec *pspec; |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
764 GstElement *element = gst_element_factory_make(plugin, NULL); |
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
765 GstElementFactory *factory; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
766 const gchar *longname = NULL; |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
767 GList *ret = NULL; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
768 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
769 if (element == NULL) |
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
770 return NULL; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
771 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
772 factory = gst_element_get_factory(element); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
773 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
774 longname = gst_element_factory_get_longname(factory); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
775 klass = G_OBJECT_GET_CLASS(element); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
776 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
777 if (!g_object_class_find_property (klass, "device") || |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
778 !GST_IS_PROPERTY_PROBE (element) || |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
779 !(probe = GST_PROPERTY_PROBE (element)) || |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
780 !(pspec = gst_property_probe_get_property (probe, "device"))) { |
25649
6bf2dfb350c0
Fix video plugin/device preference and preview.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
781 purple_debug_info("media", "Found source '%s' (%s) - no device\n", |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
782 longname, GST_PLUGIN_FEATURE (factory)->name); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
783 } else { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
784 gint n; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
785 gchar *name; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
786 GValueArray *array; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
787 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
788 purple_debug_info("media", "Found devices\n"); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
789 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
790 /* Set autoprobe[-fps] to FALSE to avoid delays when probing. */ |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
791 if (g_object_class_find_property (klass, "autoprobe")) { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
792 g_object_set (G_OBJECT (element), "autoprobe", FALSE, NULL); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
793 if (g_object_class_find_property (klass, "autoprobe-fps")) { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
794 g_object_set (G_OBJECT (element), "autoprobe-fps", FALSE, NULL); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
795 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
796 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
797 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
798 array = gst_property_probe_probe_and_get_values (probe, pspec); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
799 if (array != NULL) { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
800 for (n = 0 ; n < array->n_values ; n++) { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
801 GValue *device = g_value_array_get_nth (array, n); |
25737
4b8c64deac5e
Simplify device API. Use gchar* instead of GValue.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25736
diff
changeset
|
802 |
4b8c64deac5e
Simplify device API. Use gchar* instead of GValue.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25736
diff
changeset
|
803 ret = g_list_append(ret, g_value_dup_string(device)); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
804 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
805 g_object_set(G_OBJECT(element), "device", |
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
806 g_value_get_string(device), NULL); |
26007
943a09762d95
Removed several PurpleMedia functions that now seem unnecessary:
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26005
diff
changeset
|
807 g_object_get(G_OBJECT(element), "device-name", &name, NULL); |
25649
6bf2dfb350c0
Fix video plugin/device preference and preview.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
808 purple_debug_info("media", "Found source '%s' (%s) - device '%s' (%s)\n", |
6bf2dfb350c0
Fix video plugin/device preference and preview.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
809 longname, GST_PLUGIN_FEATURE (factory)->name, |
6bf2dfb350c0
Fix video plugin/device preference and preview.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
810 name, g_value_get_string(device)); |
6bf2dfb350c0
Fix video plugin/device preference and preview.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
811 g_free(name); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
812 } |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
813 g_value_array_free(array); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
814 } |
25734
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
815 |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
816 /* Restore autoprobe[-fps] to TRUE. */ |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
817 if (g_object_class_find_property (klass, "autoprobe")) { |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
818 g_object_set (G_OBJECT (element), "autoprobe", TRUE, NULL); |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
819 if (g_object_class_find_property (klass, "autoprobe-fps")) { |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
820 g_object_set (G_OBJECT (element), "autoprobe-fps", TRUE, NULL); |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
821 } |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
822 } |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
823 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
824 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
825 gst_object_unref(element); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
826 return ret; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
827 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
828 |
25737
4b8c64deac5e
Simplify device API. Use gchar* instead of GValue.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25736
diff
changeset
|
829 gchar * |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
830 purple_media_element_get_device(GstElement *element) |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
831 { |
25737
4b8c64deac5e
Simplify device API. Use gchar* instead of GValue.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25736
diff
changeset
|
832 gchar *device; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
833 g_object_get(G_OBJECT(element), "device", &device, NULL); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
834 return device; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
835 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
836 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
837 void |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
838 purple_media_audio_init_src(GstElement **sendbin, GstElement **sendlevel) |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
839 { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
840 GstElement *src; |
25713
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
841 GstElement *volume; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
842 GstPad *pad; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
843 GstPad *ghost; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
844 const gchar *audio_device = purple_prefs_get_string("/purple/media/audio/device"); |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
845 double input_volume = purple_prefs_get_int("/purple/media/audio/volume/input")/10.0; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
846 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
847 purple_debug_info("media", "purple_media_audio_init_src\n"); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
848 |
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
|
849 *sendbin = gst_bin_new("purplesendaudiobin"); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
850 src = gst_element_factory_make("alsasrc", "asrc"); |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
851 volume = gst_element_factory_make("volume", "purpleaudioinputvolume"); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
852 g_object_set(volume, "volume", input_volume, NULL); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
853 *sendlevel = gst_element_factory_make("level", "sendlevel"); |
25713
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
854 gst_bin_add_many(GST_BIN(*sendbin), src, volume, *sendlevel, NULL); |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
855 gst_element_link(src, volume); |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
856 gst_element_link(volume, *sendlevel); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
857 pad = gst_element_get_pad(*sendlevel, "src"); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
858 ghost = gst_ghost_pad_new("ghostsrc", pad); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
859 gst_element_add_pad(*sendbin, ghost); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
860 g_object_set(G_OBJECT(*sendlevel), "message", TRUE, NULL); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
861 |
26007
943a09762d95
Removed several PurpleMedia functions that now seem unnecessary:
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26005
diff
changeset
|
862 if (audio_device != NULL && strcmp(audio_device, "")) |
943a09762d95
Removed several PurpleMedia functions that now seem unnecessary:
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26005
diff
changeset
|
863 g_object_set(G_OBJECT(src), "device", audio_device, NULL); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
864 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
865 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
866 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
|
867 purple_media_video_init_src(GstElement **sendbin) |
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
|
868 { |
25686
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
869 GstElement *src, *tee, *queue, *local_sink; |
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
|
870 GstPad *pad; |
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
|
871 GstPad *ghost; |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
872 const gchar *video_plugin = purple_prefs_get_string( |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
873 "/purple/media/video/plugin"); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
874 const gchar *video_device = purple_prefs_get_string( |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
875 "/purple/media/video/device"); |
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
|
876 |
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
|
877 purple_debug_info("media", "purple_media_video_init_src\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
|
878 |
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
|
879 *sendbin = gst_bin_new("purplesendvideobin"); |
25686
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
880 src = gst_element_factory_make(video_plugin, "purplevideosource"); |
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
|
881 gst_bin_add(GST_BIN(*sendbin), 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
|
882 |
25686
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
883 tee = gst_element_factory_make("tee", NULL); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
884 gst_bin_add(GST_BIN(*sendbin), tee); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
885 gst_element_link(src, tee); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
886 |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
887 queue = gst_element_factory_make("queue", NULL); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
888 gst_bin_add(GST_BIN(*sendbin), queue); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
889 gst_element_link(tee, queue); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
890 |
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
|
891 if (!strcmp(video_plugin, "videotestsrc")) { |
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
|
892 /* unless is-live is set to true it doesn't throttle videotestsrc */ |
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
|
893 g_object_set (G_OBJECT(src), "is-live", TRUE, 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
|
894 } |
25686
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
895 |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
896 pad = gst_element_get_pad(queue, "src"); |
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
|
897 ghost = gst_ghost_pad_new("ghostsrc", pad); |
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
|
898 gst_element_add_pad(*sendbin, ghost); |
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
|
899 |
25686
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
900 queue = gst_element_factory_make("queue", NULL); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
901 gst_bin_add(GST_BIN(*sendbin), queue); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
902 gst_element_link(tee, queue); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
903 |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
904 local_sink = gst_element_factory_make("autovideosink", "purplelocalvideosink"); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
905 gst_bin_add(GST_BIN(*sendbin), local_sink); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
906 gst_element_link(queue, local_sink); |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
907 |
26007
943a09762d95
Removed several PurpleMedia functions that now seem unnecessary:
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26005
diff
changeset
|
908 if (video_device != NULL && strcmp(video_device, "")) |
943a09762d95
Removed several PurpleMedia functions that now seem unnecessary:
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26005
diff
changeset
|
909 g_object_set(G_OBJECT(src), "device", video_device, 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
|
910 } |
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
|
911 |
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
|
912 void |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
913 purple_media_audio_init_recv(GstElement **recvbin, GstElement **recvlevel) |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
914 { |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
915 GstElement *sink, *volume; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
916 GstPad *pad, *ghost; |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
917 double output_volume = purple_prefs_get_int( |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
918 "/purple/media/audio/volume/output")/10.0; |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
919 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
920 purple_debug_info("media", "purple_media_audio_init_recv\n"); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
921 |
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
|
922 *recvbin = gst_bin_new("pidginrecvaudiobin"); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
923 sink = gst_element_factory_make("alsasink", "asink"); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
924 g_object_set(G_OBJECT(sink), "sync", FALSE, NULL); |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
925 volume = gst_element_factory_make("volume", "purpleaudiooutputvolume"); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
926 g_object_set(volume, "volume", output_volume, NULL); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
927 *recvlevel = gst_element_factory_make("level", "recvlevel"); |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
928 gst_bin_add_many(GST_BIN(*recvbin), sink, volume, *recvlevel, NULL); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
929 gst_element_link(*recvlevel, sink); |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
930 gst_element_link(volume, *recvlevel); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
931 pad = gst_element_get_pad(volume, "sink"); |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
932 ghost = gst_ghost_pad_new("ghostsink", pad); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
933 gst_element_add_pad(*recvbin, ghost); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
934 g_object_set(G_OBJECT(*recvlevel), "message", TRUE, NULL); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
935 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
936 purple_debug_info("media", "purple_media_audio_init_recv end\n"); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
937 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
938 |
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
|
939 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
|
940 purple_media_video_init_recv(GstElement **recvbin) |
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
|
941 { |
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
|
942 GstElement *sink; |
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
|
943 GstPad *pad, *ghost; |
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
|
944 |
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
|
945 purple_debug_info("media", "purple_media_video_init_recv\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
|
946 |
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
|
947 *recvbin = gst_bin_new("pidginrecvvideobin"); |
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
|
948 sink = gst_element_factory_make("autovideosink", "purplevideosink"); |
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
|
949 gst_bin_add(GST_BIN(*recvbin), sink); |
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
|
950 pad = gst_element_get_pad(sink, "sink"); |
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
|
951 ghost = gst_ghost_pad_new("ghostsink", pad); |
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
|
952 gst_element_add_pad(*recvbin, ghost); |
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
|
953 |
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
|
954 purple_debug_info("media", "purple_media_video_init_recv end\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
|
955 } |
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
|
956 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
957 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
|
958 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
|
959 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
|
960 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
|
961 { |
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
|
962 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
|
963 FsParticipant *participant; |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
964 FsCandidate *candidate; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
965 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
|
966 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
|
967 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
|
968 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
|
969 |
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
|
970 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
|
971 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
972 candidate = fs_candidate_copy(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
|
973 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
|
974 0, session->id, name, candidate); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
975 fs_candidate_destroy(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
|
976 |
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
|
977 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
|
978 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
979 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
980 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
|
981 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
|
982 { |
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
|
983 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
|
984 FsParticipant *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
|
985 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
|
986 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
|
987 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
|
988 g_signal_emit(session->media, purple_media_signals[CANDIDATES_PREPARED], 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
|
989 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
|
990 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
991 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
992 /* 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
|
993 * 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
|
994 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
|
995 purple_media_candidate_pair_established_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
|
996 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
|
997 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
|
998 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
|
999 { |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1000 FsCandidate *local = fs_candidate_copy(native_candidate); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1001 FsCandidate *remote = fs_candidate_copy(remote_candidate); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1002 |
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
|
1003 session->local_candidate = fs_candidate_copy(native_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
|
1004 session->remote_candidate = 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
|
1005 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1006 purple_debug_info("media", "candidate pair established\n"); |
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 g_signal_emit(session->media, purple_media_signals[CANDIDATE_PAIR], 0, |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1008 local, remote); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1009 |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1010 fs_candidate_destroy(local); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1011 fs_candidate_destroy(remote); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1012 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1013 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1014 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
|
1015 purple_media_src_pad_added_cb(FsStream *stream, GstPad *srcpad, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1016 FsCodec *codec, 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
|
1017 { |
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
|
1018 GstPad *sinkpad = gst_element_get_static_pad(session->sink, "ghostsink"); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1019 purple_debug_info("media", "connecting new src pad: %s\n", |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1020 gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK ? "success" : "failure"); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1021 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1022 |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1023 static gchar * |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1024 purple_media_get_stun_pref_ip() |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1025 { |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1026 const gchar *stun_pref = |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1027 purple_prefs_get_string("/purple/network/stun_server"); |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1028 struct hostent *host; |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1029 |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1030 if ((host = gethostbyname(stun_pref)) && host->h_addr) { |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1031 gchar *stun_ip = g_strdup_printf("%hhu.%hhu.%hhu.%hhu", |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1032 host->h_addr[0], host->h_addr[1], |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1033 host->h_addr[2], host->h_addr[3]); |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1034 purple_debug_info("media", "IP address for %s found: %s\n", |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1035 stun_pref, stun_ip); |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1036 return stun_ip; |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1037 } else { |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1038 purple_debug_info("media", "Unable to resolve %s IP address\n", |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1039 stun_pref); |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1040 return NULL; |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1041 } |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1042 } |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1043 |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1044 static 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
|
1045 purple_media_add_stream_internal(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
|
1046 const gchar *who, FsMediaType type, |
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 FsStreamDirection type_direction, |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1048 const gchar *transmitter, |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1049 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
|
1050 { |
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
|
1051 PurpleMediaSession *session = purple_media_get_session(media, 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
|
1052 FsParticipant *participant = NULL; |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1053 FsStream *stream = NULL; |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1054 FsStreamDirection *direction = NULL; |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1055 |
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
|
1056 if (!session) { |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1057 GError *err = NULL; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1058 GList *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
|
1059 |
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
|
1060 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
|
1061 |
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
|
1062 session->session = fs_conference_new_session(media->priv->conference, type, &err); |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1063 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1064 if (err != NULL) { |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1065 purple_debug_error("media", "Error creating session: %s\n", err->message); |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1066 g_error_free(err); |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1067 purple_conv_present_error(who, |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1068 purple_connection_get_account(purple_media_get_connection(media)), |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1069 _("Error creating 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
|
1070 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
|
1071 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1072 } |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1073 |
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
|
1074 /* |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1075 * The MPV codec didn't work for me. |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1076 * MPV may not work yet as of Farsight2 0.0.3 |
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 */ |
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 codec_conf = g_list_prepend(codec_conf, fs_codec_new(FS_CODEC_ID_DISABLE, |
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 "MPV", FS_MEDIA_TYPE_VIDEO, 90000)); |
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
|
1080 |
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
|
1081 /* 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
|
1082 #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
|
1083 /* 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
|
1084 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
|
1085 "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
|
1086 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
|
1087 "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
|
1088 #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
|
1089 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1090 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
|
1091 |
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
|
1092 /* |
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
|
1093 * Temporary fix to remove a 5-7 second delay before |
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
|
1094 * receiving the src-pad-added signal. |
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
|
1095 * Only works for one-to-one sessions. |
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
|
1096 * Specific to FsRtpSession. |
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
|
1097 */ |
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
|
1098 g_object_set(G_OBJECT(session->session), "no-rtcp-timeout", 0, NULL); |
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
|
1099 |
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
|
1100 |
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
|
1101 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
|
1102 |
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 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
|
1104 session->media = media; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
1105 session->type = purple_media_from_fs(type, type_direction); |
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
|
1106 |
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
|
1107 purple_media_add_session(media, 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
|
1108 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1109 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1110 if (!(participant = purple_media_add_participant(media, who))) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1111 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1112 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1113 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1114 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1115 |
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
|
1116 stream = purple_media_session_get_stream(session, 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
|
1117 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1118 if (!stream) { |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1119 GError *err = NULL; |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1120 gchar *stun_ip = NULL; |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1121 |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1122 if (!strcmp(transmitter, "rawudp") && |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1123 (stun_ip = purple_media_get_stun_pref_ip())) { |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1124 GParameter *param = g_new0(GParameter, num_params+2); |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1125 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
|
1126 |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1127 param[num_params].name = "stun-ip"; |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1128 g_value_init(¶m[num_params].value, G_TYPE_STRING); |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1129 g_value_take_string(¶m[num_params].value, stun_ip); |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1130 |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1131 param[num_params+1].name = "stun-timeout"; |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1132 g_value_init(¶m[num_params+1].value, G_TYPE_UINT); |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1133 g_value_set_uint(¶m[num_params+1].value, 5); |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1134 |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1135 stream = fs_session_new_stream(session->session, |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1136 participant, type_direction, |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1137 transmitter, num_params+2, param, &err); |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1138 g_free(param); |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1139 g_free(stun_ip); |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1140 } else { |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1141 stream = fs_session_new_stream(session->session, |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1142 participant, type_direction, |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1143 transmitter, 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
|
1144 } |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1145 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1146 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1147 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
|
1148 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1149 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1150 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
|
1151 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
|
1152 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1153 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1154 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1155 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1156 |
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
|
1157 purple_media_insert_stream(session, who, stream); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1158 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1159 /* callback for source pad added (new stream source ready) */ |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1160 g_signal_connect(G_OBJECT(stream), |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1161 "src-pad-added", G_CALLBACK(purple_media_src_pad_added_cb), session); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1162 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1163 } else if (*direction != type_direction) { |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1164 /* change direction */ |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1165 g_object_set(stream, "direction", type_direction, NULL); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1166 } |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1167 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1168 return TRUE; |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1169 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1170 |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1171 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
|
1172 purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, const gchar *who, |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
1173 PurpleMediaSessionType type, |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1174 const gchar *transmitter, |
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1175 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
|
1176 { |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1177 FsStreamDirection type_direction; |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1178 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1179 if (type & PURPLE_MEDIA_AUDIO) { |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
1180 type_direction = purple_media_to_fs_stream_direction(type & PURPLE_MEDIA_AUDIO); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1181 |
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
|
1182 if (!purple_media_add_stream_internal(media, sess_id, who, |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1183 FS_MEDIA_TYPE_AUDIO, type_direction, |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1184 transmitter, num_params, params)) { |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1185 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1186 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1187 } |
26010
3b4b9795f987
purple_media_add_stream should only add a stream to one session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26009
diff
changeset
|
1188 else if (type & PURPLE_MEDIA_VIDEO) { |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
1189 type_direction = purple_media_to_fs_stream_direction(type & PURPLE_MEDIA_VIDEO); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1190 |
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
|
1191 if (!purple_media_add_stream_internal(media, sess_id, who, |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1192 FS_MEDIA_TYPE_VIDEO, type_direction, |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1193 transmitter, num_params, params)) { |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1194 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1195 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1196 } |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1197 return TRUE; |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1198 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1199 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1200 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
|
1201 purple_media_remove_stream(PurpleMedia *media, const gchar *sess_id, const gchar *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
|
1202 { |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1203 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1204 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1205 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
1206 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
|
1207 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
|
1208 { |
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
|
1209 PurpleMediaSession *session = purple_media_get_session(media, 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
|
1210 return session->type; |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1211 } |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1212 /* 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
|
1213 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
|
1214 purple_media_get_local_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
|
1215 { |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1216 GList *codecs; |
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
|
1217 g_object_get(G_OBJECT(purple_media_get_session(media, sess_id)->session), |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1218 "codecs", &codecs, 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
|
1219 return codecs; |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1220 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1221 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1222 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
|
1223 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
|
1224 { |
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
|
1225 PurpleMediaSession *session = purple_media_get_session(media, sess_id); |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1226 return fs_candidate_list_copy( |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1227 purple_media_session_get_local_candidates(session, 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
|
1228 } |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1229 /* 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
|
1230 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
|
1231 purple_media_get_negotiated_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
|
1232 { |
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
|
1233 PurpleMediaSession *session = purple_media_get_session(media, 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
|
1234 GList *codec_intersection; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1235 g_object_get(session->session, "codecs", &codec_intersection, 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
|
1236 return codec_intersection; |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1237 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1238 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1239 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
|
1240 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
|
1241 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
|
1242 { |
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
|
1243 PurpleMediaSession *session = purple_media_get_session(media, 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
|
1244 FsStream *stream = purple_media_session_get_stream(session, name); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1245 GError *err = NULL; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1246 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1247 fs_stream_set_remote_candidates(stream, remote_candidates, &err); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1248 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1249 if (err) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1250 purple_debug_error("media", "Error adding remote candidates: %s\n", |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1251 err->message); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1252 g_error_free(err); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1253 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1254 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1255 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1256 FsCandidate * |
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
|
1257 purple_media_get_local_candidate(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
|
1258 { |
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
|
1259 PurpleMediaSession *session = purple_media_get_session(media, 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
|
1260 return session->local_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
|
1261 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1262 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1263 FsCandidate * |
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
|
1264 purple_media_get_remote_candidate(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
|
1265 { |
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
|
1266 PurpleMediaSession *session = purple_media_get_session(media, 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
|
1267 return session->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
|
1268 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1269 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1270 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
|
1271 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
|
1272 { |
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
|
1273 PurpleMediaSession *session = purple_media_get_session(media, 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
|
1274 FsStream *stream = purple_media_session_get_stream(session, name); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1275 GError *err = NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1276 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1277 fs_stream_set_remote_codecs(stream, codecs, &err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1278 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1279 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1280 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
|
1281 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1282 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1283 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1284 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1285 return TRUE; |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1286 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1287 |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1288 gboolean |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1289 purple_media_candidates_prepared(PurpleMedia *media, const gchar *name) |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1290 { |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1291 GList *sessions = purple_media_get_session_names(media); |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1292 |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1293 for (; sessions; sessions = sessions->next) { |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1294 const gchar *session = sessions->data; |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1295 if (!purple_media_get_local_candidate(media, session, name) || |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1296 !purple_media_get_remote_candidate(media, session, name)) |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1297 return FALSE; |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1298 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1299 |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1300 return TRUE; |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1301 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1302 |
25712
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1303 gboolean |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1304 purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, FsCodec *codec) |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1305 { |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1306 PurpleMediaSession *session = purple_media_get_session(media, sess_id); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1307 GError *err = NULL; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1308 |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1309 fs_session_set_send_codec(session->session, codec, &err); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1310 |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1311 if (err) { |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1312 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
|
1313 g_error_free(err); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1314 return FALSE; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1315 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1316 return TRUE; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1317 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1318 |
25713
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1319 void purple_media_mute(PurpleMedia *media, gboolean active) |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1320 { |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1321 GList *sessions = g_hash_table_get_values(media->priv->sessions); |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1322 purple_debug_info("media", "Turning mute %s\n", active ? "on" : "off"); |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1323 |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1324 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1325 PurpleMediaSession *session = sessions->data; |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1326 if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1327 GstElement *volume = gst_bin_get_by_name( |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1328 GST_BIN(session->src), |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
1329 "purpleaudioinputvolume"); |
25713
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1330 g_object_set(volume, "mute", active, NULL); |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1331 } |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1332 } |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1333 } |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1334 |
25654
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25651
diff
changeset
|
1335 #endif /* USE_VV */ |