libpurple/media.c

Tue, 27 May 2008 02:24:03 +0000

author
Michael Ruprecht <maiku@pidgin.im>
date
Tue, 27 May 2008 02:24:03 +0000
branch
soc.2008.vv
changeset 23701
ecbd92b724df
parent 23699
f21b7382aecb
child 23704
9b88c9b23aed
permissions
-rw-r--r--

Added better Farsight error handling. Fixes several crash bugs related
to missing GStreamer/Farsight plugins.

19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
1 /**
19889
defa6a4f45cc Cosmetics.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19885
diff changeset
2 * @file media.c Media API
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
3 * @ingroup core
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
4 *
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
5 * purple
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
6 *
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
7 * Purple is the legal property of its developers, whose names are too numerous
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
9 * source distribution.
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
10 *
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
15 *
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
20 *
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
24 */
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
25
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
26 #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
27
19889
defa6a4f45cc Cosmetics.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19885
diff changeset
28 #include "internal.h"
defa6a4f45cc Cosmetics.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19885
diff changeset
29
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
30 #include "connection.h"
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
31 #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
32 #include "marshallers.h"
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
33
22648
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
34 #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
35
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
36 #ifdef USE_FARSIGHT
22648
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
37 #ifdef USE_GSTPROPS
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
38
22648
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
39 #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
40 #include <gst/farsight/fs-conference-iface.h>
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
41
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
42 struct _PurpleMediaPrivate
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
43 {
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
44 FsConference *conference;
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
45
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
46 char *name;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
47 PurpleConnection *connection;
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
48 GstElement *audio_src;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
49 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
50 GstElement *video_src;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
51 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
52
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
53 FsSession *audio_session;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
54 FsSession *video_session;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
55
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
56 GList *participants; /* FsParticipant list */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
57 GList *audio_streams; /* FsStream list */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
58 GList *video_streams; /* FsStream list */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
59
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
60 /* might be able to just combine these two */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
61 GstElement *audio_pipeline;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
62 GstElement *video_pipeline;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
63
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
64 /* this will need to be stored/handled per stream
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
65 * once having multiple streams is supported */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
66 GList *local_candidates;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
67
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
68 FsCandidate *local_candidate;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
69 FsCandidate *remote_candidate;
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
70 };
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
71
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
72 #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate))
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
73
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
74 static void purple_media_class_init (PurpleMediaClass *klass);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
75 static void purple_media_init (PurpleMedia *media);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
76 static void purple_media_finalize (GObject *object);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
77 static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
78 static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
79
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
80 static GObjectClass *parent_class = NULL;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
81
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
82
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
83
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
84 enum {
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
85 READY,
22682
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
86 WAIT,
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
87 ACCEPTED,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
88 HANGUP,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
89 REJECT,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
90 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
91 GOT_ACCEPT,
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
92 CANDIDATES_PREPARED,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
93 CANDIDATE_PAIR,
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
94 LAST_SIGNAL
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
95 };
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
96 static guint purple_media_signals[LAST_SIGNAL] = {0};
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
97
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
98 enum {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
99 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
100 PROP_FS_CONFERENCE,
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
101 PROP_NAME,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
102 PROP_CONNECTION,
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
103 PROP_AUDIO_SRC,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
104 PROP_AUDIO_SINK,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
105 PROP_VIDEO_SRC,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
106 PROP_VIDEO_SINK,
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
107 PROP_VIDEO_SESSION,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
108 PROP_AUDIO_SESSION
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
109 };
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
110
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
111 GType
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
112 purple_media_get_type()
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
113 {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
114 static GType type = 0;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
115
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
116 if (type == 0) {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
117 static const GTypeInfo info = {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
118 sizeof(PurpleMediaClass),
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
119 NULL,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
120 NULL,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
121 (GClassInitFunc) purple_media_class_init,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
122 NULL,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
123 NULL,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
124 sizeof(PurpleMedia),
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
125 0,
22071
4c47e360e467 Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19889
diff changeset
126 (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
127 NULL
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
128 };
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
129 type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
130 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
131 return type;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
132 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
133
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
134 static void
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
135 purple_media_class_init (PurpleMediaClass *klass)
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
136 {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
137 GObjectClass *gobject_class = (GObjectClass*)klass;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
138 parent_class = g_type_class_peek_parent(klass);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
139
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
140 gobject_class->finalize = purple_media_finalize;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
141 gobject_class->set_property = purple_media_set_property;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
142 gobject_class->get_property = purple_media_get_property;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
143
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
144 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
145 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
146 "Farsight conference",
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
147 "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
148 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
149 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
150
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
151 g_object_class_install_property(gobject_class, PROP_NAME,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
152 g_param_spec_string("screenname",
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
153 "Screenname",
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
154 "The screenname of the remote user",
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
155 NULL,
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
156 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
157
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
158 g_object_class_install_property(gobject_class, PROP_CONNECTION,
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
159 g_param_spec_pointer("connection",
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
160 "Connection",
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
161 "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
162 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
163
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
164 g_object_class_install_property(gobject_class, PROP_AUDIO_SRC,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
165 g_param_spec_object("audio-src",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
166 "Audio source",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
167 "The GstElement used to source audio",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
168 GST_TYPE_ELEMENT,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
169 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
170
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
171 g_object_class_install_property(gobject_class, PROP_AUDIO_SINK,
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_spec_object("audio-sink",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
173 "Audio sink",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
174 "The GstElement used to sink audio",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
175 GST_TYPE_ELEMENT,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
176 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
177
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
178 g_object_class_install_property(gobject_class, PROP_VIDEO_SRC,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
179 g_param_spec_object("video-src",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
180 "Video source",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
181 "The GstElement used to source video",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
182 GST_TYPE_ELEMENT,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
183 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
184
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
185 g_object_class_install_property(gobject_class, PROP_VIDEO_SINK,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
186 g_param_spec_object("video-sink",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
187 "Audio source",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
188 "The GstElement used to sink video",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
189 GST_TYPE_ELEMENT,
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
190 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
191
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
192 g_object_class_install_property(gobject_class, PROP_VIDEO_SESSION,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
193 g_param_spec_object("video-session",
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
194 "Video stream",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
195 "The FarsightStream used for video",
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
196 FS_TYPE_SESSION,
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
197 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
198
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
199 g_object_class_install_property(gobject_class, PROP_AUDIO_SESSION,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
200 g_param_spec_object("audio-session",
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
201 "Audio stream",
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
202 "The FarsightStream used for audio",
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
203 FS_TYPE_SESSION,
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
204 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
205
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
206 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
207 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
208 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
209 G_TYPE_NONE, 0);
22682
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
210 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
211 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
212 g_cclosure_marshal_VOID__VOID,
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
213 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
214 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
215 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
216 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
217 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
218 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
219 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
220 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
221 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
222 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
223 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
224 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
225 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
226 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
227 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
228 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
229 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
230 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
231 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
232 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
233 G_TYPE_NONE, 0);
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
234 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
235 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
236 g_cclosure_marshal_VOID__VOID,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
237 G_TYPE_NONE, 0);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
238 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
239 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
240 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
241 G_TYPE_NONE, 2, FS_TYPE_CANDIDATE, FS_TYPE_CANDIDATE);
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
242
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
243 g_type_class_add_private(klass, sizeof(PurpleMediaPrivate));
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
244 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
245
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
246
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
247 static void
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
248 purple_media_init (PurpleMedia *media)
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
249 {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
250 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
251 memset(media->priv, 0, sizeof(media->priv));
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
252 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
253
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
254 static void
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
255 purple_media_finalize (GObject *media)
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
256 {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
257 parent_class->finalize(media);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
258 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
259
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
260 static void
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
261 purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
262 {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
263 PurpleMedia *media;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
264 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
265
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
266 media = PURPLE_MEDIA(object);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
267
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
268 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
269 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
270 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
271 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
272 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
273 g_object_ref(media->priv->conference);
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
274 break;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
275 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
276 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
277 media->priv->name = g_value_dup_string(value);
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
278 break;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
279 case PROP_CONNECTION:
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
280 media->priv->connection = g_value_get_pointer(value);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
281 break;
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
282 case PROP_AUDIO_SRC:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
283 if (media->priv->audio_src)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
284 gst_object_unref(media->priv->audio_src);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
285 media->priv->audio_src = g_value_get_object(value);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
286 gst_object_ref(media->priv->audio_src);
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
287 gst_bin_add(GST_BIN(purple_media_get_audio_pipeline(media)),
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
288 media->priv->audio_src);
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
289 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
290 case PROP_AUDIO_SINK:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
291 if (media->priv->audio_sink)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
292 gst_object_unref(media->priv->audio_sink);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
293 media->priv->audio_sink = g_value_get_object(value);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
294 gst_object_ref(media->priv->audio_sink);
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
295 gst_bin_add(GST_BIN(purple_media_get_audio_pipeline(media)),
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
296 media->priv->audio_sink);
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
297 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
298 case PROP_VIDEO_SRC:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
299 if (media->priv->video_src)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
300 gst_object_unref(media->priv->video_src);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
301 media->priv->video_src = g_value_get_object(value);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
302 gst_object_ref(media->priv->video_src);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
303 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
304 case PROP_VIDEO_SINK:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
305 if (media->priv->video_sink)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
306 gst_object_unref(media->priv->video_sink);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
307 media->priv->video_sink = g_value_get_object(value);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
308 gst_object_ref(media->priv->video_sink);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
309 break;
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
310 case PROP_VIDEO_SESSION:
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
311 if (media->priv->video_session)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
312 g_object_unref(media->priv->video_session);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
313 media->priv->video_session = 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
314 gst_object_ref(media->priv->video_session);
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
315 break;
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
316 case PROP_AUDIO_SESSION:
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
317 if (media->priv->audio_session)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
318 g_object_unref(media->priv->audio_session);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
319 media->priv->audio_session = 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
320 gst_object_ref(media->priv->audio_session);
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
321 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
322
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
323 default:
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
324 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
325 break;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
326 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
327 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
328
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
329 static void
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
330 purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
331 {
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
332 PurpleMedia *media;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
333 g_return_if_fail(PURPLE_IS_MEDIA(object));
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
334
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
335 media = PURPLE_MEDIA(object);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
336
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
337 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
338 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
339 g_value_set_object(value, media->priv->conference);
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
340 break;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
341 case PROP_NAME:
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
342 g_value_set_string(value, media->priv->name);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
343 break;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
344 case PROP_CONNECTION:
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
345 g_value_set_pointer(value, media->priv->connection);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
346 break;
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
347 case PROP_AUDIO_SRC:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
348 g_value_set_object(value, media->priv->audio_src);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
349 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
350 case PROP_AUDIO_SINK:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
351 g_value_set_object(value, media->priv->audio_sink);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
352 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
353 case PROP_VIDEO_SRC:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
354 g_value_set_object(value, media->priv->video_src);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
355 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
356 case PROP_VIDEO_SINK:
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
357 g_value_set_object(value, media->priv->video_sink);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
358 break;
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
359 case PROP_VIDEO_SESSION:
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
360 g_value_set_object(value, media->priv->video_session);
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
361 break;
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
362 case PROP_AUDIO_SESSION:
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
363 g_value_set_object(value, media->priv->audio_session);
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
364 break;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
365
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
366 default:
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
367 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
368 break;
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
369 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
370
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
371 }
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
372
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
373 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
374 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
375 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
376 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
377 if (audio_src)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
378 g_object_get(G_OBJECT(media), "audio-src", *audio_src, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
379 if (audio_sink)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
380 g_object_get(G_OBJECT(media), "audio-sink", *audio_sink, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
381 if (video_src)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
382 g_object_get(G_OBJECT(media), "video-src", *video_src, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
383 if (video_sink)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
384 g_object_get(G_OBJECT(media), "video-sink", *video_sink, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
385
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
386 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
387
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
388 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
389 purple_media_set_audio_src(PurpleMedia *media, GstElement *audio_src)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
390 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
391 g_object_set(G_OBJECT(media), "audio-src", audio_src, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
392 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
393
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
394 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
395 purple_media_set_audio_sink(PurpleMedia *media, 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
396 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
397 g_object_set(G_OBJECT(media), "audio-sink", audio_sink, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
398 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
399
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
400 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
401 purple_media_set_video_src(PurpleMedia *media, GstElement *video_src)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
402 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
403 g_object_set(G_OBJECT(media), "video-src", video_src, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
404 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
405
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
406 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
407 purple_media_set_video_sink(PurpleMedia *media, 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
408 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
409 g_object_set(G_OBJECT(media), "video-sink", video_sink, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
410 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
411
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
412 GstElement *
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
413 purple_media_get_audio_src(PurpleMedia *media)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
414 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
415 GstElement *ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
416 g_object_get(G_OBJECT(media), "audio-src", &ret, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
417 return ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
418 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
419
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
420 GstElement *
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
421 purple_media_get_audio_sink(PurpleMedia *media)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
422 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
423 GstElement *ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
424 g_object_get(G_OBJECT(media), "audio-sink", &ret, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
425 return ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
426 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
427
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
428 GstElement *
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
429 purple_media_get_video_src(PurpleMedia *media)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
430 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
431 GstElement *ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
432 g_object_get(G_OBJECT(media), "video-src", &ret, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
433 return ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
434 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
435
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
436 GstElement *
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
437 purple_media_get_video_sink(PurpleMedia *media)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
438 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
439 GstElement *ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
440 g_object_get(G_OBJECT(media), "video-sink", &ret, NULL);
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
441 return ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
442 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
443
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
444 GstElement *
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
445 purple_media_get_audio_pipeline(PurpleMedia *media)
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
446 {
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
447 if (!media->priv->audio_pipeline) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
448 media->priv->audio_pipeline = gst_pipeline_new(media->priv->name);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
449 gst_bin_add(GST_BIN(media->priv->audio_pipeline), GST_ELEMENT(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
450 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
451
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
452 return media->priv->audio_pipeline;
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
453 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
454
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
455 PurpleConnection *
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
456 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
457 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
458 PurpleConnection *gc;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
459 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
460 return gc;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
461 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
462
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
463 const char *
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
464 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
465 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
466 const char *ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
467 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
468 return ret;
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
469 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
470
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
471 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
472 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
473 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
474 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
475 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
476
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
477 void
22682
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
478 purple_media_wait(PurpleMedia *media)
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
479 {
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
480 g_signal_emit(media, purple_media_signals[WAIT], 0);
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
481 }
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
482
8df904a56d77 Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22648
diff changeset
483 void
19885
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
484 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
485 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
486 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
487 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
488
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
489 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
490 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
491 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
492 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
493 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
494
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
495 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
496 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
497 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
498 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
499 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
500
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
501 void
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
502 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
503 {
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
504 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
505 }
593613a22e57 You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents: 19883
diff changeset
506
22648
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
507 void
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
508 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
509 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
510 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
511 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
512
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
513 gchar*
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
514 purple_media_get_device_name(GstElement *element, GValue *device)
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
515 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
516 gchar *name;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
517
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
518 GstElementFactory *factory = gst_element_get_factory(element);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
519 GstElement *temp = gst_element_factory_create(factory, "tmp_src");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
520
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
521 g_object_set_property (G_OBJECT (temp), "device", device);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
522 g_object_get (G_OBJECT (temp), "device-name", &name, NULL);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
523 gst_object_unref(temp);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
524
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
525 return name;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
526 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
527
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
528 GList*
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
529 purple_media_get_devices(GstElement *element)
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
530 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
531 GObjectClass *klass;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
532 GstPropertyProbe *probe;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
533 const GParamSpec *pspec;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
534
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
535 const gchar *longname = NULL;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
536
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
537 GstElementFactory *factory =
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
538 gst_element_get_factory(element);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
539
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
540 GList *ret = NULL;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
541
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
542 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
543 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
544
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
545 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
546 !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
547 !(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
548 !(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
549 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
550 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
551 } else {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
552 gint n;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
553 gchar *name;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
554 GValueArray *array;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
555
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
556 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
557
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
558 /* 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
559 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
560 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
561 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
562 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
563 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
564 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
565
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
566 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
567 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
568
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
569 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
570 GValue *device = g_value_array_get_nth (array, n);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
571 gst_element_set_state (element, GST_STATE_NULL);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
572
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
573 ret = g_list_append(ret, device);
23699
f21b7382aecb Fix video plugin/device preference and preview.
Michael Ruprecht <maiku@pidgin.im>
parents: 23697
diff changeset
574
f21b7382aecb Fix video plugin/device preference and preview.
Michael Ruprecht <maiku@pidgin.im>
parents: 23697
diff changeset
575 name = purple_media_get_device_name(GST_ELEMENT(element), device);
f21b7382aecb Fix video plugin/device preference and preview.
Michael Ruprecht <maiku@pidgin.im>
parents: 23697
diff changeset
576 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
577 longname, GST_PLUGIN_FEATURE (factory)->name,
f21b7382aecb Fix video plugin/device preference and preview.
Michael Ruprecht <maiku@pidgin.im>
parents: 23697
diff changeset
578 name, g_value_get_string(device));
f21b7382aecb Fix video plugin/device preference and preview.
Michael Ruprecht <maiku@pidgin.im>
parents: 23697
diff changeset
579 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
580 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
581 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
582 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
583
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
584 return ret;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
585 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
586
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
587 void
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
588 purple_media_element_set_device(GstElement *element, GValue *device)
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
589 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
590 g_object_set_property(G_OBJECT(element), "device", device);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
591 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
592
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
593 GValue *
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
594 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
595 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
596 GValue *device;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
597 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
598 return device;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
599 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
600
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
601 GstElement *
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
602 purple_media_get_element(const gchar *factory_name)
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
603 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
604 GstElementFactory *factory = gst_element_factory_find(factory_name);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
605 GstElement *element = gst_element_factory_create(factory, "video_src");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
606 gst_object_unref(factory);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
607 return element;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
608 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
609
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
610 void
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
611 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
612 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
613 GstElement *src;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
614 GstPad *pad;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
615 GstPad *ghost;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
616 const gchar *audio_device = purple_prefs_get_string("/purple/media/audio/device");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
617
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
618 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
619
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
620 *sendbin = gst_bin_new("sendbin");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
621 src = gst_element_factory_make("alsasrc", "asrc");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
622 *sendlevel = gst_element_factory_make("level", "sendlevel");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
623 gst_bin_add_many(GST_BIN(*sendbin), src, *sendlevel, NULL);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
624 gst_element_link(src, *sendlevel);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
625 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
626 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
627 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
628 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
629
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
630 /* set current audio device on "src"... */
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
631 if (audio_device) {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
632 GList *devices = purple_media_get_devices(src);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
633 GList *dev = devices;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
634 purple_debug_info("media", "Setting device of GstElement src to %s\n",
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
635 audio_device);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
636 for (; dev ; dev = dev->next) {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
637 GValue *device = (GValue *) dev->data;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
638 char *name = purple_media_get_device_name(src, device);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
639 if (strcmp(name, audio_device) == 0) {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
640 purple_media_element_set_device(src, device);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
641 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
642 g_free(name);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
643 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
644 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
645 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
646
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
647 void
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
648 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
649 {
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
650 GstElement *sink;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
651 GstPad *pad, *ghost;
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
652
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
653 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
654
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
655 *recvbin = gst_bin_new("pidginrecvbin");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
656 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
657 g_object_set(G_OBJECT(sink), "sync", FALSE, NULL);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
658 *recvlevel = gst_element_factory_make("level", "recvlevel");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
659 gst_bin_add_many(GST_BIN(*recvbin), sink, *recvlevel, NULL);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
660 gst_element_link(*recvlevel, sink);
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
661 pad = gst_element_get_pad(*recvlevel, "sink");
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
662 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
663 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
664 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
665
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
666 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
667 }
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
668
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
669 static void
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
670 purple_media_new_local_candidate(FsStream *stream,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
671 FsCandidate *local_candidate,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
672 PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
673 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
674 purple_debug_info("media", "got new local candidate: %s\n", local_candidate->candidate_id);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
675 media->priv->local_candidates = g_list_append(media->priv->local_candidates,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
676 fs_candidate_copy(local_candidate));
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
677 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
678
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
679 static void
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
680 purple_media_candidates_prepared(FsStream *stream, PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
681 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
682 g_signal_emit(media, purple_media_signals[CANDIDATES_PREPARED], 0);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
683 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
684
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
685 /* 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
686 * 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
687 static void
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
688 purple_media_candidate_pair_established(FsStream *stream,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
689 FsCandidate *native_candidate,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
690 FsCandidate *remote_candidate,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
691 PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
692 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
693 media->priv->local_candidate = fs_candidate_copy(native_candidate);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
694 media->priv->remote_candidate = fs_candidate_copy(remote_candidate);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
695
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
696 purple_debug_info("media", "candidate pair established\n");
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
697 g_signal_emit(media, purple_media_signals[CANDIDATE_PAIR], 0,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
698 media->priv->local_candidate,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
699 media->priv->remote_candidate);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
700 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
701
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
702 static void
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
703 purple_media_src_pad_added(FsStream *stream, GstPad *srcpad,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
704 FsCodec *codec, PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
705 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
706 GstElement *pipeline = purple_media_get_audio_pipeline(media);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
707 GstPad *sinkpad = gst_element_get_static_pad(purple_media_get_audio_sink(media), "ghostsink");
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
708 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
709 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
710 gst_element_set_state(pipeline, GST_STATE_PLAYING);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
711 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
712
23701
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
713 static gboolean
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
714 purple_media_add_stream_internal(PurpleMedia *media, FsSession **session, GList **streams,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
715 GstElement *src, const gchar *who, FsMediaType type,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
716 FsStreamDirection type_direction, const gchar *transmitter)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
717 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
718 char *cname = NULL;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
719 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
720 GList *l = NULL;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
721 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
722 FsParticipant *p = NULL;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
723 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
724 FsSession *s = NULL;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
725
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
726 if (!*session) {
23701
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
727 GError *err = NULL;
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
728 *session = fs_conference_new_session(media->priv->conference, type, &err);
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
729
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
730 if (err != NULL) {
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
731 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
732 g_error_free(err);
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
733 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
734 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
735 _("Error creating session."));
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
736 return FALSE;
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
737 }
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
738
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
739 if (src) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
740 GstPad *sinkpad;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
741 GstPad *srcpad;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
742 g_object_get(*session, "sink-pad", &sinkpad, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
743 srcpad = gst_element_get_static_pad(src, "ghostsrc");
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
744 purple_debug_info("media", "connecting 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
745 gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
746 ? "success" : "failure");
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
747 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
748 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
749
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
750 for (l = media->priv->participants; l != NULL; l = g_list_next(l)) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
751 g_object_get(l->data, "cname", cname, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
752 if (!strcmp(cname, who)) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
753 g_free(cname);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
754 participant = l->data;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
755 break;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
756 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
757 g_free(cname);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
758 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
759
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
760 if (!participant) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
761 participant = fs_conference_new_participant(media->priv->conference, (gchar*)who, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
762 media->priv->participants = g_list_prepend(media->priv->participants, participant);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
763 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
764
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
765 for (l = *streams; l != NULL; l = g_list_next(l)) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
766 g_object_get(l->data, "participant", &p, "direction", &direction, "session", &s, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
767
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
768 if (participant == p && *session == s) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
769 stream = l->data;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
770 break;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
771 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
772 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
773
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
774 if (!stream) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
775 stream = fs_session_new_stream(*session, participant,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
776 type_direction, transmitter, 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
777 *streams = g_list_prepend(*streams, stream);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
778 /* callback for new local candidate (new local candidate retreived) */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
779 g_signal_connect(G_OBJECT(stream),
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
780 "new-local-candidate", G_CALLBACK(purple_media_new_local_candidate), media);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
781 /* 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
782 g_signal_connect(G_OBJECT(stream),
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
783 "src-pad-added", G_CALLBACK(purple_media_src_pad_added), media);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
784 /* callback for local candidates prepared (local candidates ready to send) */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
785 g_signal_connect(G_OBJECT(stream),
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
786 "local-candidates-prepared",
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
787 G_CALLBACK(purple_media_candidates_prepared), media);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
788 /* callback for new active candidate pair (established connection) */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
789 g_signal_connect(G_OBJECT(stream),
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
790 "new-active-candidate-pair",
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
791 G_CALLBACK(purple_media_candidate_pair_established), media);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
792 } 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
793 /* change direction */
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
794 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
795 }
23701
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
796
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
797 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
798 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
799
23701
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
800 gboolean
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
801 purple_media_add_stream(PurpleMedia *media, const gchar *who,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
802 PurpleMediaStreamType type,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
803 const gchar *transmitter)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
804 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
805 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
806
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
807 if (type & PURPLE_MEDIA_AUDIO) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
808 if (type & PURPLE_MEDIA_SEND_AUDIO && type & PURPLE_MEDIA_RECV_AUDIO)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
809 type_direction = FS_DIRECTION_BOTH;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
810 else if (type & PURPLE_MEDIA_SEND_AUDIO)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
811 type_direction = FS_DIRECTION_SEND;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
812 else if (type & PURPLE_MEDIA_RECV_AUDIO)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
813 type_direction = FS_DIRECTION_RECV;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
814 else
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
815 type_direction = FS_DIRECTION_NONE;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
816
23701
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
817 if (!purple_media_add_stream_internal(media, &media->priv->audio_session,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
818 &media->priv->audio_streams,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
819 media->priv->audio_src, who,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
820 FS_MEDIA_TYPE_AUDIO, type_direction,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
821 transmitter)) {
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
822 return FALSE;
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
823 }
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
824 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
825 if (type & PURPLE_MEDIA_VIDEO) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
826 if (type & PURPLE_MEDIA_SEND_VIDEO && type & PURPLE_MEDIA_RECV_VIDEO)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
827 type_direction = FS_DIRECTION_BOTH;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
828 else if (type & PURPLE_MEDIA_SEND_VIDEO)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
829 type_direction = FS_DIRECTION_SEND;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
830 else if (type & PURPLE_MEDIA_RECV_VIDEO)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
831 type_direction = FS_DIRECTION_RECV;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
832 else
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
833 type_direction = FS_DIRECTION_NONE;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
834
23701
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
835 if (!purple_media_add_stream_internal(media, &media->priv->video_session,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
836 &media->priv->video_streams,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
837 media->priv->video_src, who,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
838 FS_MEDIA_TYPE_VIDEO, type_direction,
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
839 transmitter)) {
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
840 return FALSE;
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
841 }
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
842 }
23701
ecbd92b724df Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents: 23699
diff changeset
843 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
844 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
845
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
846 void
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
847 purple_media_remove_stream(PurpleMedia *media, const gchar *who, PurpleMediaStreamType type)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
848 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
849
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
850 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
851
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
852 static FsStream *
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
853 purple_media_get_audio_stream(PurpleMedia *media, const gchar *name)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
854 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
855 GList *streams = media->priv->audio_streams;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
856 for (; streams; streams = streams->next) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
857 FsParticipant *participant;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
858 gchar *cname;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
859 g_object_get(streams->data, "participant", &participant, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
860 g_object_get(participant, "cname", &cname, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
861
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
862 if (!strcmp(cname, name)) {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
863 return streams->data;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
864 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
865 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
866
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
867 return NULL;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
868 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
869
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
870 GList *
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
871 purple_media_get_local_audio_codecs(PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
872 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
873 GList *codecs;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
874 g_object_get(G_OBJECT(media->priv->audio_session), "local-codecs", &codecs, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
875 return codecs;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
876 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
877
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
878 GList *
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
879 purple_media_get_local_audio_candidates(PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
880 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
881 return media->priv->local_candidates;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
882 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
883
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
884 GList *
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
885 purple_media_get_negotiated_audio_codecs(PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
886 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
887 GList *codec_intersection;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
888 g_object_get(media->priv->audio_session, "negotiated-codecs", &codec_intersection, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
889 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
890 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
891
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
892 void
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
893 purple_media_add_remote_audio_candidates(PurpleMedia *media, const gchar *name, GList *remote_candidates)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
894 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
895 FsStream *stream = purple_media_get_audio_stream(media, name);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
896 GList *candidates = remote_candidates;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
897 for (; candidates; candidates = candidates->next)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
898 fs_stream_add_remote_candidate(stream, candidates->data, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
899 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
900
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
901 FsCandidate *
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
902 purple_media_get_local_candidate(PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
903 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
904 return media->priv->local_candidate;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
905 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
906
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
907 FsCandidate *
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
908 purple_media_get_remote_candidate(PurpleMedia *media)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
909 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
910 return media->priv->remote_candidate;
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
911 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
912
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
913 void
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
914 purple_media_set_remote_audio_codecs(PurpleMedia *media, const gchar *name, GList *codecs)
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
915 {
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
916 fs_stream_set_remote_codecs(purple_media_get_audio_stream(media, name), codecs, NULL);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
917 }
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22682
diff changeset
918
22648
e286d795c5f9 Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22071
diff changeset
919 #endif /* USE_GSTPROPS */
19883
2b59550f211d Missed files
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
920 #endif /* USE_FARSIGHT */

mercurial