Mercurial > pidgin.yaz
annotate libpurple/media.c @ 26072:266c3cc02e0e
Move functionality to the state-changed signal.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Mon, 05 Jan 2009 10:21:56 +0000 |
parents | 8dba34f5f21a |
children | 2cf44cc855fe |
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 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
43 /** @copydoc _PurpleMediaSession */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
44 typedef struct _PurpleMediaSession PurpleMediaSession; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
45 /** @copydoc _PurpleMediaStream */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
46 typedef struct _PurpleMediaStream PurpleMediaStream; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
47 |
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
|
48 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
|
49 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
50 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
|
51 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
|
52 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
|
53 FsSession *session; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
54 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
55 PurpleMediaSessionType type; |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
56 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
57 gboolean codecs_ready; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
58 gboolean accepted; |
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
|
59 }; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
61 struct _PurpleMediaStream |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
62 { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
63 PurpleMediaSession *session; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
64 gchar *participant; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
65 FsStream *stream; |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
66 GstElement *sink; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
67 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
68 GList *local_candidates; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
69 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
70 gboolean candidates_prepared; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
71 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
72 FsCandidate *local_candidate; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
73 FsCandidate *remote_candidate; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
74 }; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
75 |
25546 | 76 struct _PurpleMediaPrivate |
77 { | |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
78 FsConference *conference; |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
79 gboolean initiator; |
25546 | 80 |
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
|
81 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
|
82 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
|
83 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
84 GList *streams; /* PurpleMediaStream table */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
85 |
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
|
86 GstElement *pipeline; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
87 |
25546 | 88 }; |
89 | |
90 #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) | |
91 | |
92 static void purple_media_class_init (PurpleMediaClass *klass); | |
93 static void purple_media_init (PurpleMedia *media); | |
94 static void purple_media_finalize (GObject *object); | |
95 static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
96 static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
97 | |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
98 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
|
99 FsCandidate *local_candidate, PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
100 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
|
101 PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
102 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
|
103 FsCandidate *native_candidate, FsCandidate *remote_candidate, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
104 PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
105 |
25546 | 106 static GObjectClass *parent_class = NULL; |
107 | |
108 | |
109 | |
110 enum { | |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
111 ERROR, |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
112 READY, |
25643
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
113 WAIT, |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
114 ACCEPTED, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
115 HANGUP, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
116 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
|
117 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
|
118 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
|
119 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
|
120 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
|
121 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
|
122 CANDIDATE_PAIR, |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
123 CODECS_READY, |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
124 READY_NEW, |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
125 STATE_CHANGED, |
25546 | 126 LAST_SIGNAL |
127 }; | |
128 static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
129 | |
130 enum { | |
131 PROP_0, | |
26061
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
132 PROP_CONFERENCE, |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
133 PROP_INITIATOR, |
25546 | 134 }; |
135 | |
136 GType | |
137 purple_media_get_type() | |
138 { | |
139 static GType type = 0; | |
140 | |
141 if (type == 0) { | |
142 static const GTypeInfo info = { | |
143 sizeof(PurpleMediaClass), | |
144 NULL, | |
145 NULL, | |
146 (GClassInitFunc) purple_media_class_init, | |
147 NULL, | |
148 NULL, | |
149 sizeof(PurpleMedia), | |
150 0, | |
25560
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25552
diff
changeset
|
151 (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
|
152 NULL |
25546 | 153 }; |
154 type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
155 } | |
156 return type; | |
157 } | |
158 | |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
159 GType |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
160 purple_media_state_changed_get_type() |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
161 { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
162 static GType type = 0; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
163 if (type == 0) { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
164 static const GEnumValue values[] = { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
165 { PURPLE_MEDIA_STATE_CHANGED_NEW, "PURPLE_MEDIA_STATE_CHANGED_NEW", "new" }, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
166 { PURPLE_MEDIA_STATE_CHANGED_CONNECTED, "PURPLE_MEDIA_STATE_CHANGED_CONNECTED", "connected" }, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
167 { PURPLE_MEDIA_STATE_CHANGED_END, "PURPLE_MEDIA_STATE_CHANGED_END", "end" }, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
168 { 0, NULL, NULL } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
169 }; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
170 type = g_enum_register_static("PurpleMediaStateChangedType", values); |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
171 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
172 return type; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
173 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
174 |
25546 | 175 static void |
176 purple_media_class_init (PurpleMediaClass *klass) | |
177 { | |
178 GObjectClass *gobject_class = (GObjectClass*)klass; | |
179 parent_class = g_type_class_peek_parent(klass); | |
180 | |
181 gobject_class->finalize = purple_media_finalize; | |
182 gobject_class->set_property = purple_media_set_property; | |
183 gobject_class->get_property = purple_media_get_property; | |
184 | |
26061
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
185 g_object_class_install_property(gobject_class, PROP_CONFERENCE, |
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
186 g_param_spec_object("conference", |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
187 "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
|
188 "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
|
189 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
|
190 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
25546 | 191 |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
192 g_object_class_install_property(gobject_class, PROP_INITIATOR, |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
193 g_param_spec_boolean("initiator", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
194 "initiator", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
195 "If the local user initiated the conference.", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
196 FALSE, |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
197 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
198 |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
199 purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
200 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
201 g_cclosure_marshal_VOID__STRING, |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
202 G_TYPE_NONE, 1, G_TYPE_STRING); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
203 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
|
204 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
|
205 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
|
206 G_TYPE_NONE, 0); |
25643
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
207 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
|
208 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
209 g_cclosure_marshal_VOID__VOID, |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
210 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
|
211 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
|
212 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
|
213 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
|
214 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
|
215 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
|
216 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
|
217 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
|
218 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
|
219 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
|
220 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
|
221 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
|
222 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
|
223 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
|
224 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
|
225 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
|
226 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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 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
|
238 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
|
239 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
|
240 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
|
241 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
26014
bd598b606ca4
Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26013
diff
changeset
|
242 purple_smarshal_VOID__STRING_STRING, |
bd598b606ca4
Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26013
diff
changeset
|
243 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
244 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
|
245 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
|
246 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
|
247 G_TYPE_NONE, 2, FS_TYPE_CANDIDATE, FS_TYPE_CANDIDATE); |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
248 purple_media_signals[CODECS_READY] = g_signal_new("codecs-ready", G_TYPE_FROM_CLASS(klass), |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
249 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
250 g_cclosure_marshal_VOID__STRING, |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
251 G_TYPE_NONE, 1, G_TYPE_STRING); |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
252 purple_media_signals[READY_NEW] = g_signal_new("ready-new", G_TYPE_FROM_CLASS(klass), |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
253 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
254 purple_smarshal_VOID__STRING_STRING, |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
255 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
256 purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
257 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
258 purple_smarshal_VOID__ENUM_STRING_STRING, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
259 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE_CHANGED, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
260 G_TYPE_STRING, G_TYPE_STRING); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
261 g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
25546 | 262 } |
263 | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
264 |
25546 | 265 static void |
266 purple_media_init (PurpleMedia *media) | |
267 { | |
268 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
|
269 memset(media->priv, 0, sizeof(media->priv)); |
25546 | 270 } |
271 | |
272 static void | |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
273 purple_media_stream_free(PurpleMediaStream *stream) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
274 { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
275 g_free(stream->participant); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
276 g_object_unref(stream->stream); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
277 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
278 if (stream->local_candidates) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
279 fs_candidate_list_destroy(stream->local_candidates); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
280 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
281 if (stream->local_candidate) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
282 fs_candidate_destroy(stream->local_candidate); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
283 if (stream->remote_candidate) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
284 fs_candidate_destroy(stream->remote_candidate); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
285 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
286 g_free(stream); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
287 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
288 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
289 static void |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
290 purple_media_session_free(PurpleMediaSession *session) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
291 { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
292 g_free(session->id); |
26057
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26056
diff
changeset
|
293 g_object_unref(session->session); |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
294 g_free(session); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
295 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
296 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
297 static void |
25546 | 298 purple_media_finalize (GObject *media) |
299 { | |
25661
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
300 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
|
301 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
|
302 |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
303 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
|
304 PURPLE_MEDIA(media)); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
305 |
26057
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26056
diff
changeset
|
306 for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams)) |
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26056
diff
changeset
|
307 purple_media_stream_free(priv->streams->data); |
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26056
diff
changeset
|
308 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
309 if (priv->sessions) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
310 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
|
311 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
312 purple_media_session_free(sessions->data); |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
313 } |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
314 g_hash_table_destroy(priv->sessions); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
315 } |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
316 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
317 if (priv->participants) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
318 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
|
319 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
|
320 g_object_unref(participants->data); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
321 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
|
322 } |
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25702
diff
changeset
|
323 |
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
|
324 if (priv->pipeline) { |
25731
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
325 GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(priv->pipeline)); |
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
326 gst_bus_remove_signal_watch(bus); |
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
327 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
|
328 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
|
329 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
|
330 } |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
331 |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
332 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
|
333 |
25546 | 334 parent_class->finalize(media); |
335 } | |
336 | |
337 static void | |
338 purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
339 { | |
340 PurpleMedia *media; | |
341 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
|
342 |
25546 | 343 media = PURPLE_MEDIA(object); |
344 | |
345 switch (prop_id) { | |
26061
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
346 case PROP_CONFERENCE: |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
347 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
|
348 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
|
349 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
|
350 g_object_ref(media->priv->conference); |
25546 | 351 break; |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
352 case PROP_INITIATOR: |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
353 media->priv->initiator = g_value_get_boolean(value); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
354 break; |
25546 | 355 default: |
356 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
357 break; | |
358 } | |
359 } | |
360 | |
361 static void | |
362 purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
363 { | |
364 PurpleMedia *media; | |
365 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
366 | |
367 media = PURPLE_MEDIA(object); | |
368 | |
369 switch (prop_id) { | |
26061
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
370 case PROP_CONFERENCE: |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
371 g_value_set_object(value, media->priv->conference); |
25546 | 372 break; |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
373 case PROP_INITIATOR: |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
374 g_value_set_boolean(value, media->priv->initiator); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
375 break; |
25546 | 376 default: |
377 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
378 break; | |
379 } | |
380 | |
381 } | |
382 | |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
383 FsMediaType |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
384 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
|
385 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
386 if (type & PURPLE_MEDIA_AUDIO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
387 return FS_MEDIA_TYPE_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
388 else if (type & PURPLE_MEDIA_VIDEO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
389 return FS_MEDIA_TYPE_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
390 else |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
391 return 0; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
392 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
393 |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
394 FsStreamDirection |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
395 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
|
396 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
397 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
|
398 (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
|
399 return FS_DIRECTION_BOTH; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
400 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
|
401 (type & PURPLE_MEDIA_SEND_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
402 return FS_DIRECTION_SEND; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
403 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
|
404 (type & PURPLE_MEDIA_RECV_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
405 return FS_DIRECTION_RECV; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
406 else |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
407 return FS_DIRECTION_NONE; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
408 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
409 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
410 PurpleMediaSessionType |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
411 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
|
412 { |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
413 PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
414 if (type == FS_MEDIA_TYPE_AUDIO) { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
415 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
416 result |= PURPLE_MEDIA_SEND_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
417 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
418 result |= PURPLE_MEDIA_RECV_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
419 } 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
|
420 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
421 result |= PURPLE_MEDIA_SEND_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
422 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
423 result |= PURPLE_MEDIA_RECV_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
424 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
425 return result; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
426 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
427 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
428 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
|
429 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
|
430 { |
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
|
431 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
|
432 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
|
433 |
25702
a1a1f44cdecc
Fixed some memory leak issues involving GLists.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25696
diff
changeset
|
434 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
|
435 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
|
436 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
|
437 } |
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
|
438 |
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
|
439 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
|
440 } |
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
|
441 |
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
|
442 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
|
443 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
|
444 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
445 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
|
446 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
|
447 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
450 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
|
451 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
452 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
|
453 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
|
454 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
456 static PurpleMediaStream* |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
457 purple_media_get_stream(PurpleMedia *media, const gchar *session, const gchar *participant) |
25671
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
458 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
459 GList *streams = media->priv->streams; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
460 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
461 for (; streams; streams = g_list_next(streams)) { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
462 PurpleMediaStream *stream = streams->data; |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
463 if (!strcmp(stream->session->id, session) && |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
464 !strcmp(stream->participant, participant)) |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
465 return stream; |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
466 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
467 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
468 return NULL; |
25671
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
469 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
470 |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
471 static GList * |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
472 purple_media_get_streams(PurpleMedia *media, const gchar *session, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
473 const gchar *participant) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
474 { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
475 GList *streams = media->priv->streams; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
476 GList *ret = NULL; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
477 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
478 for (; streams; streams = g_list_next(streams)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
479 PurpleMediaStream *stream = streams->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
480 if ((session == NULL || |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
481 !strcmp(stream->session->id, session)) && |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
482 (participant == NULL || |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
483 !strcmp(stream->participant, participant))) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
484 ret = g_list_append(ret, stream); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
485 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
486 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
487 return ret; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
488 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
489 |
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
|
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_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
|
492 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
494 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
|
495 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
|
496 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
498 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
500 static gboolean |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
501 purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
502 { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
503 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
|
504 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
505 |
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
|
506 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
|
507 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
|
508 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
510 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
|
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 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
|
513 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
|
514 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
515 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
|
516 (gchar*)name, &err); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
517 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
518 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
519 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
|
520 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
521 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
522 return NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
523 } |
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
|
524 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
525 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
|
526 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
|
527 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
|
528 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
|
529 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
530 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
531 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
|
532 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
533 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
|
534 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
535 |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
536 static PurpleMediaStream * |
25671
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
537 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
|
538 { |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
539 PurpleMediaStream *media_stream = g_new0(PurpleMediaStream, 1); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
540 media_stream->stream = stream; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
541 media_stream->participant = g_strdup(name); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
542 media_stream->session = session; |
25671
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
543 |
26038
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
544 session->media->priv->streams = |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26036
diff
changeset
|
545 g_list_append(session->media->priv->streams, media_stream); |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
546 |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
547 return media_stream; |
25671
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
548 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
551 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
|
552 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
|
553 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
554 PurpleMediaStream *stream = purple_media_get_stream(session->media, session->id, name); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
555 stream->local_candidates = g_list_append(stream->local_candidates, candidate); |
25671
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
556 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
559 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
|
560 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
562 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
563 |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
564 void |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
565 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
|
566 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
|
567 { |
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
|
568 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
|
569 |
25702
a1a1f44cdecc
Fixed some memory leak issues involving GLists.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25696
diff
changeset
|
570 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
|
571 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
|
572 |
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
|
573 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
|
574 *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
|
575 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
|
576 *video_src = session->src; |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
577 } |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
578 |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
579 values = media->priv->streams; |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
580 for (; values; values = g_list_next(values)) { |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
581 PurpleMediaStream *stream = (PurpleMediaStream*)values->data; |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
582 |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
583 if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO && audio_sink) |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
584 *audio_sink = stream->sink; |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
585 if (stream->session->type & PURPLE_MEDIA_RECV_VIDEO && video_sink) |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
586 *video_sink = stream->sink; |
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
|
587 } |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
588 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
589 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
590 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
|
591 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
|
592 { |
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
|
593 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
|
594 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
|
595 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
|
596 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
597 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
|
598 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
|
599 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
|
600 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
|
601 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
|
602 |
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
|
603 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
|
604 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
|
605 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
|
606 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
|
607 ? "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
|
608 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
609 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
610 void |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
611 purple_media_set_sink(PurpleMedia *media, const gchar *sess_id, |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
612 const gchar *participant, 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
|
613 { |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
614 PurpleMediaStream *stream = |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
615 purple_media_get_stream(media, sess_id, participant); |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
616 |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
617 if (stream->sink) |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
618 gst_object_unref(stream->sink); |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
619 stream->sink = 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
|
620 gst_bin_add(GST_BIN(purple_media_get_pipeline(media)), |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
621 stream->sink); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
622 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
623 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
624 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
|
625 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
|
626 { |
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
|
627 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
|
628 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
629 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
630 GstElement * |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
631 purple_media_get_sink(PurpleMedia *media, const gchar *sess_id, const gchar *participant) |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
632 { |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
633 return purple_media_get_stream(media, sess_id, participant)->sink; |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
634 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
635 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
636 static PurpleMediaSession * |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
637 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
|
638 { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
639 FsSession *fssession; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
640 GList *values; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
641 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
642 g_object_get(stream, "session", &fssession, NULL); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
643 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
644 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
|
645 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
646 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
|
647 PurpleMediaSession *session = values->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
648 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
649 if (session->session == fssession) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
650 g_list_free(values); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
651 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
652 return session; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
653 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
654 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
655 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
656 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
657 return NULL; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
658 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
659 |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
660 /* This could also emit when participants are ready */ |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
661 static void |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
662 purple_media_emit_ready(PurpleMedia *media, PurpleMediaSession *session, const gchar *participant) |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
663 { |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
664 GList *sessions; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
665 gboolean conf_ready = TRUE; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
666 |
26066
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
667 if ((session != NULL) && ((media->priv->initiator == FALSE && |
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
668 session->accepted == FALSE) || |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
669 (purple_media_codecs_ready(media, session->id) == FALSE))) |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
670 return; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
671 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
672 sessions = g_hash_table_get_values(media->priv->sessions); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
673 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
674 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
675 PurpleMediaSession *session_data = sessions->data; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
676 GList *streams = purple_media_get_streams(media, |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
677 session_data->id, NULL); |
26066
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
678 gboolean session_ready = TRUE; |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
679 |
26066
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
680 if ((media->priv->initiator == FALSE && |
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
681 session_data->accepted == FALSE) || |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
682 (purple_media_codecs_ready( |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
683 media, session_data->id) == FALSE)) |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
684 conf_ready = FALSE; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
685 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
686 for (; streams; streams = g_list_delete_link(streams, streams)) { |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
687 PurpleMediaStream *stream = streams->data; |
26066
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
688 if (stream->candidates_prepared == FALSE) { |
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
689 session_ready = FALSE; |
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
690 conf_ready = FALSE; |
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
691 } else if (session_data == session) |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
692 g_signal_emit(media, purple_media_signals[READY_NEW], |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
693 0, session_data->id, stream->participant); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
694 } |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
695 |
26066
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
696 if (session_ready == TRUE && |
607d82dce00e
Have XMPP use the new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26065
diff
changeset
|
697 (session == session_data || session == NULL)) |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
698 g_signal_emit(media, purple_media_signals[READY_NEW], |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
699 0, session_data->id, NULL); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
700 } |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
701 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
702 if (conf_ready == TRUE) { |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
703 g_signal_emit(media, purple_media_signals[READY_NEW], |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
704 0, NULL, NULL); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
705 } |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
706 } |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
707 |
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
|
708 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
|
709 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
|
710 { |
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
|
711 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
|
712 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
|
713 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
|
714 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
|
715 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
|
716 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
|
717 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
|
718 |
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
|
719 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
|
720 |
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
|
721 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
|
722 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
|
723 |
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
|
724 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
|
725 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
|
726 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
|
727 } |
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
|
728 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
|
729 } |
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
|
730 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
|
731 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
|
732 FsError error_no; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
733 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
|
734 FS_TYPE_ERROR, (gint*)&error_no); |
26008
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
735 /* |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
736 * 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
|
737 * multicast transmitter which isn't used. |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
738 */ |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
739 if (error_no != FS_ERROR_UNKNOWN_CNAME) |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26007
diff
changeset
|
740 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
|
741 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
|
742 } 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
|
743 "farsight-new-local-candidate")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
744 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
|
745 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
|
746 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
|
747 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
|
748 } 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
|
749 "farsight-local-candidates-prepared")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
750 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
|
751 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
|
752 purple_media_candidates_prepared_cb(stream, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
753 } 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
|
754 "farsight-new-active-candidate-pair")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
755 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
|
756 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
|
757 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
|
758 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
|
759 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
|
760 } 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
|
761 "farsight-recv-codecs-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
762 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
|
763 FsCodec *codec = codecs->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
764 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
|
765 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
766 } 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
|
767 "farsight-component-state-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
768 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
769 } 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
|
770 "farsight-send-codec-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
771 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
772 } 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
|
773 "farsight-codecs-changed")) { |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
774 GList *sessions = g_hash_table_get_values(PURPLE_MEDIA(media)->priv->sessions); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
775 FsSession *fssession = g_value_get_object(gst_structure_get_value(msg->structure, "session")); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
776 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
777 PurpleMediaSession *session = sessions->data; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
778 if (session->session == fssession) { |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
779 gboolean ready; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
780 g_object_get(session->session, "codecs-ready", &ready, NULL); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
781 if (session->codecs_ready == FALSE && ready == TRUE) { |
26067
b0e6a64cbf2e
Use the new ready signal instead of accept to send a session-accept.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26066
diff
changeset
|
782 session->codecs_ready = ready; |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
783 g_signal_emit(session->media, |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
784 purple_media_signals[CODECS_READY], |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
785 0, session->id); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
786 purple_media_emit_ready(media, session, NULL); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
787 } |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
788 |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
789 g_list_free(sessions); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
790 break; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
791 } |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
792 } |
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
|
793 } |
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
|
794 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
|
795 } |
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
|
796 default: |
25732
d6bda7b63eac
Remove a bunch of extraneous GstBus messages from the debug output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25731
diff
changeset
|
797 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
|
798 } |
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
|
799 |
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
|
800 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
|
801 } |
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
|
802 |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
803 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
|
804 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
|
805 { |
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
|
806 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
|
807 GstBus *bus; |
26060
0829a08038c6
Remove the screenname attribute from PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26059
diff
changeset
|
808 media->priv->pipeline = gst_pipeline_new(NULL); |
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
|
809 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
|
810 gst_bus_add_signal_watch(GST_BUS(bus)); |
25731
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
811 g_signal_connect(G_OBJECT(bus), "message", |
ba609f368dc8
Fix GStreamer assertion.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25730
diff
changeset
|
812 G_CALLBACK(media_bus_call), media); |
26053
99c3489e06b0
Wait for local video frame to be realized before starting local video.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26052
diff
changeset
|
813 gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL); |
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
|
814 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
|
815 |
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
|
816 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
|
817 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
818 |
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
|
819 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
|
820 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
821 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
822 void |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
823 purple_media_error(PurpleMedia *media, const gchar *error, ...) |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
824 { |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
825 va_list args; |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
826 gchar *message; |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
827 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
828 va_start(args, error); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
829 message = g_strdup_vprintf(error, args); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
830 va_end(args); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
831 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
832 purple_debug_error("media", "%s\n", message); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
833 g_signal_emit(media, purple_media_signals[ERROR], 0, message); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
834 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
835 g_free(message); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
836 } |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
837 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
838 void |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
839 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
|
840 { |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
841 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
|
842 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
843 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
844 void |
25643
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
845 purple_media_wait(PurpleMedia *media) |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
846 { |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
847 g_signal_emit(media, purple_media_signals[WAIT], 0); |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
848 } |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
849 |
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25637
diff
changeset
|
850 void |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
851 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
|
852 { |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
853 GList *sessions; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
854 |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
855 g_signal_emit(media, purple_media_signals[ACCEPTED], 0); |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
856 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
857 sessions = g_hash_table_get_values(media->priv->sessions); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
858 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
859 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
860 PurpleMediaSession *session = sessions->data; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
861 session->accepted = TRUE; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
862 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
863 purple_media_emit_ready(media, session, NULL); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
864 } |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
865 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
866 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
867 void |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
868 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
|
869 { |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
870 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
871 0, PURPLE_MEDIA_STATE_CHANGED_END, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
872 NULL, NULL); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
873 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
|
874 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
875 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
876 void |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
877 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
|
878 { |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
879 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
880 0, PURPLE_MEDIA_STATE_CHANGED_END, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
881 NULL, NULL); |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
882 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
|
883 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
884 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
885 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
|
886 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
|
887 { |
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
|
888 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
|
889 } |
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
|
890 |
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
|
891 void |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
892 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
|
893 { |
26071
8dba34f5f21a
Temporarily fix an oversight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26069
diff
changeset
|
894 /* |
8dba34f5f21a
Temporarily fix an oversight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26069
diff
changeset
|
895 * There's no way to tell who hung up with the new structure. |
8dba34f5f21a
Temporarily fix an oversight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26069
diff
changeset
|
896 * I'm commenting this out until this is resolved. |
8dba34f5f21a
Temporarily fix an oversight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26069
diff
changeset
|
897 */ |
8dba34f5f21a
Temporarily fix an oversight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26069
diff
changeset
|
898 #if 0 |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
899 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
900 0, PURPLE_MEDIA_STATE_CHANGED_END, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
901 NULL, NULL); |
26071
8dba34f5f21a
Temporarily fix an oversight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26069
diff
changeset
|
902 #endif |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
903 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
|
904 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25546
diff
changeset
|
905 |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
906 void |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
907 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
|
908 { |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
909 GList *sessions; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
910 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
911 g_signal_emit(media, purple_media_signals[GOT_ACCEPT], 0); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
912 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
913 sessions = g_hash_table_get_values(media->priv->sessions); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
914 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
915 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
916 PurpleMediaSession *session = sessions->data; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
917 session->accepted = TRUE; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
918 } |
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 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
921 GList* |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
922 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
|
923 { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
924 GObjectClass *klass; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
925 GstPropertyProbe *probe; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
926 const GParamSpec *pspec; |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
927 GstElement *element = gst_element_factory_make(plugin, NULL); |
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
928 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
|
929 const gchar *longname = NULL; |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
930 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
|
931 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
932 if (element == NULL) |
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
933 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
|
934 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
935 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
|
936 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
937 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
|
938 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
|
939 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
940 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
|
941 !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
|
942 !(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
|
943 !(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
|
944 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
|
945 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
|
946 } else { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
947 gint n; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
948 gchar *name; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
949 GValueArray *array; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
950 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
951 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
|
952 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
953 /* 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
|
954 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
|
955 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
|
956 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
|
957 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
|
958 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
959 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
960 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
961 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
|
962 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
|
963 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
|
964 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
|
965 |
4b8c64deac5e
Simplify device API. Use gchar* instead of GValue.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25736
diff
changeset
|
966 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
|
967 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
968 g_object_set(G_OBJECT(element), "device", |
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
969 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
|
970 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
|
971 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
|
972 longname, GST_PLUGIN_FEATURE (factory)->name, |
6bf2dfb350c0
Fix video plugin/device preference and preview.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
973 name, g_value_get_string(device)); |
6bf2dfb350c0
Fix video plugin/device preference and preview.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
974 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
|
975 } |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
976 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
|
977 } |
25734
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
978 |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
979 /* Restore autoprobe[-fps] to TRUE. */ |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
980 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
|
981 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
|
982 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
|
983 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
|
984 } |
9104d46df299
Restore autoprobe property when finished probing for devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
985 } |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
986 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
987 |
26011
e8b8c6b14196
Simplified purple_media_get_devices.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26010
diff
changeset
|
988 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
|
989 return ret; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
990 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
991 |
25737
4b8c64deac5e
Simplify device API. Use gchar* instead of GValue.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25736
diff
changeset
|
992 gchar * |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
993 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
|
994 { |
25737
4b8c64deac5e
Simplify device API. Use gchar* instead of GValue.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25736
diff
changeset
|
995 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
|
996 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
|
997 return device; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
998 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
999 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1000 void |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1001 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
|
1002 { |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1003 GstElement *src; |
25713
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1004 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
|
1005 GstPad *pad; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1006 GstPad *ghost; |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1007 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
|
1008 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
|
1009 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1010 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
|
1011 |
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
|
1012 *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
|
1013 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
|
1014 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
|
1015 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
|
1016 *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
|
1017 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
|
1018 gst_element_link(src, volume); |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1019 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
|
1020 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
|
1021 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
|
1022 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
|
1023 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
|
1024 |
26007
943a09762d95
Removed several PurpleMedia functions that now seem unnecessary:
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26005
diff
changeset
|
1025 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
|
1026 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
|
1027 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1028 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1029 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
|
1030 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
|
1031 { |
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
|
1032 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
|
1033 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
|
1034 GstPad *ghost; |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
1035 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
|
1036 "/purple/media/video/plugin"); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
1037 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
|
1038 "/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
|
1039 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1040 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
|
1041 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1042 *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
|
1043 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
|
1044 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
|
1045 |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1046 tee = gst_element_factory_make("tee", "purplevideosrctee"); |
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
|
1047 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
|
1048 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
|
1049 |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
1050 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
|
1051 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
|
1052 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
|
1053 |
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
|
1054 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
|
1055 /* 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
|
1056 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
|
1057 } |
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
|
1058 |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1059 pad = gst_element_get_static_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
|
1060 ghost = gst_ghost_pad_new("ghostsrc", pad); |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1061 gst_object_unref(pad); |
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
|
1062 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
|
1063 |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1064 queue = gst_element_factory_make("queue", "purplelocalvideoqueue"); |
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
|
1065 gst_bin_add(GST_BIN(*sendbin), queue); |
26027
94224a5563db
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1066 gst_element_link(tee, queue); |
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
|
1067 |
3bf9748fdef0
Preliminary video embedded in the conversation window. It's still kind of buggy.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25680
diff
changeset
|
1068 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
|
1069 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
|
1070 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
|
1071 |
26007
943a09762d95
Removed several PurpleMedia functions that now seem unnecessary:
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26005
diff
changeset
|
1072 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
|
1073 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
|
1074 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1075 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1076 void |
25637
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1077 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
|
1078 { |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
1079 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
|
1080 GstPad *pad, *ghost; |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
1081 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
|
1082 "/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
|
1083 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1084 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
|
1085 |
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
|
1086 *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
|
1087 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
|
1088 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
|
1089 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
|
1090 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
|
1091 *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
|
1092 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
|
1093 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
|
1094 gst_element_link(volume, *recvlevel); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
1095 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
|
1096 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
|
1097 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
|
1098 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
|
1099 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1100 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
|
1101 } |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25560
diff
changeset
|
1102 |
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
|
1103 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
|
1104 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
|
1105 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, 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 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
|
1107 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
|
1108 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1109 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
|
1110 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1111 *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
|
1112 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
|
1113 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
|
1114 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
|
1115 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
|
1116 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
|
1117 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1118 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
|
1119 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1120 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1121 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
|
1122 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
|
1123 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
|
1124 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
|
1125 { |
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
|
1126 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
|
1127 FsParticipant *participant; |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1128 FsCandidate *candidate; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1129 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
|
1130 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
|
1131 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
|
1132 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
|
1133 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1134 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
|
1135 |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1136 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
|
1137 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
|
1138 0, session->id, name, candidate); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1139 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
|
1140 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1141 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
|
1142 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1143 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1144 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
|
1145 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
|
1146 { |
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
|
1147 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
|
1148 FsParticipant *participant; |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1149 PurpleMediaStream *stream_data; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1150 |
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
|
1151 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
|
1152 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
|
1153 g_object_unref(participant); |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1154 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1155 stream_data = purple_media_get_stream(session->media, session->id, name); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1156 stream_data->candidates_prepared = TRUE; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1157 |
26014
bd598b606ca4
Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26013
diff
changeset
|
1158 g_signal_emit(session->media, purple_media_signals[CANDIDATES_PREPARED], |
bd598b606ca4
Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26013
diff
changeset
|
1159 0, session->id, name); |
26065
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1160 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1161 purple_media_emit_ready(session->media, session, name); |
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
|
1162 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
|
1163 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1164 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1165 /* 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
|
1166 * 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
|
1167 static void |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1168 purple_media_candidate_pair_established_cb(FsStream *fsstream, |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1169 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
|
1170 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
|
1171 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
|
1172 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1173 gchar *name; |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1174 FsParticipant *participant; |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1175 FsCandidate *local = fs_candidate_copy(native_candidate); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1176 FsCandidate *remote = fs_candidate_copy(remote_candidate); |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1177 PurpleMediaStream *stream; |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1178 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1179 g_object_get(fsstream, "participant", &participant, NULL); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1180 g_object_get(participant, "cname", &name, NULL); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1181 g_object_unref(participant); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1182 |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1183 stream = purple_media_get_stream(session->media, session->id, name); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1184 |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1185 stream->local_candidate = fs_candidate_copy(native_candidate); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1186 stream->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
|
1187 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1188 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
|
1189 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
|
1190 local, remote); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1191 |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1192 fs_candidate_destroy(local); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1193 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
|
1194 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1195 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1196 static void |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1197 purple_media_src_pad_added_cb(FsStream *fsstream, GstPad *srcpad, |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1198 FsCodec *codec, PurpleMediaStream *stream) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1199 { |
26027
94224a5563db
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1200 PurpleMediaSessionType type = purple_media_from_fs(codec->media_type, FS_DIRECTION_RECV); |
94224a5563db
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1201 GstPad *sinkpad = NULL; |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1202 |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1203 stream->sink = purple_media_manager_get_element( |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1204 purple_media_manager_get(), type); |
26027
94224a5563db
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1205 |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1206 gst_bin_add(GST_BIN(purple_media_get_pipeline(stream->session->media)), |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1207 stream->sink); |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1208 sinkpad = gst_element_get_static_pad(stream->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
|
1209 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
|
1210 gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK ? "success" : "failure"); |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1211 gst_element_set_state(stream->sink, GST_STATE_PLAYING); |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1212 |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1213 g_signal_emit(stream->session->media, purple_media_signals[STATE_CHANGED], |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1214 0, PURPLE_MEDIA_STATE_CHANGED_CONNECTED, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1215 stream->session->id, stream->participant); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1216 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1217 |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1218 static gchar * |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1219 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
|
1220 { |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1221 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
|
1222 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
|
1223 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
|
1224 |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1225 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
|
1226 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
|
1227 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
|
1228 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
|
1229 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
|
1230 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
|
1231 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
|
1232 } else { |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1233 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
|
1234 stun_pref); |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1235 return NULL; |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1236 } |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1237 } |
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1238 |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1239 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
|
1240 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
|
1241 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
|
1242 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
|
1243 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
|
1244 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
|
1245 { |
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
|
1246 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
|
1247 FsParticipant *participant = NULL; |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1248 PurpleMediaStream *stream = 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
|
1249 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
|
1250 |
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
|
1251 if (!session) { |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1252 GError *err = NULL; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1253 GList *codec_conf = NULL; |
26024
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1254 gchar *filename = 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
|
1255 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1256 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
|
1257 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1258 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
|
1259 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1260 if (err != NULL) { |
26058
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1261 purple_media_error(media, "Error creating session: %s\n", err->message); |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1262 g_error_free(err); |
25671
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1263 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
|
1264 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1265 } |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1266 |
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
|
1267 /* 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
|
1268 #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
|
1269 /* 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
|
1270 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
|
1271 "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
|
1272 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
|
1273 "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
|
1274 #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
|
1275 |
26024
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1276 filename = g_build_filename(purple_user_dir(), "fs-codec.conf", NULL); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1277 codec_conf = fs_codec_list_from_keyfile(filename, &err); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1278 g_free(filename); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1279 |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1280 if (err != NULL) { |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1281 purple_debug_error("media", "Error reading codec configuration file: %s\n", err->message); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1282 g_error_free(err); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1283 } |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26014
diff
changeset
|
1284 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1285 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
|
1286 |
26056
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1287 /* |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1288 * Removes a 5-7 second delay before |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1289 * receiving the src-pad-added signal. |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1290 * Only works for non-multicast FsRtpSessions. |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1291 */ |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1292 if (!strcmp(transmitter, "nice") || !strcmp(transmitter, "rawudp")) |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1293 g_object_set(G_OBJECT(session->session), |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26055
diff
changeset
|
1294 "no-rtcp-timeout", 0, NULL); |
25676
157b30b530f4
Temporary fix to remove a 5-7 second delay when initiating a media session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25674
diff
changeset
|
1295 |
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
|
1296 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
|
1297 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1298 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
|
1299 session->media = media; |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
1300 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
|
1301 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25661
diff
changeset
|
1302 purple_media_add_session(media, session); |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1303 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1304 0, PURPLE_MEDIA_STATE_CHANGED_NEW, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1305 session->id, NULL); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1306 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1307 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1308 if (!(participant = purple_media_add_participant(media, who))) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1309 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1310 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1311 return FALSE; |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1312 } else { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1313 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1314 0, PURPLE_MEDIA_STATE_CHANGED_NEW, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1315 NULL, who); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1316 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1317 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1318 stream = purple_media_get_stream(media, sess_id, who); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1319 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1320 if (!stream) { |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1321 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
|
1322 gchar *stun_ip = NULL; |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1323 FsStream *fsstream = NULL; |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1324 |
26049 | 1325 if ((stun_ip = purple_media_get_stun_pref_ip())) { |
26044
ca0c9cc50e35
Use STUN for the nice transmitter as well.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26039
diff
changeset
|
1326 GParameter *param = g_new0(GParameter, num_params+1); |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1327 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
|
1328 |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1329 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
|
1330 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
|
1331 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
|
1332 |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1333 fsstream = fs_session_new_stream(session->session, |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1334 participant, type_direction, |
26044
ca0c9cc50e35
Use STUN for the nice transmitter as well.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26039
diff
changeset
|
1335 transmitter, num_params+1, param, &err); |
26009
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26008
diff
changeset
|
1336 g_free(param); |
25728
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
1337 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
|
1338 } else { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1339 fsstream = fs_session_new_stream(session->session, |
25707
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
1340 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
|
1341 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
|
1342 } |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1343 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1344 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1345 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
|
1346 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1347 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1348 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
|
1349 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
|
1350 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1351 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1352 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1353 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1354 |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1355 stream = purple_media_insert_stream(session, who, fsstream); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1356 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1357 /* callback for source pad added (new stream source ready) */ |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1358 g_signal_connect(G_OBJECT(fsstream), |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1359 "src-pad-added", G_CALLBACK(purple_media_src_pad_added_cb), stream); |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1360 |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1361 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1362 0, PURPLE_MEDIA_STATE_CHANGED_NEW, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1363 session->id, who); |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1364 } 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
|
1365 /* change direction */ |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1366 g_object_set(stream->stream, "direction", type_direction, 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
|
1367 } |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1368 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1369 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
|
1370 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1371 |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1372 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
|
1373 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
|
1374 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
|
1375 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
|
1376 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
|
1377 { |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1378 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
|
1379 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1380 if (type & PURPLE_MEDIA_AUDIO) { |
25674
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
1381 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
|
1382 |
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
|
1383 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
|
1384 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
|
1385 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
|
1386 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1387 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1388 } |
26010
3b4b9795f987
purple_media_add_stream should only add a stream to one session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26009
diff
changeset
|
1389 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
|
1390 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
|
1391 |
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
|
1392 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
|
1393 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
|
1394 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
|
1395 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1396 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1397 } |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25649
diff
changeset
|
1398 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
|
1399 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1400 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1401 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
|
1402 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
|
1403 { |
26069
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26067
diff
changeset
|
1404 /* Add state-changed end emits in here when this is implemented */ |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1405 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1406 |
25720
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
1407 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
|
1408 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
|
1409 { |
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
|
1410 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
|
1411 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
|
1412 } |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1413 /* 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
|
1414 GList * |
26036
a5f1804fcb4b
Combine get_*_codecs functions to mirror Farsight 2.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26027
diff
changeset
|
1415 purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id) |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1416 { |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1417 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
|
1418 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
|
1419 "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
|
1420 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
|
1421 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1422 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1423 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
|
1424 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
|
1425 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1426 PurpleMediaStream *stream = purple_media_get_stream(media, sess_id, name); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1427 return fs_candidate_list_copy(stream->local_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
|
1428 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1429 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1430 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
|
1431 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
|
1432 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
|
1433 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1434 FsStream *stream = purple_media_get_stream(media, sess_id, name)->stream; |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1435 GError *err = NULL; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1436 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1437 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
|
1438 |
25733
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1439 if (err) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1440 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
|
1441 err->message); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25732
diff
changeset
|
1442 g_error_free(err); |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1443 } |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1444 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1445 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1446 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
|
1447 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
|
1448 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1449 return purple_media_get_stream(media, sess_id, name)->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
|
1450 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1451 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1452 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
|
1453 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
|
1454 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1455 return purple_media_get_stream(media, sess_id, name)->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
|
1456 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1457 |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1458 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
|
1459 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
|
1460 { |
26039
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26038
diff
changeset
|
1461 FsStream *stream = purple_media_get_stream(media, sess_id, name)->stream; |
25695
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1462 GError *err = NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1463 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1464 fs_stream_set_remote_codecs(stream, codecs, &err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1465 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1466 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1467 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
|
1468 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1469 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1470 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1471 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25694
diff
changeset
|
1472 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
|
1473 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25643
diff
changeset
|
1474 |
25680
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1475 gboolean |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1476 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
|
1477 { |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1478 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
|
1479 |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1480 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
|
1481 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
|
1482 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
|
1483 !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
|
1484 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
|
1485 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1486 |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1487 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
|
1488 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25676
diff
changeset
|
1489 |
25712
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1490 gboolean |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1491 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
|
1492 { |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1493 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
|
1494 GError *err = NULL; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1495 |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1496 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
|
1497 |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1498 if (err) { |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1499 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
|
1500 g_error_free(err); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1501 return FALSE; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1502 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1503 return TRUE; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1504 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25707
diff
changeset
|
1505 |
26013
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1506 gboolean |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1507 purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id) |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1508 { |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1509 PurpleMediaSession *session = purple_media_get_session(media, sess_id); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1510 gboolean ret; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1511 g_object_get(session->session, "codecs-ready", &ret, NULL); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1512 return ret; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1513 } |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26011
diff
changeset
|
1514 |
25713
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1515 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
|
1516 { |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1517 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
|
1518 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
|
1519 |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1520 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
|
1521 PurpleMediaSession *session = sessions->data; |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1522 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
|
1523 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
|
1524 GST_BIN(session->src), |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25724
diff
changeset
|
1525 "purpleaudioinputvolume"); |
25713
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1526 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
|
1527 } |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1528 } |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1529 } |
4eae2d40f11b
Added a mute button for the local microphone.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25712
diff
changeset
|
1530 |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1531 void purple_media_set_input_volume(PurpleMedia *media, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1532 const gchar *session_id, double level) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1533 { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1534 GList *sessions; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1535 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1536 if (session_id == NULL) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1537 sessions = g_hash_table_get_values(media->priv->sessions); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1538 else |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1539 sessions = g_list_append(NULL, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1540 purple_media_get_session(media, session_id)); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1541 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1542 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1543 PurpleMediaSession *session = sessions->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1544 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1545 if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1546 GstElement *volume = gst_bin_get_by_name( |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1547 GST_BIN(session->src), |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1548 "purpleaudioinputvolume"); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1549 g_object_set(volume, "volume", level, NULL); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1550 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1551 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1552 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1553 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1554 void purple_media_set_output_volume(PurpleMedia *media, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1555 const gchar *session_id, const gchar *participant, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1556 double level) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1557 { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1558 GList *streams = purple_media_get_streams(media, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1559 session_id, participant); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1560 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1561 for (; streams; streams = g_list_delete_link(streams, streams)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1562 PurpleMediaStream *stream = streams->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1563 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1564 if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1565 GstElement *volume = gst_bin_get_by_name( |
26052
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
1566 GST_BIN(stream->sink), |
26047
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1567 "purpleaudiooutputvolume"); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1568 g_object_set(volume, "volume", level, NULL); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1569 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1570 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1571 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26044
diff
changeset
|
1572 |
25654
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25651
diff
changeset
|
1573 #endif /* USE_VV */ |