1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/media.h Fri Aug 21 13:25:11 2009 -0700
1.3 @@ -0,0 +1,692 @@
1.4 +/**
1.5 + * @file media.h Media API
1.6 + * @ingroup core
1.7 + */
1.8 +
1.9 +/* purple
1.10 + *
1.11 + * Purple is the legal property of its developers, whose names are too numerous
1.12 + * to list here. Please refer to the COPYRIGHT file distributed with this
1.13 + * source distribution.
1.14 + *
1.15 + * This program is free software; you can redistribute it and/or modify
1.16 + * it under the terms of the GNU General Public License as published by
1.17 + * the Free Software Foundation; either version 2 of the License, or
1.18 + * (at your option) any later version.
1.19 + *
1.20 + * This program is distributed in the hope that it will be useful,
1.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.23 + * GNU General Public License for more details.
1.24 + *
1.25 + * You should have received a copy of the GNU General Public License
1.26 + * along with this program; if not, write to the Free Software
1.27 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.28 + */
1.29 +
1.30 +#ifndef _PURPLE_MEDIA_H_
1.31 +#define _PURPLE_MEDIA_H_
1.32 +
1.33 +#include <glib.h>
1.34 +#include <glib-object.h>
1.35 +
1.36 +G_BEGIN_DECLS
1.37 +
1.38 +#define PURPLE_TYPE_MEDIA_CANDIDATE (purple_media_candidate_get_type())
1.39 +#define PURPLE_MEDIA_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate))
1.40 +#define PURPLE_MEDIA_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate))
1.41 +#define PURPLE_IS_MEDIA_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_CANDIDATE))
1.42 +#define PURPLE_IS_MEDIA_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_CANDIDATE))
1.43 +#define PURPLE_MEDIA_CANDIDATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate))
1.44 +
1.45 +#define PURPLE_TYPE_MEDIA_CODEC (purple_media_codec_get_type())
1.46 +#define PURPLE_MEDIA_CODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec))
1.47 +#define PURPLE_MEDIA_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec))
1.48 +#define PURPLE_IS_MEDIA_CODEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_CODEC))
1.49 +#define PURPLE_IS_MEDIA_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_CODEC))
1.50 +#define PURPLE_MEDIA_CODEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec))
1.51 +
1.52 +#define PURPLE_TYPE_MEDIA_SESSION_TYPE (purple_media_session_type_get_type())
1.53 +#define PURPLE_TYPE_MEDIA (purple_media_get_type())
1.54 +#define PURPLE_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia))
1.55 +#define PURPLE_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass))
1.56 +#define PURPLE_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA))
1.57 +#define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA))
1.58 +#define PURPLE_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
1.59 +
1.60 +#define PURPLE_TYPE_MEDIA_CANDIDATE_TYPE (purple_media_candidate_type_get_type())
1.61 +#define PURPLE_TYPE_MEDIA_NETWORK_PROTOCOL (purple_media_network_protocol_get_type())
1.62 +#define PURPLE_MEDIA_TYPE_STATE (purple_media_state_changed_get_type())
1.63 +#define PURPLE_MEDIA_TYPE_INFO_TYPE (purple_media_info_type_get_type())
1.64 +
1.65 +/** @copydoc _PurpleMedia */
1.66 +typedef struct _PurpleMedia PurpleMedia;
1.67 +/** @copydoc _PurpleMediaCandidate */
1.68 +typedef struct _PurpleMediaCandidate PurpleMediaCandidate;
1.69 +/** @copydoc _PurpleMediaCodec */
1.70 +typedef struct _PurpleMediaCodec PurpleMediaCodec;
1.71 +
1.72 +/** Media caps */
1.73 +typedef enum {
1.74 + PURPLE_MEDIA_CAPS_NONE = 0,
1.75 + PURPLE_MEDIA_CAPS_AUDIO = 1,
1.76 + PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION = 1 << 1,
1.77 + PURPLE_MEDIA_CAPS_VIDEO = 1 << 2,
1.78 + PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION = 1 << 3,
1.79 + PURPLE_MEDIA_CAPS_AUDIO_VIDEO = 1 << 4,
1.80 + PURPLE_MEDIA_CAPS_MODIFY_SESSION = 1 << 5,
1.81 + PURPLE_MEDIA_CAPS_CHANGE_DIRECTION = 1 << 6,
1.82 +} PurpleMediaCaps;
1.83 +
1.84 +/** Media session types */
1.85 +typedef enum {
1.86 + PURPLE_MEDIA_NONE = 0,
1.87 + PURPLE_MEDIA_RECV_AUDIO = 1 << 0,
1.88 + PURPLE_MEDIA_SEND_AUDIO = 1 << 1,
1.89 + PURPLE_MEDIA_RECV_VIDEO = 1 << 2,
1.90 + PURPLE_MEDIA_SEND_VIDEO = 1 << 3,
1.91 + PURPLE_MEDIA_AUDIO = PURPLE_MEDIA_RECV_AUDIO | PURPLE_MEDIA_SEND_AUDIO,
1.92 + PURPLE_MEDIA_VIDEO = PURPLE_MEDIA_RECV_VIDEO | PURPLE_MEDIA_SEND_VIDEO
1.93 +} PurpleMediaSessionType;
1.94 +
1.95 +/** Media state-changed types */
1.96 +typedef enum {
1.97 + PURPLE_MEDIA_STATE_NEW = 0,
1.98 + PURPLE_MEDIA_STATE_CONNECTED,
1.99 + PURPLE_MEDIA_STATE_END,
1.100 +} PurpleMediaState;
1.101 +
1.102 +/** Media info types */
1.103 +typedef enum {
1.104 + PURPLE_MEDIA_INFO_HANGUP = 0,
1.105 + PURPLE_MEDIA_INFO_ACCEPT,
1.106 + PURPLE_MEDIA_INFO_REJECT,
1.107 + PURPLE_MEDIA_INFO_MUTE,
1.108 + PURPLE_MEDIA_INFO_UNMUTE,
1.109 + PURPLE_MEDIA_INFO_PAUSE,
1.110 + PURPLE_MEDIA_INFO_UNPAUSE,
1.111 + PURPLE_MEDIA_INFO_HOLD,
1.112 + PURPLE_MEDIA_INFO_UNHOLD,
1.113 +} PurpleMediaInfoType;
1.114 +
1.115 +typedef enum {
1.116 + PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
1.117 + PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
1.118 + PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX,
1.119 + PURPLE_MEDIA_CANDIDATE_TYPE_RELAY,
1.120 + PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST,
1.121 +} PurpleMediaCandidateType;
1.122 +
1.123 +typedef enum {
1.124 + PURPLE_MEDIA_COMPONENT_NONE = 0,
1.125 + PURPLE_MEDIA_COMPONENT_RTP = 1,
1.126 + PURPLE_MEDIA_COMPONENT_RTCP = 2,
1.127 +} PurpleMediaComponentType;
1.128 +
1.129 +typedef enum {
1.130 + PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
1.131 + PURPLE_MEDIA_NETWORK_PROTOCOL_TCP,
1.132 +} PurpleMediaNetworkProtocol;
1.133 +
1.134 +#include "signals.h"
1.135 +#include "util.h"
1.136 +
1.137 +#ifdef __cplusplus
1.138 +extern "C" {
1.139 +#endif
1.140 +
1.141 +/**
1.142 + * Gets the media session type's GType
1.143 + *
1.144 + * @return The media session type's GType.
1.145 + *
1.146 + * @since 2.6.0
1.147 + */
1.148 +GType purple_media_session_type_get_type(void);
1.149 +
1.150 +/**
1.151 + * Gets the media candidate type's GType
1.152 + *
1.153 + * @return The media candidate type's GType.
1.154 + *
1.155 + * @since 2.6.0
1.156 + */
1.157 +GType purple_media_candidate_type_get_type(void);
1.158 +
1.159 +/**
1.160 + * Gets the media network protocol's GType
1.161 + *
1.162 + * @return The media network protocol's GType.
1.163 + *
1.164 + * @since 2.6.0
1.165 + */
1.166 +GType purple_media_network_protocol_get_type(void);
1.167 +
1.168 +/**
1.169 + * Gets the media class's GType
1.170 + *
1.171 + * @return The media class's GType.
1.172 + *
1.173 + * @since 2.6.0
1.174 + */
1.175 +GType purple_media_get_type(void);
1.176 +
1.177 +/**
1.178 + * Gets the type of the state-changed enum
1.179 + *
1.180 + * @return The state-changed enum's GType
1.181 + *
1.182 + * @since 2.6.0
1.183 + */
1.184 +GType purple_media_state_changed_get_type(void);
1.185 +
1.186 +/**
1.187 + * Gets the type of the info type enum
1.188 + *
1.189 + * @return The info type enum's GType
1.190 + *
1.191 + * @since 2.6.0
1.192 + */
1.193 +GType purple_media_info_type_get_type(void);
1.194 +
1.195 +/**
1.196 + * Gets the type of the media candidate structure.
1.197 + *
1.198 + * @return The media canditate's GType
1.199 + *
1.200 + * @since 2.6.0
1.201 + */
1.202 +GType purple_media_candidate_get_type(void);
1.203 +
1.204 +/**
1.205 + * Creates a PurpleMediaCandidate instance.
1.206 + *
1.207 + * @param foundation The foundation of the candidate.
1.208 + * @param component_id The component this candidate is for.
1.209 + * @param type The type of candidate.
1.210 + * @param proto The protocol this component is for.
1.211 + * @param ip The IP address of this component.
1.212 + * @param port The network port.
1.213 + *
1.214 + * @return The newly created PurpleMediaCandidate instance.
1.215 + *
1.216 + * @since 2.6.0
1.217 + */
1.218 +PurpleMediaCandidate *purple_media_candidate_new(
1.219 + const gchar *foundation, guint component_id,
1.220 + PurpleMediaCandidateType type,
1.221 + PurpleMediaNetworkProtocol proto,
1.222 + const gchar *ip, guint port);
1.223 +
1.224 +/**
1.225 + * Copies a GList of PurpleMediaCandidate and its contents.
1.226 + *
1.227 + * @param candidates The list of candidates to be copied.
1.228 + *
1.229 + * @return The copy of the GList.
1.230 + *
1.231 + * @since 2.6.0
1.232 + */
1.233 +GList *purple_media_candidate_list_copy(GList *candidates);
1.234 +
1.235 +/**
1.236 + * Frees a GList of PurpleMediaCandidate and its contents.
1.237 + *
1.238 + * @param candidates The list of candidates to be freed.
1.239 + *
1.240 + * @since 2.6.0
1.241 + */
1.242 +void purple_media_candidate_list_free(GList *candidates);
1.243 +
1.244 +gchar *purple_media_candidate_get_foundation(PurpleMediaCandidate *candidate);
1.245 +guint purple_media_candidate_get_component_id(PurpleMediaCandidate *candidate);
1.246 +gchar *purple_media_candidate_get_ip(PurpleMediaCandidate *candidate);
1.247 +guint16 purple_media_candidate_get_port(PurpleMediaCandidate *candidate);
1.248 +gchar *purple_media_candidate_get_base_ip(PurpleMediaCandidate *candidate);
1.249 +guint16 purple_media_candidate_get_base_port(PurpleMediaCandidate *candidate);
1.250 +PurpleMediaNetworkProtocol purple_media_candidate_get_protocol(
1.251 + PurpleMediaCandidate *candidate);
1.252 +guint32 purple_media_candidate_get_priority(PurpleMediaCandidate *candidate);
1.253 +PurpleMediaCandidateType purple_media_candidate_get_candidate_type(
1.254 + PurpleMediaCandidate *candidate);
1.255 +gchar *purple_media_candidate_get_username(PurpleMediaCandidate *candidate);
1.256 +gchar *purple_media_candidate_get_password(PurpleMediaCandidate *candidate);
1.257 +guint purple_media_candidate_get_ttl(PurpleMediaCandidate *candidate);
1.258 +
1.259 +/**
1.260 + * Gets the type of the media codec structure.
1.261 + *
1.262 + * @return The media codec's GType
1.263 + *
1.264 + * @since 2.6.0
1.265 + */
1.266 +GType purple_media_codec_get_type(void);
1.267 +
1.268 +/**
1.269 + * Creates a new PurpleMediaCodec instance.
1.270 + *
1.271 + * @param id Codec identifier.
1.272 + * @param encoding_name Name of the media type this encodes.
1.273 + * @param media_type PurpleMediaSessionType of this codec.
1.274 + * @param clock_rate The clock rate this codec encodes at, if applicable.
1.275 + *
1.276 + * @return The newly created PurpleMediaCodec.
1.277 + *
1.278 + * @since 2.6.0
1.279 + */
1.280 +PurpleMediaCodec *purple_media_codec_new(int id, const char *encoding_name,
1.281 + PurpleMediaSessionType media_type, guint clock_rate);
1.282 +
1.283 +guint purple_media_codec_get_id(PurpleMediaCodec *codec);
1.284 +gchar *purple_media_codec_get_encoding_name(PurpleMediaCodec *codec);
1.285 +guint purple_media_codec_get_clock_rate(PurpleMediaCodec *codec);
1.286 +guint purple_media_codec_get_channels(PurpleMediaCodec *codec);
1.287 +GList *purple_media_codec_get_optional_parameters(PurpleMediaCodec *codec);
1.288 +
1.289 +/**
1.290 + * Creates a string representation of the codec.
1.291 + *
1.292 + * @param codec The codec to create the string of.
1.293 + *
1.294 + * @return The new string representation.
1.295 + *
1.296 + * @since 2.6.0
1.297 + */
1.298 +gchar *purple_media_codec_to_string(const PurpleMediaCodec *codec);
1.299 +
1.300 +/**
1.301 + * Adds an optional parameter to the codec.
1.302 + *
1.303 + * @param codec The codec to add the parameter to.
1.304 + * @param name The name of the parameter to add.
1.305 + * @param value The value of the parameter to add.
1.306 + *
1.307 + * @since 2.6.0
1.308 + */
1.309 +void purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec,
1.310 + const gchar *name, const gchar *value);
1.311 +
1.312 +/**
1.313 + * Removes an optional parameter from the codec.
1.314 + *
1.315 + * @param codec The codec to remove the parameter from.
1.316 + * @param param A pointer to the parameter to remove.
1.317 + *
1.318 + * @since 2.6.0
1.319 + */
1.320 +void purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec,
1.321 + PurpleKeyValuePair *param);
1.322 +
1.323 +/**
1.324 + * Gets an optional parameter based on the values given.
1.325 + *
1.326 + * @param codec The codec to find the parameter in.
1.327 + * @param name The name of the parameter to search for.
1.328 + * @param value The value to search for or NULL.
1.329 + *
1.330 + * @return The value found or NULL.
1.331 + *
1.332 + * @since 2.6.0
1.333 + */
1.334 +PurpleKeyValuePair *purple_media_codec_get_optional_parameter(
1.335 + PurpleMediaCodec *codec, const gchar *name,
1.336 + const gchar *value);
1.337 +
1.338 +/**
1.339 + * Copies a GList of PurpleMediaCodec and its contents.
1.340 + *
1.341 + * @param codecs The list of codecs to be copied.
1.342 + *
1.343 + * @return The copy of the GList.
1.344 + *
1.345 + * @since 2.6.0
1.346 + */
1.347 +GList *purple_media_codec_list_copy(GList *codecs);
1.348 +
1.349 +/**
1.350 + * Frees a GList of PurpleMediaCodec and its contents.
1.351 + *
1.352 + * @param codecs The list of codecs to be freed.
1.353 + *
1.354 + * @since 2.6.0
1.355 + */
1.356 +void purple_media_codec_list_free(GList *codecs);
1.357 +
1.358 +/**
1.359 + * Gets a list of session IDs.
1.360 + *
1.361 + * @param media The media session from which to retrieve session IDs.
1.362 + *
1.363 + * @return GList of session IDs. The caller must free the list.
1.364 + *
1.365 + * @since 2.6.0
1.366 + */
1.367 +GList *purple_media_get_session_ids(PurpleMedia *media);
1.368 +
1.369 +/**
1.370 + * Gets the PurpleAccount this media session is on.
1.371 + *
1.372 + * @param media The media session to retrieve the account from.
1.373 + *
1.374 + * @return The account retrieved.
1.375 + *
1.376 + * @since 2.6.0
1.377 + */
1.378 +PurpleAccount *purple_media_get_account(PurpleMedia *media);
1.379 +
1.380 +/**
1.381 + * Gets the prpl data from the media session.
1.382 + *
1.383 + * @param media The media session to retrieve the prpl data from.
1.384 + *
1.385 + * @return The prpl data retrieved.
1.386 + *
1.387 + * @since 2.6.0
1.388 + */
1.389 +gpointer purple_media_get_prpl_data(PurpleMedia *media);
1.390 +
1.391 +/**
1.392 + * Sets the prpl data on the media session.
1.393 + *
1.394 + * @param media The media session to set the prpl data on.
1.395 + * @param prpl_data The data to set on the media session.
1.396 + *
1.397 + * @since 2.6.0
1.398 + */
1.399 +void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data);
1.400 +
1.401 +/**
1.402 + * Signals an error in the media session.
1.403 + *
1.404 + * @param media The media object to set the state on.
1.405 + * @param error The format of the error message to send in the signal.
1.406 + * @param ... The arguments to plug into the format.
1.407 + *
1.408 + * @since 2.6.0
1.409 + */
1.410 +void purple_media_error(PurpleMedia *media, const gchar *error, ...);
1.411 +
1.412 +/**
1.413 + * Ends all streams that match the given parameters
1.414 + *
1.415 + * @param media The media object with which to end streams.
1.416 + * @param session_id The session to end streams on.
1.417 + * @param participant The participant to end streams with.
1.418 + *
1.419 + * @since 2.6.0
1.420 + */
1.421 +void purple_media_end(PurpleMedia *media, const gchar *session_id,
1.422 + const gchar *participant);
1.423 +
1.424 +/**
1.425 + * Signals different information about the given stream.
1.426 + *
1.427 + * @param media The media instance to containing the stream to signal.
1.428 + * @param type The type of info being signaled.
1.429 + * @param session_id The id of the session of the stream being signaled.
1.430 + * @param participant The participant of the stream being signaled.
1.431 + * @param local TRUE if the info originated locally, FALSE if on the remote end.
1.432 + *
1.433 + * @since 2.6.0
1.434 + */
1.435 +void purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type,
1.436 + const gchar *session_id, const gchar *participant,
1.437 + gboolean local);
1.438 +
1.439 +/**
1.440 + * Adds a stream to a session.
1.441 + *
1.442 + * It only adds a stream to one audio session or video session as
1.443 + * the @c sess_id must be unique between sessions.
1.444 + *
1.445 + * @param media The media object to find the session in.
1.446 + * @param sess_id The session id of the session to add the stream to.
1.447 + * @param who The name of the remote user to add the stream for.
1.448 + * @param type The type of stream to create.
1.449 + * @param initiator Whether or not the local user initiated the stream.
1.450 + * @param transmitter The transmitter to use for the stream.
1.451 + * @param num_params The number of parameters to pass to Farsight.
1.452 + * @param params The parameters to pass to Farsight.
1.453 + *
1.454 + * @return @c TRUE The stream was added successfully, @c FALSE otherwise.
1.455 + *
1.456 + * @since 2.6.0
1.457 + */
1.458 +gboolean purple_media_add_stream(PurpleMedia *media, const gchar *sess_id,
1.459 + const gchar *who, PurpleMediaSessionType type,
1.460 + gboolean initiator, const gchar *transmitter,
1.461 + guint num_params, GParameter *params);
1.462 +
1.463 +/**
1.464 + * Gets the session type from a session
1.465 + *
1.466 + * @param media The media object to find the session in.
1.467 + * @param sess_id The session id of the session to get the type from.
1.468 + *
1.469 + * @return The retreived session type.
1.470 + *
1.471 + * @since 2.6.0
1.472 + */
1.473 +PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id);
1.474 +
1.475 +/**
1.476 + * Gets the PurpleMediaManager this media session is a part of.
1.477 + *
1.478 + * @param media The media object to get the manager instance from.
1.479 + *
1.480 + * @return The PurpleMediaManager instance retrieved.
1.481 + *
1.482 + * @since 2.6.0
1.483 + */
1.484 +struct _PurpleMediaManager *purple_media_get_manager(PurpleMedia *media);
1.485 +
1.486 +/**
1.487 + * Gets the codecs from a session.
1.488 + *
1.489 + * @param media The media object to find the session in.
1.490 + * @param sess_id The session id of the session to get the codecs from.
1.491 + *
1.492 + * @return The retreieved codecs.
1.493 + *
1.494 + * @since 2.6.0
1.495 + */
1.496 +GList *purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id);
1.497 +
1.498 +/**
1.499 + * Adds remote candidates to the stream.
1.500 + *
1.501 + * @param media The media object to find the session in.
1.502 + * @param sess_id The session id of the session find the stream in.
1.503 + * @param participant The name of the remote user to add the candidates for.
1.504 + * @param remote_candidates The remote candidates to add.
1.505 + *
1.506 + * @since 2.6.0
1.507 + */
1.508 +void purple_media_add_remote_candidates(PurpleMedia *media,
1.509 + const gchar *sess_id,
1.510 + const gchar *participant,
1.511 + GList *remote_candidates);
1.512 +
1.513 +/**
1.514 + * Gets the local candidates from a stream.
1.515 + *
1.516 + * @param media The media object to find the session in.
1.517 + * @param sess_id The session id of the session to find the stream in.
1.518 + * @param participant The name of the remote user to get the candidates from.
1.519 + *
1.520 + * @since 2.6.0
1.521 + */
1.522 +GList *purple_media_get_local_candidates(PurpleMedia *media,
1.523 + const gchar *sess_id,
1.524 + const gchar *participant);
1.525 +
1.526 +#if 0
1.527 +/*
1.528 + * These two functions aren't being used and I'd rather not lock in the API
1.529 + * until they are needed. If they ever are.
1.530 + */
1.531 +
1.532 +/**
1.533 + * Gets the active local candidates for the stream.
1.534 + *
1.535 + * @param media The media object to find the session in.
1.536 + * @param sess_id The session id of the session to find the stream in.
1.537 + * @param participant The name of the remote user to get the active candidate
1.538 + * from.
1.539 + *
1.540 + * @return The active candidates retrieved.
1.541 + */
1.542 +GList *purple_media_get_active_local_candidates(PurpleMedia *media,
1.543 + const gchar *sess_id, const gchar *participant);
1.544 +
1.545 +/**
1.546 + * Gets the active remote candidates for the stream.
1.547 + *
1.548 + * @param media The media object to find the session in.
1.549 + * @param sess_id The session id of the session to find the stream in.
1.550 + * @param participant The name of the remote user to get the remote candidate
1.551 + * from.
1.552 + *
1.553 + * @return The remote candidates retrieved.
1.554 + */
1.555 +GList *purple_media_get_active_remote_candidates(PurpleMedia *media,
1.556 + const gchar *sess_id, const gchar *participant);
1.557 +#endif
1.558 +
1.559 +/**
1.560 + * Sets remote candidates from the stream.
1.561 + *
1.562 + * @param media The media object to find the session in.
1.563 + * @param sess_id The session id of the session find the stream in.
1.564 + * @param participant The name of the remote user to set the candidates from.
1.565 + *
1.566 + * @return @c TRUE The codecs were set successfully, or @c FALSE otherwise.
1.567 + *
1.568 + * @since 2.6.0
1.569 + */
1.570 +gboolean purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id,
1.571 + const gchar *participant, GList *codecs);
1.572 +
1.573 +/**
1.574 + * Returns whether or not the candidates for set of streams are prepared
1.575 + *
1.576 + * @param media The media object to find the remote user in.
1.577 + * @param session_id The session id of the session to check.
1.578 + * @param participant The remote user to check for.
1.579 + *
1.580 + * @return @c TRUE All streams for the given session_id/participant combination have candidates prepared, @c FALSE otherwise.
1.581 + *
1.582 + * @since 2.6.0
1.583 + */
1.584 +gboolean purple_media_candidates_prepared(PurpleMedia *media,
1.585 + const gchar *session_id, const gchar *participant);
1.586 +
1.587 +/**
1.588 + * Sets the send codec for the a session.
1.589 + *
1.590 + * @param media The media object to find the session in.
1.591 + * @param sess_id The session id of the session to set the codec for.
1.592 + * @param codec The codec to set the session to stream.
1.593 + *
1.594 + * @return @c TRUE The codec was successfully changed, or @c FALSE otherwise.
1.595 + *
1.596 + * @since 2.6.0
1.597 + */
1.598 +gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec);
1.599 +
1.600 +/**
1.601 + * Gets whether a session's codecs are ready to be used.
1.602 + *
1.603 + * @param media The media object to find the session in.
1.604 + * @param sess_id The session id of the session to check.
1.605 + *
1.606 + * @return @c TRUE The codecs are ready, or @c FALSE otherwise.
1.607 + *
1.608 + * @since 2.6.0
1.609 + */
1.610 +gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id);
1.611 +
1.612 +/**
1.613 + * Gets whether the local user is the conference/session/stream's initiator.
1.614 + *
1.615 + * @param media The media instance to find the session in.
1.616 + * @param sess_id The session id of the session to check.
1.617 + * @param participant The participant of the stream to check.
1.618 + *
1.619 + * @return TRUE if the local user is the stream's initator, else FALSE.
1.620 + *
1.621 + * @since 2.6.0
1.622 + */
1.623 +gboolean purple_media_is_initiator(PurpleMedia *media,
1.624 + const gchar *sess_id, const gchar *participant);
1.625 +
1.626 +/**
1.627 + * Gets whether a streams selected have been accepted.
1.628 + *
1.629 + * @param media The media object to find the session in.
1.630 + * @param sess_id The session id of the session to check.
1.631 + * @param participant The participant to check.
1.632 + *
1.633 + * @return @c TRUE The selected streams have been accepted, or @c FALSE otherwise.
1.634 + *
1.635 + * @since 2.6.0
1.636 + */
1.637 +gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
1.638 + const gchar *participant);
1.639 +
1.640 +/**
1.641 + * Sets the input volume of all the selected sessions.
1.642 + *
1.643 + * @param media The media object the sessions are in.
1.644 + * @param session_id The session to select (if any).
1.645 + * @param level The level to set the volume to.
1.646 + *
1.647 + * @since 2.6.0
1.648 + */
1.649 +void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level);
1.650 +
1.651 +/**
1.652 + * Sets the output volume of all the selected streams.
1.653 + *
1.654 + * @param media The media object the streams are in.
1.655 + * @param session_id The session to limit the streams to (if any).
1.656 + * @param participant The participant to limit the streams to (if any).
1.657 + * @param level The level to set the volume to.
1.658 + *
1.659 + * @since 2.6.0
1.660 + */
1.661 +void purple_media_set_output_volume(PurpleMedia *media, const gchar *session_id,
1.662 + const gchar *participant, double level);
1.663 +
1.664 +/**
1.665 + * Sets a video output window for the given session/stream.
1.666 + *
1.667 + * @param media The media instance to set the output window on.
1.668 + * @param session_id The session to set the output window on.
1.669 + * @param participant Optionally, the participant to set the output window on.
1.670 + * @param window_id The window id use for embedding the video in.
1.671 + *
1.672 + * @return An id to reference the output window.
1.673 + *
1.674 + * @since 2.6.0
1.675 + */
1.676 +gulong purple_media_set_output_window(PurpleMedia *media,
1.677 + const gchar *session_id, const gchar *participant,
1.678 + gulong window_id);
1.679 +
1.680 +/**
1.681 + * Removes all output windows from a given media session.
1.682 + *
1.683 + * @param media The instance to remove all output windows from.
1.684 + *
1.685 + * @since 2.6.0
1.686 + */
1.687 +void purple_media_remove_output_windows(PurpleMedia *media);
1.688 +
1.689 +#ifdef __cplusplus
1.690 +}
1.691 +#endif
1.692 +
1.693 +G_END_DECLS
1.694 +
1.695 +#endif /* _PURPLE_MEDIA_H_ */