media.h
Go to the documentation of this file.
1 
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 _PURPLE_MEDIA_H_
28 #define _PURPLE_MEDIA_H_
29 
30 #include "media/candidate.h"
31 #include "media/codec.h"
32 #include "media/enum-types.h"
33 
34 #include <glib.h>
35 #include <glib-object.h>
36 
37 G_BEGIN_DECLS
38 
39 #define PURPLE_TYPE_MEDIA (purple_media_get_type())
40 #define PURPLE_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia))
41 #define PURPLE_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass))
42 #define PURPLE_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA))
43 #define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA))
44 #define PURPLE_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
45 
47 typedef struct _PurpleMedia PurpleMedia;
48 
49 #include "signals.h"
50 #include "util.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
63 GType purple_media_get_type(void);
64 
75 
86 
97 
106 void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data);
107 
117 void purple_media_error(PurpleMedia *media, const gchar *error, ...);
118 
128 void purple_media_end(PurpleMedia *media, const gchar *session_id,
129  const gchar *participant);
130 
142 void purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type,
143  const gchar *session_id, const gchar *participant,
144  gboolean local);
145 
165  guint num_params, GParameter *params);
166 
178 const gchar **purple_media_get_available_params(PurpleMedia *media);
179 
190 gboolean purple_media_param_is_supported(PurpleMedia *media, const gchar *param);
191 
211 gboolean purple_media_add_stream(PurpleMedia *media, const gchar *sess_id,
212  const gchar *who, PurpleMediaSessionType type,
213  gboolean initiator, const gchar *transmitter,
214  guint num_params, GParameter *params);
215 
226 PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id);
227 
237 struct _PurpleMediaManager *purple_media_get_manager(PurpleMedia *media);
238 
249 GList *purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id);
250 
262  const gchar *sess_id,
263  const gchar *participant,
264  GList *remote_candidates);
265 
276  const gchar *sess_id,
277  const gchar *participant);
278 
292  const gchar *sess_id, const gchar *participant);
293 
307  const gchar *sess_id, const gchar *participant);
308 
321 gboolean purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id,
322  const gchar *participant, GList *codecs);
323 
336  const gchar *session_id, const gchar *participant);
337 
349 gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec);
350 
361 gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id);
362 
374 gboolean purple_media_is_initiator(PurpleMedia *media,
375  const gchar *sess_id, const gchar *participant);
376 
388 gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
389  const gchar *participant);
390 
400 void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level);
401 
412 void purple_media_set_output_volume(PurpleMedia *media, const gchar *session_id,
413  const gchar *participant, double level);
414 
428  const gchar *session_id, const gchar *participant,
429  gulong window_id);
430 
439 
440 #ifdef __cplusplus
441 }
442 #endif
443 
444 G_END_DECLS
445 
446 #endif /* _PURPLE_MEDIA_H_ */