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
74 GList *purple_media_get_session_ids(PurpleMedia *media);
75
85 PurpleAccount *purple_media_get_account(PurpleMedia *media);
86
96 gpointer purple_media_get_prpl_data(PurpleMedia *media);
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
164 void purple_media_set_params(PurpleMedia *media,
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
261 void purple_media_add_remote_candidates(PurpleMedia *media,
262 const gchar *sess_id,
263 const gchar *participant,
264 GList *remote_candidates);
265
275 GList *purple_media_get_local_candidates(PurpleMedia *media,
276 const gchar *sess_id,
277 const gchar *participant);
278
291 GList *purple_media_get_active_local_candidates(PurpleMedia *media,
292 const gchar *sess_id, const gchar *participant);
293
306 GList *purple_media_get_active_remote_candidates(PurpleMedia *media,
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
335 gboolean purple_media_candidates_prepared(PurpleMedia *media,
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
364 gboolean purple_media_set_encryption_parameters(PurpleMedia *media,
365 const gchar *sess_id, const gchar *cipher,
366 const gchar *auth, const gchar *key, gsize key_len);
367
383 gboolean purple_media_set_decryption_parameters(PurpleMedia *media,
384 const gchar *sess_id, const gchar *participant,
385 const gchar *cipher, const gchar *auth,
386 const gchar *key, gsize key_len);
387
398 gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id);
399
412 gboolean purple_media_set_send_rtcp_mux(PurpleMedia *media,
413 const gchar *sess_id, const gchar *participant, gboolean send_rtcp_mux);
414
426 gboolean purple_media_is_initiator(PurpleMedia *media,
427 const gchar *sess_id, const gchar *participant);
428
440 gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
441 const gchar *participant);
442
452 void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level);
453
464 void purple_media_set_output_volume(PurpleMedia *media, const gchar *session_id,
465 const gchar *participant, double level);
466
479 gulong purple_media_set_output_window(PurpleMedia *media,
480 const gchar *session_id, const gchar *participant,
481 gulong window_id);
482
490 void purple_media_remove_output_windows(PurpleMedia *media);
491
504 gboolean purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id,
505 gchar dtmf, guint8 volume, guint16 duration);
506
507 #ifdef __cplusplus
508 }
509 #endif
510
511 G_END_DECLS
512
513 #endif /* _PURPLE_MEDIA_H_ */
purple_media_set_input_volume
void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level)
Sets the input volume of all the selected sessions.
purple_media_end
void purple_media_end(PurpleMedia *media, const gchar *session_id, const gchar *participant)
Ends all streams that match the given parameters.
purple_media_set_encryption_parameters
gboolean purple_media_set_encryption_parameters(PurpleMedia *media, const gchar *sess_id, const gchar *cipher, const gchar *auth, const gchar *key, gsize key_len)
Sets the encryption parameters of our media in the session.
purple_media_param_is_supported
gboolean purple_media_param_is_supported(PurpleMedia *media, const gchar *param)
Checks if given optional parameter is supported by the media backend.
purple_media_is_initiator
gboolean purple_media_is_initiator(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets whether the local user is the conference/session/stream&#39;s initiator.
purple_media_remove_output_windows
void purple_media_remove_output_windows(PurpleMedia *media)
Removes all output windows from a given media session.
purple_media_set_output_window
gulong purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, const gchar *participant, gulong window_id)
Sets a video output window for the given session/stream.
purple_media_get_active_local_candidates
GList * purple_media_get_active_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets the active local candidates for the stream.
purple_media_error
void purple_media_error(PurpleMedia *media, const gchar *error,...)
Signals an error in the media session.
_PurpleAccount
Structure representing an account.
Definition: account.h:169
purple_media_get_active_remote_candidates
GList * purple_media_get_active_remote_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets the active remote candidates for the stream.
purple_media_stream_info
void purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type, const gchar *session_id, const gchar *participant, gboolean local)
Signals different information about the given stream.
purple_media_get_session_type
PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id)
Gets the session type from a session.
purple_media_get_type
GType purple_media_get_type(void)
Gets the media class&#39;s GType.
purple_media_candidates_prepared
gboolean purple_media_candidates_prepared(PurpleMedia *media, const gchar *session_id, const gchar *participant)
Returns whether or not the candidates for set of streams are prepared.
purple_media_set_params
void purple_media_set_params(PurpleMedia *media, guint num_params, GParameter *params)
Sets various optional parameters of the media call.
purple_media_add_stream
gboolean purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, const gchar *who, PurpleMediaSessionType type, gboolean initiator, const gchar *transmitter, guint num_params, GParameter *params)
Adds a stream to a session.
util.h
Utility Functions.
purple_media_add_remote_candidates
void purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant, GList *remote_candidates)
Adds remote candidates to the stream.
purple_media_accepted
gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets whether a streams selected have been accepted.
purple_media_get_session_ids
GList * purple_media_get_session_ids(PurpleMedia *media)
Gets a list of session IDs.
purple_media_set_send_codec
gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec)
Sets the send codec for the a session.
PurpleMedia
struct _PurpleMedia PurpleMedia
An opaque structure representing a media call.
Definition: media.h:47
purple_media_get_available_params
const gchar ** purple_media_get_available_params(PurpleMedia *media)
Gets the list of optional parameters supported by the media backend.
purple_media_get_local_candidates
GList * purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets the local candidates from a stream.
purple_media_get_manager
struct _PurpleMediaManager * purple_media_get_manager(PurpleMedia *media)
Gets the PurpleMediaManager this media session is a part of.
signals.h
Signal API.
purple_media_get_account
PurpleAccount * purple_media_get_account(PurpleMedia *media)
Gets the PurpleAccount this media session is on.
purple_media_get_codecs
GList * purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id)
Gets the codecs from a session.
purple_media_send_dtmf
gboolean purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id, gchar dtmf, guint8 volume, guint16 duration)
Sends a DTMF signal out-of-band.
purple_media_set_decryption_parameters
gboolean purple_media_set_decryption_parameters(PurpleMedia *media, const gchar *sess_id, const gchar *participant, const gchar *cipher, const gchar *auth, const gchar *key, gsize key_len)
Sets the decryption parameters for a session participant&#39;s media.
purple_media_set_output_volume
void purple_media_set_output_volume(PurpleMedia *media, const gchar *session_id, const gchar *participant, double level)
Sets the output volume of all the selected streams.
purple_media_set_prpl_data
void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data)
Sets the prpl data on the media session.
purple_media_set_remote_codecs
gboolean purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, const gchar *participant, GList *codecs)
Sets remote candidates from the stream.
purple_media_codecs_ready
gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id)
Gets whether a session&#39;s codecs are ready to be used.
purple_media_set_send_rtcp_mux
gboolean purple_media_set_send_rtcp_mux(PurpleMedia *media, const gchar *sess_id, const gchar *participant, gboolean send_rtcp_mux)
Sets the rtcp-mux option for the stream.
purple_media_get_prpl_data
gpointer purple_media_get_prpl_data(PurpleMedia *media)
Gets the prpl data from the media session.