pidgin: media.h Source File

pidgin 2.14.4

Loading...
Searching...
No Matches
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#include "glibcompat.h"
34
35#include <glib.h>
36#include <glib-object.h>
37
38G_BEGIN_DECLS
39
40#define PURPLE_TYPE_MEDIA (purple_media_get_type())
41#define PURPLE_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia))
42#define PURPLE_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass))
43#define PURPLE_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA))
44#define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA))
45#define PURPLE_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
46
48 typedef struct _PurpleMedia PurpleMedia;
49
50#include "signals.h"
51#include "util.h"
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
64GType purple_media_get_type(void);
65
75GList *purple_media_get_session_ids(PurpleMedia *media);
76
86 PurpleAccount *purple_media_get_account(PurpleMedia *media);
87
97gpointer purple_media_get_prpl_data(PurpleMedia *media);
98
107 void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data);
108
118 void purple_media_error(PurpleMedia *media, const gchar *error, ...);
119
129 void purple_media_end(PurpleMedia *media, const gchar *session_id,
130 const gchar *participant);
131
143 void purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type,
144 const gchar *session_id, const gchar *participant,
145 gboolean local);
146
165G_GNUC_BEGIN_IGNORE_DEPRECATIONS
166 void purple_media_set_params(PurpleMedia *media,
167 guint num_params, GParameter *params);
168G_GNUC_END_IGNORE_DEPRECATIONS
169
181 const gchar **purple_media_get_available_params(PurpleMedia *media);
182
193gboolean purple_media_param_is_supported(PurpleMedia *media, const gchar *param);
194
214G_GNUC_BEGIN_IGNORE_DEPRECATIONS
215gboolean purple_media_add_stream(PurpleMedia *media, const gchar *sess_id,
216 const gchar *who, PurpleMediaSessionType type,
217 gboolean initiator, const gchar *transmitter,
218 guint num_params, GParameter *params);
219G_GNUC_END_IGNORE_DEPRECATIONS
220
231PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id);
232
242 struct _PurpleMediaManager *purple_media_get_manager(PurpleMedia *media);
243
254GList *purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id);
255
266 void purple_media_add_remote_candidates(PurpleMedia *media,
267 const gchar *sess_id,
268 const gchar *participant,
269 GList *remote_candidates);
270
280GList *purple_media_get_local_candidates(PurpleMedia *media,
281 const gchar *sess_id,
282 const gchar *participant);
283
296GList *purple_media_get_active_local_candidates(PurpleMedia *media,
297 const gchar *sess_id, const gchar *participant);
298
311GList *purple_media_get_active_remote_candidates(PurpleMedia *media,
312 const gchar *sess_id, const gchar *participant);
313
326gboolean purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id,
327 const gchar *participant, GList *codecs);
328
340gboolean purple_media_candidates_prepared(PurpleMedia *media,
341 const gchar *session_id, const gchar *participant);
342
354gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec);
355
369gboolean purple_media_set_encryption_parameters(PurpleMedia *media,
370 const gchar *sess_id, const gchar *cipher,
371 const gchar *auth, const gchar *key, gsize key_len);
372
388gboolean purple_media_set_decryption_parameters(PurpleMedia *media,
389 const gchar *sess_id, const gchar *participant,
390 const gchar *cipher, const gchar *auth,
391 const gchar *key, gsize key_len);
392
403gboolean purple_media_set_require_encryption(PurpleMedia *media,
404 const gchar *sess_id, const gchar *participant,
405 gboolean require_encryption);
406
417gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id);
418
431gboolean purple_media_set_send_rtcp_mux(PurpleMedia *media,
432 const gchar *sess_id, const gchar *participant, gboolean send_rtcp_mux);
433
445gboolean purple_media_is_initiator(PurpleMedia *media,
446 const gchar *sess_id, const gchar *participant);
447
459gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
460 const gchar *participant);
461
471 void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level);
472
483 void purple_media_set_output_volume(PurpleMedia *media, const gchar *session_id,
484 const gchar *participant, double level);
485
498gulong purple_media_set_output_window(PurpleMedia *media,
499 const gchar *session_id, const gchar *participant,
500 gulong window_id);
501
509 void purple_media_remove_output_windows(PurpleMedia *media);
510
523gboolean purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id,
524 gchar dtmf, guint8 volume, guint16 duration);
525
526#ifdef __cplusplus
527}
528#endif
529
530G_END_DECLS
531
532#endif /* _PURPLE_MEDIA_H_ */
glibcompat.h
Compatibility for many glib versions.
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_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_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_set_params
G_GNUC_BEGIN_IGNORE_DEPRECATIONS void purple_media_set_params(PurpleMedia *media, guint num_params, GParameter *params)
Sets various optional parameters of the media call.
purple_media_get_manager
struct _PurpleMediaManager * purple_media_get_manager(PurpleMedia *media)
Gets the PurpleMediaManager this media session is a part of.
purple_media_get_session_type
G_GNUC_END_IGNORE_DEPRECATIONS PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id)
Gets the session type from a session.
purple_media_get_account
PurpleAccount * purple_media_get_account(PurpleMedia *media)
Gets the PurpleAccount this media session is on.
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_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_set_require_encryption
gboolean purple_media_set_require_encryption(PurpleMedia *media, const gchar *sess_id, const gchar *participant, gboolean require_encryption)
Sets whether a session participant's media requires encryption.
purple_media_add_stream
G_GNUC_BEGIN_IGNORE_DEPRECATIONS 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.
purple_media_codecs_ready
gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id)
Gets whether a session's codecs are ready to be used.
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_send_codec
gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec)
Sets the send codec for the 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_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_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_codecs
GList * purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id)
Gets the codecs from a session.
purple_media_get_available_params
G_GNUC_END_IGNORE_DEPRECATIONS const gchar ** purple_media_get_available_params(PurpleMedia *media)
Gets the list of optional parameters supported by the media backend.
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_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_get_type
GType purple_media_get_type(void)
Gets the media class's GType.
purple_media_error
void purple_media_error(PurpleMedia *media, const gchar *error,...)
Signals an error in the media session.
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_accepted
gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets whether a streams selected have been accepted.
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_get_session_ids
GList * purple_media_get_session_ids(PurpleMedia *media)
Gets a list of session IDs.
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_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_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_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's media.
PurpleMedia
struct _PurpleMedia PurpleMedia
An opaque structure representing a media call.
Definition: media.h:48
purple_media_get_prpl_data
gpointer purple_media_get_prpl_data(PurpleMedia *media)
Gets the prpl data from the media session.
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's initiator.
signals.h
Signal API.
_PurpleAccount
Structure representing an account.
Definition: account.h:170
util.h
Utility Functions.