libpurple/media/backend-fs2.c

Thu, 22 Oct 2009 21:30:30 +0000

author
Michael Ruprecht <maiku@pidgin.im>
date
Thu, 22 Oct 2009 21:30:30 +0000
branch
cpw.maiku.media_refactor
changeset 29556
ebf1af169279
child 29559
fc9fa90d7c4a
permissions
-rw-r--r--

Skeleton of the Farsight 2 media backend.

I want to keep the backend-fs2.h internal to libpurple for now. It shouldn't
be made public API yet (if ever). The separation is largely for organization.
Nothing outside of libpurple should need to access it directly.

29556
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
1 /**
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
2 * @file backend-fs2.c Farsight 2 backend for media API
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
3 * @ingroup core
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
4 */
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
5
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
6 /* purple
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
7 *
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
10 * source distribution.
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
11 *
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
16 *
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
21 *
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
25 */
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
26
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
27 #include "backend-fs2.h"
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
28
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
29 #include "backend-iface.h"
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
30
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
31 /** @copydoc _PurpleMediaBackendFs2Class */
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
32 typedef struct _PurpleMediaBackendFs2Class PurpleMediaBackendFs2Class;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
33 /** @copydoc _PurpleMediaBackendFs2Private */
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
34 typedef struct _PurpleMediaBackendFs2Private PurpleMediaBackendFs2Private;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
35
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
36 #define PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(obj) \
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
37 (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
38 PURPLE_TYPE_MEDIA_BACKEND_FS2, PurpleMediaBackendFs2Private))
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
39
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
40 static void purple_media_backend_iface_init(PurpleMediaBackendIface *iface);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
41
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
42 static gboolean purple_media_backend_fs2_add_stream(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
43 const gchar *sess_id, const gchar *who,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
44 PurpleMediaSessionType type, gboolean initiator,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
45 const gchar *transmitter,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
46 guint num_params, GParameter *params);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
47 static void purple_media_backend_fs2_add_remote_candidates(
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
48 PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
49 const gchar *sess_id, const gchar *participant,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
50 GList *remote_candidates);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
51 static GList *purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
52 const gchar *sess_id);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
53 static GList *purple_media_backend_fs2_get_local_candidates(
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
54 PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
55 const gchar *sess_id, const gchar *participant);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
56 static void purple_media_backend_fs2_set_remote_codecs(
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
57 PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
58 const gchar *sess_id, const gchar *participant,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
59 GList *codecs);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
60 static void purple_media_backend_fs2_set_send_codec(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
61 const gchar *sess_id, PurpleMediaCodec *codec);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
62
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
63 struct _PurpleMediaBackendFs2Class
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
64 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
65 GObjectClass parent_class;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
66 };
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
67
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
68 struct _PurpleMediaBackendFs2
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
69 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
70 GObject parent;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
71 };
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
72
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
73 G_DEFINE_TYPE_WITH_CODE(PurpleMediaBackendFs2, purple_media_backend_fs2,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
74 G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
75 PURPLE_TYPE_MEDIA_BACKEND, purple_media_backend_iface_init));
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
76
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
77 struct _PurpleMediaBackendFs2Private
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
78 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
79 PurpleMedia *media;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
80 };
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
81
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
82 enum {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
83 PROP_0,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
84 PROP_MEDIA,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
85 };
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
86
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
87 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
88 purple_media_backend_fs2_init(PurpleMediaBackendFs2 *self)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
89 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
90 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
91
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
92 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
93 purple_media_backend_fs2_finalize(GObject *obj)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
94 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
95 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
96
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
97 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
98 purple_media_backend_fs2_set_property(GObject *object, guint prop_id,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
99 const GValue *value, GParamSpec *pspec)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
100 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
101 PurpleMediaBackendFs2Private *priv;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
102 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object));
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
103
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
104 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
105
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
106 switch (prop_id) {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
107 case PROP_MEDIA:
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
108 priv->media = g_value_dup_object(value);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
109 break;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
110 default:
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
111 G_OBJECT_WARN_INVALID_PROPERTY_ID(
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
112 object, prop_id, pspec);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
113 break;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
114 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
115 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
116
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
117 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
118 purple_media_backend_fs2_get_property(GObject *object, guint prop_id,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
119 GValue *value, GParamSpec *pspec)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
120 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
121 PurpleMediaBackendFs2Private *priv;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
122 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(object));
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
123
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
124 priv = PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(object);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
125
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
126 switch (prop_id) {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
127 case PROP_MEDIA:
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
128 g_value_set_object(value, priv->media);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
129 break;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
130 default:
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
131 G_OBJECT_WARN_INVALID_PROPERTY_ID(
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
132 object, prop_id, pspec);
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
133 break;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
134 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
135 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
136
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
137 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
138 purple_media_backend_fs2_class_init(PurpleMediaBackendFs2Class *klass)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
139 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
140
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
141 GObjectClass *gobject_class = (GObjectClass*)klass;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
142
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
143 gobject_class->finalize = purple_media_backend_fs2_finalize;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
144 gobject_class->set_property = purple_media_backend_fs2_set_property;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
145 gobject_class->get_property = purple_media_backend_fs2_get_property;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
146
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
147 g_object_class_override_property(gobject_class, PROP_MEDIA, "media");
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
148
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
149 g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private));
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
150 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
151
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
152 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
153 purple_media_backend_iface_init(PurpleMediaBackendIface *iface)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
154 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
155 iface->add_stream = purple_media_backend_fs2_add_stream;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
156 iface->add_remote_candidates =
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
157 purple_media_backend_fs2_add_remote_candidates;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
158 iface->get_codecs = purple_media_backend_fs2_get_codecs;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
159 iface->get_local_candidates =
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
160 purple_media_backend_fs2_get_local_candidates;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
161 iface->set_remote_codecs = purple_media_backend_fs2_set_remote_codecs;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
162 iface->set_send_codec = purple_media_backend_fs2_set_send_codec;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
163 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
164
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
165 static gboolean
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
166 purple_media_backend_fs2_add_stream(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
167 const gchar *sess_id, const gchar *who,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
168 PurpleMediaSessionType type, gboolean initiator,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
169 const gchar *transmitter,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
170 guint num_params, GParameter *params)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
171 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
172 return FALSE;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
173 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
174
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
175 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
176 purple_media_backend_fs2_add_remote_candidates(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
177 const gchar *sess_id, const gchar *participant,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
178 GList *remote_candidates)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
179 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
180 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
181
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
182 static GList *
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
183 purple_media_backend_fs2_get_codecs(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
184 const gchar *sess_id)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
185 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
186 return NULL;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
187 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
188
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
189 static GList *
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
190 purple_media_backend_fs2_get_local_candidates(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
191 const gchar *sess_id, const gchar *participant)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
192 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
193 return NULL;
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
194 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
195
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
196 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
197 purple_media_backend_fs2_set_remote_codecs(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
198 const gchar *sess_id, const gchar *participant,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
199 GList *codecs)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
200 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
201 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
202
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
203 static void
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
204 purple_media_backend_fs2_set_send_codec(PurpleMediaBackend *self,
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
205 const gchar *sess_id, PurpleMediaCodec *codec)
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
206 {
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
207 }
ebf1af169279 Skeleton of the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
208

mercurial