pidgin 2.14.14dev
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
48typedef struct _PurpleMedia PurpleMedia;
49
50#include "signals.h"
51#include "util.h"
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
65
76
87
98
107void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data);
108
118void purple_media_error(PurpleMedia *media, const gchar *error, ...);
119
129void purple_media_end(PurpleMedia *media, const gchar *session_id,
130 const gchar *participant);
131
143void 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
167 guint num_params, GParameter *params);
168G_GNUC_END_IGNORE_DEPRECATIONS
169
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
242struct _PurpleMediaManager *purple_media_get_manager(PurpleMedia *media);
243
254GList *purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id);
255
267 const gchar *sess_id,
268 const gchar *participant,
269 GList *remote_candidates);
270
281 const gchar *sess_id,
282 const gchar *participant);
283
297 const gchar *sess_id, const gchar *participant);
298
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
341 const gchar *session_id, const gchar *participant);
342
354gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec);
355
370 const gchar *sess_id, const gchar *cipher,
371 const gchar *auth, const gchar *key, gsize key_len);
372
389 const gchar *sess_id, const gchar *participant,
390 const gchar *cipher, const gchar *auth,
391 const gchar *key, gsize key_len);
392
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
432 const gchar *sess_id, const gchar *participant, gboolean send_rtcp_mux);
433
446 const gchar *sess_id, const gchar *participant);
447
459gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
460 const gchar *participant);
461
471void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level);
472
483void purple_media_set_output_volume(PurpleMedia *media, const gchar *session_id,
484 const gchar *participant, double level);
485
499 const gchar *session_id, const gchar *participant,
500 gulong window_id);
501
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_ */
Compatibility for many glib versions.
gboolean purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, const gchar *participant, GList *codecs)
Sets remote candidates from the stream.
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.
void purple_media_end(PurpleMedia *media, const gchar *session_id, const gchar *participant)
Ends all streams that match the given 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.
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.
struct _PurpleMediaManager * purple_media_get_manager(PurpleMedia *media)
Gets the PurpleMediaManager this media session is a part of.
G_GNUC_END_IGNORE_DEPRECATIONS PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id)
Gets the session type from a session.
PurpleAccount * purple_media_get_account(PurpleMedia *media)
Gets the PurpleAccount this media session is on.
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.
GList * purple_media_get_active_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets the active local candidates for the stream.
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.
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.
gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id)
Gets whether a session's codecs are ready to be used.
void purple_media_remove_output_windows(PurpleMedia *media)
Removes all output windows from a given media session.
gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec)
Sets the send codec for the a session.
gboolean purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id, gchar dtmf, guint8 volume, guint16 duration)
Sends a DTMF signal out-of-band.
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.
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.
GList * purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id)
Gets the codecs from a session.
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.
GList * purple_media_get_active_remote_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets the active remote candidates for the stream.
void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level)
Sets the input volume of all the selected sessions.
GType purple_media_get_type(void)
Gets the media class's GType.
void purple_media_error(PurpleMedia *media, const gchar *error,...)
Signals an error in the media session.
GList * purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets the local candidates from a stream.
gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id, const gchar *participant)
Gets whether a streams selected have been accepted.
void purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *participant, GList *remote_candidates)
Adds remote candidates to the stream.
GList * purple_media_get_session_ids(PurpleMedia *media)
Gets a list of session IDs.
void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data)
Sets the prpl data on the media session.
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.
gboolean purple_media_param_is_supported(PurpleMedia *media, const gchar *param)
Checks if given optional parameter is supported by the media backend.
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.
struct _PurpleMedia PurpleMedia
An opaque structure representing a media call.
Definition media.h:48
gpointer purple_media_get_prpl_data(PurpleMedia *media)
Gets the prpl data from the media session.
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.
Signal API.
Structure representing an account.
Definition account.h:170
Utility Functions.