Mercurial > pidgin
annotate libpurple/media/backend-fs2.c @ 29149:4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
author | maiku@pidgin.im |
---|---|
date | Thu, 22 Oct 2009 23:29:51 +0000 |
parents | f46979436c78 |
children | 2f8151fed0ae |
rev | line source |
---|---|
29146 | 1 /** |
2 * @file backend-fs2.c Farsight 2 backend for media API | |
3 * @ingroup core | |
4 */ | |
5 | |
6 /* purple | |
7 * | |
8 * Purple is the legal property of its developers, whose names are too numerous | |
9 * to list here. Please refer to the COPYRIGHT file distributed with this | |
10 * source distribution. | |
11 * | |
12 * This program is free software; you can redistribute it and/or modify | |
13 * it under the terms of the GNU General Public License as published by | |
14 * the Free Software Foundation; either version 2 of the License, or | |
15 * (at your option) any later version. | |
16 * | |
17 * This program is distributed in the hope that it will be useful, | |
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 * GNU General Public License for more details. | |
21 * | |
22 * You should have received a copy of the GNU General Public License | |
23 * along with this program; if not, write to the Free Software | |
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
25 */ | |
26 | |
27 #include "backend-fs2.h" | |
28 | |
29 #include "backend-iface.h" | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
30 #include "debug.h" |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
31 #include "media-gst.h" |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
32 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
33 #include <gst/farsight/fs-conference-iface.h> |
29146 | 34 |
35 /** @copydoc _PurpleMediaBackendFs2Class */ | |
36 typedef struct _PurpleMediaBackendFs2Class PurpleMediaBackendFs2Class; | |
37 /** @copydoc _PurpleMediaBackendFs2Private */ | |
38 typedef struct _PurpleMediaBackendFs2Private PurpleMediaBackendFs2Private; | |
39 | |
40 #define PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj) \ | |
41 (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ | |
42 PURPLE_TYPE_MEDIA_BACKEND_FS2, PurpleMediaBackendFs2Private)) | |
43 | |
44 static void purple_media_backend_iface_init(PurpleMediaBackendIface *iface); | |
45 | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
46 static gboolean |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
47 _gst_bus_cb(GstBus *bus, GstMessage *msg, PurpleMediaBackend *self); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
48 |
29146 | 49 static gboolean purple_media_backend_fs2_add_stream(PurpleMediaBackend *self, |
50 const gchar *sess_id, const gchar *who, | |
51 PurpleMediaSessionType type, gboolean initiator, | |
52 const gchar *transmitter, | |
53 guint num_params, GParameter *params); | |
54 static void purple_media_backend_fs2_add_remote_candidates( | |
55 PurpleMediaBackend *self, | |
56 const gchar *sess_id, const gchar *participant, | |
57 GList *remote_candidates); | |
58 static GList *purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, | |
59 const gchar *sess_id); | |
60 static GList *purple_media_backend_fs2_get_local_candidates( | |
61 PurpleMediaBackend *self, | |
62 const gchar *sess_id, const gchar *participant); | |
63 static void purple_media_backend_fs2_set_remote_codecs( | |
64 PurpleMediaBackend *self, | |
65 const gchar *sess_id, const gchar *participant, | |
66 GList *codecs); | |
67 static void purple_media_backend_fs2_set_send_codec(PurpleMediaBackend *self, | |
68 const gchar *sess_id, PurpleMediaCodec *codec); | |
69 | |
70 struct _PurpleMediaBackendFs2Class | |
71 { | |
72 GObjectClass parent_class; | |
73 }; | |
74 | |
75 struct _PurpleMediaBackendFs2 | |
76 { | |
77 GObject parent; | |
78 }; | |
79 | |
80 G_DEFINE_TYPE_WITH_CODE(PurpleMediaBackendFs2, purple_media_backend_fs2, | |
81 G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE( | |
82 PURPLE_TYPE_MEDIA_BACKEND, purple_media_backend_iface_init)); | |
83 | |
84 struct _PurpleMediaBackendFs2Private | |
85 { | |
86 PurpleMedia *media; | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
87 GstElement *confbin; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
88 FsConference *conference; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
89 gchar *conference_type; |
29146 | 90 }; |
91 | |
92 enum { | |
93 PROP_0, | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
94 PROP_CONFERENCE_TYPE, |
29146 | 95 PROP_MEDIA, |
96 }; | |
97 | |
98 static void | |
99 purple_media_backend_fs2_init(PurpleMediaBackendFs2 *self) | |
100 { | |
101 } | |
102 | |
103 static void | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
104 purple_media_backend_fs2_dispose(GObject *obj) |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
105 { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
106 PurpleMediaBackendFs2Private *priv = |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
107 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
108 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
109 if (priv->confbin) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
110 GstElement *pipeline; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
111 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
112 pipeline = purple_media_manager_get_pipeline( |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
113 purple_media_get_manager(priv->media)); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
114 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
115 gst_element_set_locked_state(priv->confbin, TRUE); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
116 gst_element_set_state(GST_ELEMENT(priv->confbin), |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
117 GST_STATE_NULL); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
118 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
119 if (pipeline) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
120 GstBus *bus; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
121 gst_bin_remove(GST_BIN(pipeline), priv->confbin); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
122 bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
123 g_signal_handlers_disconnect_matched(G_OBJECT(bus), |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
124 G_SIGNAL_MATCH_FUNC | |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
125 G_SIGNAL_MATCH_DATA, |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
126 0, 0, 0, _gst_bus_cb, obj); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
127 gst_object_unref(bus); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
128 } else { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
129 purple_debug_warning("backend-fs2", "Unable to " |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
130 "properly dispose the conference. " |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
131 "Couldn't get the pipeline.\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
132 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
133 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
134 priv->confbin = NULL; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
135 priv->conference = NULL; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
136 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
137 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
138 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
139 if (priv->media) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
140 g_object_unref(priv->media); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
141 priv->media = NULL; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
142 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
143 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
144 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
145 static void |
29146 | 146 purple_media_backend_fs2_finalize(GObject *obj) |
147 { | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
148 PurpleMediaBackendFs2Private *priv = |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
149 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
150 g_free(priv->conference_type); |
29146 | 151 } |
152 | |
153 static void | |
154 purple_media_backend_fs2_set_property(GObject *object, guint prop_id, | |
155 const GValue *value, GParamSpec *pspec) | |
156 { | |
157 PurpleMediaBackendFs2Private *priv; | |
158 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); | |
159 | |
160 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); | |
161 | |
162 switch (prop_id) { | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
163 case PROP_CONFERENCE_TYPE: |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
164 priv->conference_type = g_value_dup_string(value); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
165 break; |
29146 | 166 case PROP_MEDIA: |
167 priv->media = g_value_dup_object(value); | |
168 break; | |
169 default: | |
170 G_OBJECT_WARN_INVALID_PROPERTY_ID( | |
171 object, prop_id, pspec); | |
172 break; | |
173 } | |
174 } | |
175 | |
176 static void | |
177 purple_media_backend_fs2_get_property(GObject *object, guint prop_id, | |
178 GValue *value, GParamSpec *pspec) | |
179 { | |
180 PurpleMediaBackendFs2Private *priv; | |
181 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object)); | |
182 | |
183 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object); | |
184 | |
185 switch (prop_id) { | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
186 case PROP_CONFERENCE_TYPE: |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
187 g_value_set_string(value, priv->conference_type); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
188 break; |
29146 | 189 case PROP_MEDIA: |
190 g_value_set_object(value, priv->media); | |
191 break; | |
192 default: | |
193 G_OBJECT_WARN_INVALID_PROPERTY_ID( | |
194 object, prop_id, pspec); | |
195 break; | |
196 } | |
197 } | |
198 | |
199 static void | |
200 purple_media_backend_fs2_class_init(PurpleMediaBackendFs2Class *klass) | |
201 { | |
202 GObjectClass *gobject_class = (GObjectClass*)klass; | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
203 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
204 gobject_class->dispose = purple_media_backend_fs2_dispose; |
29146 | 205 gobject_class->finalize = purple_media_backend_fs2_finalize; |
206 gobject_class->set_property = purple_media_backend_fs2_set_property; | |
207 gobject_class->get_property = purple_media_backend_fs2_get_property; | |
208 | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
209 g_object_class_override_property(gobject_class, PROP_CONFERENCE_TYPE, |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
210 "conference-type"); |
29146 | 211 g_object_class_override_property(gobject_class, PROP_MEDIA, "media"); |
212 | |
213 g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private)); | |
214 } | |
215 | |
216 static void | |
217 purple_media_backend_iface_init(PurpleMediaBackendIface *iface) | |
218 { | |
219 iface->add_stream = purple_media_backend_fs2_add_stream; | |
220 iface->add_remote_candidates = | |
221 purple_media_backend_fs2_add_remote_candidates; | |
222 iface->get_codecs = purple_media_backend_fs2_get_codecs; | |
223 iface->get_local_candidates = | |
224 purple_media_backend_fs2_get_local_candidates; | |
225 iface->set_remote_codecs = purple_media_backend_fs2_set_remote_codecs; | |
226 iface->set_send_codec = purple_media_backend_fs2_set_send_codec; | |
227 } | |
228 | |
229 static gboolean | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
230 _gst_bus_cb(GstBus *bus, GstMessage *msg, PurpleMediaBackend *self) |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
231 { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
232 return TRUE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
233 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
234 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
235 static gboolean |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
236 _init_conference(PurpleMediaBackend *self) |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
237 { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
238 PurpleMediaBackendFs2Private *priv = |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
239 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
240 GstElement *pipeline; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
241 GstBus *bus; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
242 gchar *name; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
243 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
244 priv->conference = FS_CONFERENCE( |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
245 gst_element_factory_make(priv->conference_type, NULL)); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
246 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
247 if (priv->conference == NULL) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
248 purple_debug_error("backend-fs2", "Conference == NULL\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
249 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
250 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
251 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
252 pipeline = purple_media_manager_get_pipeline( |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
253 purple_media_manager_get()); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
254 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
255 if (pipeline == NULL) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
256 purple_debug_error("backend-fs2", |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
257 "Couldn't retrieve pipeline.\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
258 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
259 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
260 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
261 name = g_strdup_printf("conf_%p", priv->conference); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
262 priv->confbin = gst_bin_new(name); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
263 if (priv->confbin == NULL) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
264 purple_debug_error("backend-fs2", |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
265 "Couldn't create confbin.\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
266 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
267 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
268 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
269 g_free(name); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
270 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
271 bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
272 if (bus == NULL) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
273 purple_debug_error("backend-fs2", |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
274 "Couldn't get the pipeline's bus.\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
275 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
276 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
277 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
278 g_signal_connect(G_OBJECT(bus), "message", |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
279 G_CALLBACK(_gst_bus_cb), self); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
280 gst_object_unref(bus); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
281 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
282 if (!gst_bin_add(GST_BIN(pipeline), |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
283 GST_ELEMENT(priv->confbin))) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
284 purple_debug_error("backend-fs2", "Couldn't add confbin " |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
285 "element to the pipeline\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
286 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
287 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
288 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
289 if (!gst_bin_add(GST_BIN(priv->confbin), |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
290 GST_ELEMENT(priv->conference))) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
291 purple_debug_error("backend-fs2", "Couldn't add conference " |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
292 "element to the confbin\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
293 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
294 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
295 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
296 if (gst_element_set_state(GST_ELEMENT(priv->confbin), |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
297 GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
298 purple_debug_error("backend-fs2", |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
299 "Failed to start conference.\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
300 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
301 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
302 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
303 return TRUE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
304 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
305 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
306 static gboolean |
29146 | 307 purple_media_backend_fs2_add_stream(PurpleMediaBackend *self, |
308 const gchar *sess_id, const gchar *who, | |
309 PurpleMediaSessionType type, gboolean initiator, | |
310 const gchar *transmitter, | |
311 guint num_params, GParameter *params) | |
312 { | |
29149
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
313 PurpleMediaBackendFs2Private *priv = |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
314 PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
315 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
316 if (priv->conference == NULL || !_init_conference(self)) { |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
317 purple_debug_error("backend-fs2", |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
318 "Error initializing the conference.\n"); |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
319 return FALSE; |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
320 } |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
321 |
4aa30863743b
Create and dispose the conference in the Farsight 2 media backend.
maiku@pidgin.im
parents:
29146
diff
changeset
|
322 return TRUE; |
29146 | 323 } |
324 | |
325 static void | |
326 purple_media_backend_fs2_add_remote_candidates(PurpleMediaBackend *self, | |
327 const gchar *sess_id, const gchar *participant, | |
328 GList *remote_candidates) | |
329 { | |
330 } | |
331 | |
332 static GList * | |
333 purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self, | |
334 const gchar *sess_id) | |
335 { | |
336 return NULL; | |
337 } | |
338 | |
339 static GList * | |
340 purple_media_backend_fs2_get_local_candidates(PurpleMediaBackend *self, | |
341 const gchar *sess_id, const gchar *participant) | |
342 { | |
343 return NULL; | |
344 } | |
345 | |
346 static void | |
347 purple_media_backend_fs2_set_remote_codecs(PurpleMediaBackend *self, | |
348 const gchar *sess_id, const gchar *participant, | |
349 GList *codecs) | |
350 { | |
351 } | |
352 | |
353 static void | |
354 purple_media_backend_fs2_set_send_codec(PurpleMediaBackend *self, | |
355 const gchar *sess_id, PurpleMediaCodec *codec) | |
356 { | |
357 } | |
358 |