Mercurial > pidgin
comparison libpurple/media/backend-iface.h @ 29145:0ae9306de1f6
Add a media backend interface to handle different backends in addition to
Farsight 2.
author | maiku@pidgin.im |
---|---|
date | Thu, 22 Oct 2009 21:09:36 +0000 |
parents | |
children | d1955da88264 |
comparison
equal
deleted
inserted
replaced
29144:e18c1d347e37 | 29145:0ae9306de1f6 |
---|---|
1 /** | |
2 * @file backend-iface.h Interface for media backends | |
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 #ifndef _MEDIA_BACKEND_IFACE_H_ | |
28 #define _MEDIA_BACKEND_IFACE_H_ | |
29 | |
30 #include "codec.h" | |
31 #include "enum-types.h" | |
32 | |
33 #include <glib-object.h> | |
34 | |
35 G_BEGIN_DECLS | |
36 | |
37 #define PURPLE_TYPE_MEDIA_BACKEND (purple_media_backend_get_type()) | |
38 #define PURPLE_IS_MEDIA_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_BACKEND)) | |
39 #define PURPLE_MEDIA_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_BACKEND, PurpleMediaBackend)) | |
40 #define PURPLE_MEDIA_BACKEND_GET_INTERFACE(inst)(G_TYPE_INSTANCE_GET_INTERFACE((inst), PURPLE_TYPE_MEDIA_BACKEND, PurpleMediaBackendIface)) | |
41 | |
42 typedef struct _PurpleMediaBackend PurpleMediaBackend; | |
43 typedef struct _PurpleMediaBackendIface PurpleMediaBackendIface; | |
44 | |
45 struct _PurpleMediaBackendIface | |
46 { | |
47 GTypeInterface parent_iface; | |
48 | |
49 void (*do_action) (PurpleMediaBackend *self); | |
50 gboolean (*add_stream) (PurpleMediaBackend *self, | |
51 const gchar *sess_id, const gchar *who, | |
52 PurpleMediaSessionType type, gboolean initiator, | |
53 const gchar *transmitter, | |
54 guint num_params, GParameter *params); | |
55 void (*add_remote_candidates) (PurpleMediaBackend *self, | |
56 const gchar *sess_id, const gchar *participant, | |
57 GList *remote_candidates); | |
58 GList *(*get_codecs) (PurpleMediaBackend *self, | |
59 const gchar *sess_id); | |
60 GList *(*get_local_candidates) (PurpleMediaBackend *self, | |
61 const gchar *sess_id, const gchar *participant); | |
62 void (*set_remote_codecs) (PurpleMediaBackend *self, | |
63 const gchar *sess_id, const gchar *participant, | |
64 GList *codecs); | |
65 void (*set_send_codec) (PurpleMediaBackend *self, | |
66 const gchar *sess_id, PurpleMediaCodec *codec); | |
67 }; | |
68 | |
69 GType purple_media_backend_get_type(void); | |
70 | |
71 gboolean purple_media_backend_add_stream(PurpleMediaBackend *self, | |
72 const gchar *sess_id, const gchar *who, | |
73 PurpleMediaSessionType type, gboolean initiator, | |
74 const gchar *transmitter, | |
75 guint num_params, GParameter *params); | |
76 void purple_media_backend_add_remote_candidates(PurpleMediaBackend *self, | |
77 const gchar *sess_id, const gchar *participant, | |
78 GList *remote_candidates); | |
79 GList *purple_media_backend_get_codecs(PurpleMediaBackend *self, | |
80 const gchar *sess_id); | |
81 GList *purple_media_backend_get_local_candidates(PurpleMediaBackend *self, | |
82 const gchar *sess_id, const gchar *participant); | |
83 void purple_media_backend_set_remote_codecs(PurpleMediaBackend *self, | |
84 const gchar *sess_id, const gchar *participant, | |
85 GList *codecs); | |
86 void purple_media_backend_set_send_codec(PurpleMediaBackend *self, | |
87 const gchar *sess_id, PurpleMediaCodec *codec); | |
88 | |
89 G_END_DECLS | |
90 | |
91 #endif /* _MEDIA_BACKEND_IFACE_H_ */ |