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