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"
|
|
30
|
|
31 /** @copydoc _PurpleMediaBackendFs2Class */
|
|
32 typedef struct _PurpleMediaBackendFs2Class PurpleMediaBackendFs2Class;
|
|
33 /** @copydoc _PurpleMediaBackendFs2Private */
|
|
34 typedef struct _PurpleMediaBackendFs2Private PurpleMediaBackendFs2Private;
|
|
35
|
|
36 #define PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj) \
|
|
37 (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
|
|
38 PURPLE_TYPE_MEDIA_BACKEND_FS2, PurpleMediaBackendFs2Private))
|
|
39
|
|
40 static void purple_media_backend_iface_init(PurpleMediaBackendIface *iface);
|
|
41
|
|
42 static gboolean purple_media_backend_fs2_add_stream(PurpleMediaBackend *self,
|
|
43 const gchar *sess_id, const gchar *who,
|
|
44 PurpleMediaSessionType type, gboolean initiator,
|
|
45 const gchar *transmitter,
|
|
46 guint num_params, GParameter *params);
|
|
47 static void purple_media_backend_fs2_add_remote_candidates(
|
|
48 PurpleMediaBackend *self,
|
|
49 const gchar *sess_id, const gchar *participant,
|
|
50 GList *remote_candidates);
|
|
51 static GList *purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self,
|
|
52 const gchar *sess_id);
|
|
53 static GList *purple_media_backend_fs2_get_local_candidates(
|
|
54 PurpleMediaBackend *self,
|
|
55 const gchar *sess_id, const gchar *participant);
|
|
56 static void purple_media_backend_fs2_set_remote_codecs(
|
|
57 PurpleMediaBackend *self,
|
|
58 const gchar *sess_id, const gchar *participant,
|
|
59 GList *codecs);
|
|
60 static void purple_media_backend_fs2_set_send_codec(PurpleMediaBackend *self,
|
|
61 const gchar *sess_id, PurpleMediaCodec *codec);
|
|
62
|
|
63 struct _PurpleMediaBackendFs2Class
|
|
64 {
|
|
65 GObjectClass parent_class;
|
|
66 };
|
|
67
|
|
68 struct _PurpleMediaBackendFs2
|
|
69 {
|
|
70 GObject parent;
|
|
71 };
|
|
72
|
|
73 G_DEFINE_TYPE_WITH_CODE(PurpleMediaBackendFs2, purple_media_backend_fs2,
|
|
74 G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(
|
|
75 PURPLE_TYPE_MEDIA_BACKEND, purple_media_backend_iface_init));
|
|
76
|
|
77 struct _PurpleMediaBackendFs2Private
|
|
78 {
|
|
79 PurpleMedia *media;
|
|
80 };
|
|
81
|
|
82 enum {
|
|
83 PROP_0,
|
|
84 PROP_MEDIA,
|
|
85 };
|
|
86
|
|
87 static void
|
|
88 purple_media_backend_fs2_init(PurpleMediaBackendFs2 *self)
|
|
89 {
|
|
90 }
|
|
91
|
|
92 static void
|
|
93 purple_media_backend_fs2_finalize(GObject *obj)
|
|
94 {
|
|
95 }
|
|
96
|
|
97 static void
|
|
98 purple_media_backend_fs2_set_property(GObject *object, guint prop_id,
|
|
99 const GValue *value, GParamSpec *pspec)
|
|
100 {
|
|
101 PurpleMediaBackendFs2Private *priv;
|
|
102 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object));
|
|
103
|
|
104 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object);
|
|
105
|
|
106 switch (prop_id) {
|
|
107 case PROP_MEDIA:
|
|
108 priv->media = g_value_dup_object(value);
|
|
109 break;
|
|
110 default:
|
|
111 G_OBJECT_WARN_INVALID_PROPERTY_ID(
|
|
112 object, prop_id, pspec);
|
|
113 break;
|
|
114 }
|
|
115 }
|
|
116
|
|
117 static void
|
|
118 purple_media_backend_fs2_get_property(GObject *object, guint prop_id,
|
|
119 GValue *value, GParamSpec *pspec)
|
|
120 {
|
|
121 PurpleMediaBackendFs2Private *priv;
|
|
122 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object));
|
|
123
|
|
124 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object);
|
|
125
|
|
126 switch (prop_id) {
|
|
127 case PROP_MEDIA:
|
|
128 g_value_set_object(value, priv->media);
|
|
129 break;
|
|
130 default:
|
|
131 G_OBJECT_WARN_INVALID_PROPERTY_ID(
|
|
132 object, prop_id, pspec);
|
|
133 break;
|
|
134 }
|
|
135 }
|
|
136
|
|
137 static void
|
|
138 purple_media_backend_fs2_class_init(PurpleMediaBackendFs2Class *klass)
|
|
139 {
|
|
140
|
|
141 GObjectClass *gobject_class = (GObjectClass*)klass;
|
|
142
|
|
143 gobject_class->finalize = purple_media_backend_fs2_finalize;
|
|
144 gobject_class->set_property = purple_media_backend_fs2_set_property;
|
|
145 gobject_class->get_property = purple_media_backend_fs2_get_property;
|
|
146
|
|
147 g_object_class_override_property(gobject_class, PROP_MEDIA, "media");
|
|
148
|
|
149 g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private));
|
|
150 }
|
|
151
|
|
152 static void
|
|
153 purple_media_backend_iface_init(PurpleMediaBackendIface *iface)
|
|
154 {
|
|
155 iface->add_stream = purple_media_backend_fs2_add_stream;
|
|
156 iface->add_remote_candidates =
|
|
157 purple_media_backend_fs2_add_remote_candidates;
|
|
158 iface->get_codecs = purple_media_backend_fs2_get_codecs;
|
|
159 iface->get_local_candidates =
|
|
160 purple_media_backend_fs2_get_local_candidates;
|
|
161 iface->set_remote_codecs = purple_media_backend_fs2_set_remote_codecs;
|
|
162 iface->set_send_codec = purple_media_backend_fs2_set_send_codec;
|
|
163 }
|
|
164
|
|
165 static gboolean
|
|
166 purple_media_backend_fs2_add_stream(PurpleMediaBackend *self,
|
|
167 const gchar *sess_id, const gchar *who,
|
|
168 PurpleMediaSessionType type, gboolean initiator,
|
|
169 const gchar *transmitter,
|
|
170 guint num_params, GParameter *params)
|
|
171 {
|
|
172 return FALSE;
|
|
173 }
|
|
174
|
|
175 static void
|
|
176 purple_media_backend_fs2_add_remote_candidates(PurpleMediaBackend *self,
|
|
177 const gchar *sess_id, const gchar *participant,
|
|
178 GList *remote_candidates)
|
|
179 {
|
|
180 }
|
|
181
|
|
182 static GList *
|
|
183 purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self,
|
|
184 const gchar *sess_id)
|
|
185 {
|
|
186 return NULL;
|
|
187 }
|
|
188
|
|
189 static GList *
|
|
190 purple_media_backend_fs2_get_local_candidates(PurpleMediaBackend *self,
|
|
191 const gchar *sess_id, const gchar *participant)
|
|
192 {
|
|
193 return NULL;
|
|
194 }
|
|
195
|
|
196 static void
|
|
197 purple_media_backend_fs2_set_remote_codecs(PurpleMediaBackend *self,
|
|
198 const gchar *sess_id, const gchar *participant,
|
|
199 GList *codecs)
|
|
200 {
|
|
201 }
|
|
202
|
|
203 static void
|
|
204 purple_media_backend_fs2_set_send_codec(PurpleMediaBackend *self,
|
|
205 const gchar *sess_id, PurpleMediaCodec *codec)
|
|
206 {
|
|
207 }
|
|
208
|