Mercurial > pidgin.yaz
diff libpurple/media.h @ 29712:d5fe33c3a765
propagate from branch 'im.pidgin.pidgin' (head 42a8485e73af5f2091d307b51c09dded94eceb24)
to branch 'im.pidgin.pidgin.next.minor' (head 4edcf8da14be654127117da5af0cbdd7a0616439)
author | John Bailey <rekkanoryo@rekkanoryo.org> |
---|---|
date | Tue, 17 Nov 2009 07:33:47 +0000 |
parents | e18c1d347e37 |
children | dcd52d2b1b97 |
line wrap: on
line diff
--- a/libpurple/media.h Tue Nov 17 07:33:34 2009 +0000 +++ b/libpurple/media.h Tue Nov 17 07:33:47 2009 +0000 @@ -27,26 +27,15 @@ #ifndef _PURPLE_MEDIA_H_ #define _PURPLE_MEDIA_H_ +#include "media/candidate.h" +#include "media/codec.h" +#include "media/enum-types.h" + #include <glib.h> #include <glib-object.h> G_BEGIN_DECLS -#define PURPLE_TYPE_MEDIA_CANDIDATE (purple_media_candidate_get_type()) -#define PURPLE_MEDIA_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate)) -#define PURPLE_MEDIA_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate)) -#define PURPLE_IS_MEDIA_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_CANDIDATE)) -#define PURPLE_IS_MEDIA_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_CANDIDATE)) -#define PURPLE_MEDIA_CANDIDATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate)) - -#define PURPLE_TYPE_MEDIA_CODEC (purple_media_codec_get_type()) -#define PURPLE_MEDIA_CODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec)) -#define PURPLE_MEDIA_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec)) -#define PURPLE_IS_MEDIA_CODEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_CODEC)) -#define PURPLE_IS_MEDIA_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_CODEC)) -#define PURPLE_MEDIA_CODEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec)) - -#define PURPLE_TYPE_MEDIA_SESSION_TYPE (purple_media_session_type_get_type()) #define PURPLE_TYPE_MEDIA (purple_media_get_type()) #define PURPLE_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia)) #define PURPLE_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass)) @@ -54,79 +43,8 @@ #define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA)) #define PURPLE_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass)) -#define PURPLE_TYPE_MEDIA_CANDIDATE_TYPE (purple_media_candidate_type_get_type()) -#define PURPLE_TYPE_MEDIA_NETWORK_PROTOCOL (purple_media_network_protocol_get_type()) -#define PURPLE_MEDIA_TYPE_STATE (purple_media_state_changed_get_type()) -#define PURPLE_MEDIA_TYPE_INFO_TYPE (purple_media_info_type_get_type()) - /** An opaque structure representing a media call. */ typedef struct _PurpleMedia PurpleMedia; -/** An opaque structure representing a network candidate (IP Address and port pair). */ -typedef struct _PurpleMediaCandidate PurpleMediaCandidate; -/** An opaque structure representing an audio or video codec. */ -typedef struct _PurpleMediaCodec PurpleMediaCodec; - -/** Media caps */ -typedef enum { - PURPLE_MEDIA_CAPS_NONE = 0, - PURPLE_MEDIA_CAPS_AUDIO = 1, - PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION = 1 << 1, - PURPLE_MEDIA_CAPS_VIDEO = 1 << 2, - PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION = 1 << 3, - PURPLE_MEDIA_CAPS_AUDIO_VIDEO = 1 << 4, - PURPLE_MEDIA_CAPS_MODIFY_SESSION = 1 << 5, - PURPLE_MEDIA_CAPS_CHANGE_DIRECTION = 1 << 6, -} PurpleMediaCaps; - -/** Media session types */ -typedef enum { - PURPLE_MEDIA_NONE = 0, - PURPLE_MEDIA_RECV_AUDIO = 1 << 0, - PURPLE_MEDIA_SEND_AUDIO = 1 << 1, - PURPLE_MEDIA_RECV_VIDEO = 1 << 2, - PURPLE_MEDIA_SEND_VIDEO = 1 << 3, - PURPLE_MEDIA_AUDIO = PURPLE_MEDIA_RECV_AUDIO | PURPLE_MEDIA_SEND_AUDIO, - PURPLE_MEDIA_VIDEO = PURPLE_MEDIA_RECV_VIDEO | PURPLE_MEDIA_SEND_VIDEO -} PurpleMediaSessionType; - -/** Media state-changed types */ -typedef enum { - PURPLE_MEDIA_STATE_NEW = 0, - PURPLE_MEDIA_STATE_CONNECTED, - PURPLE_MEDIA_STATE_END, -} PurpleMediaState; - -/** Media info types */ -typedef enum { - PURPLE_MEDIA_INFO_HANGUP = 0, - PURPLE_MEDIA_INFO_ACCEPT, - PURPLE_MEDIA_INFO_REJECT, - PURPLE_MEDIA_INFO_MUTE, - PURPLE_MEDIA_INFO_UNMUTE, - PURPLE_MEDIA_INFO_PAUSE, - PURPLE_MEDIA_INFO_UNPAUSE, - PURPLE_MEDIA_INFO_HOLD, - PURPLE_MEDIA_INFO_UNHOLD, -} PurpleMediaInfoType; - -typedef enum { - PURPLE_MEDIA_CANDIDATE_TYPE_HOST, - PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX, - PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX, - PURPLE_MEDIA_CANDIDATE_TYPE_RELAY, - PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST, -} PurpleMediaCandidateType; - -typedef enum { - PURPLE_MEDIA_COMPONENT_NONE = 0, - PURPLE_MEDIA_COMPONENT_RTP = 1, - PURPLE_MEDIA_COMPONENT_RTCP = 2, -} PurpleMediaComponentType; - -typedef enum { - PURPLE_MEDIA_NETWORK_PROTOCOL_UDP, - PURPLE_MEDIA_NETWORK_PROTOCOL_TCP, -} PurpleMediaNetworkProtocol; #include "signals.h" #include "util.h" @@ -136,33 +54,6 @@ #endif /** - * Gets the media session type's GType - * - * @return The media session type's GType. - * - * @since 2.6.0 - */ -GType purple_media_session_type_get_type(void); - -/** - * Gets the media candidate type's GType - * - * @return The media candidate type's GType. - * - * @since 2.6.0 - */ -GType purple_media_candidate_type_get_type(void); - -/** - * Gets the media network protocol's GType - * - * @return The media network protocol's GType. - * - * @since 2.6.0 - */ -GType purple_media_network_protocol_get_type(void); - -/** * Gets the media class's GType * * @return The media class's GType. @@ -172,187 +63,6 @@ GType purple_media_get_type(void); /** - * Gets the type of the state-changed enum - * - * @return The state-changed enum's GType - * - * @since 2.6.0 - */ -GType purple_media_state_changed_get_type(void); - -/** - * Gets the type of the info type enum - * - * @return The info type enum's GType - * - * @since 2.6.0 - */ -GType purple_media_info_type_get_type(void); - -/** - * Gets the type of the media candidate structure. - * - * @return The media canditate's GType - * - * @since 2.6.0 - */ -GType purple_media_candidate_get_type(void); - -/** - * Creates a PurpleMediaCandidate instance. - * - * @param foundation The foundation of the candidate. - * @param component_id The component this candidate is for. - * @param type The type of candidate. - * @param proto The protocol this component is for. - * @param ip The IP address of this component. - * @param port The network port. - * - * @return The newly created PurpleMediaCandidate instance. - * - * @since 2.6.0 - */ -PurpleMediaCandidate *purple_media_candidate_new( - const gchar *foundation, guint component_id, - PurpleMediaCandidateType type, - PurpleMediaNetworkProtocol proto, - const gchar *ip, guint port); - -/** - * Copies a GList of PurpleMediaCandidate and its contents. - * - * @param candidates The list of candidates to be copied. - * - * @return The copy of the GList. - * - * @since 2.6.0 - */ -GList *purple_media_candidate_list_copy(GList *candidates); - -/** - * Frees a GList of PurpleMediaCandidate and its contents. - * - * @param candidates The list of candidates to be freed. - * - * @since 2.6.0 - */ -void purple_media_candidate_list_free(GList *candidates); - -gchar *purple_media_candidate_get_foundation(PurpleMediaCandidate *candidate); -guint purple_media_candidate_get_component_id(PurpleMediaCandidate *candidate); -gchar *purple_media_candidate_get_ip(PurpleMediaCandidate *candidate); -guint16 purple_media_candidate_get_port(PurpleMediaCandidate *candidate); -gchar *purple_media_candidate_get_base_ip(PurpleMediaCandidate *candidate); -guint16 purple_media_candidate_get_base_port(PurpleMediaCandidate *candidate); -PurpleMediaNetworkProtocol purple_media_candidate_get_protocol( - PurpleMediaCandidate *candidate); -guint32 purple_media_candidate_get_priority(PurpleMediaCandidate *candidate); -PurpleMediaCandidateType purple_media_candidate_get_candidate_type( - PurpleMediaCandidate *candidate); -gchar *purple_media_candidate_get_username(PurpleMediaCandidate *candidate); -gchar *purple_media_candidate_get_password(PurpleMediaCandidate *candidate); -guint purple_media_candidate_get_ttl(PurpleMediaCandidate *candidate); - -/** - * Gets the type of the media codec structure. - * - * @return The media codec's GType - * - * @since 2.6.0 - */ -GType purple_media_codec_get_type(void); - -/** - * Creates a new PurpleMediaCodec instance. - * - * @param id Codec identifier. - * @param encoding_name Name of the media type this encodes. - * @param media_type PurpleMediaSessionType of this codec. - * @param clock_rate The clock rate this codec encodes at, if applicable. - * - * @return The newly created PurpleMediaCodec. - * - * @since 2.6.0 - */ -PurpleMediaCodec *purple_media_codec_new(int id, const char *encoding_name, - PurpleMediaSessionType media_type, guint clock_rate); - -guint purple_media_codec_get_id(PurpleMediaCodec *codec); -gchar *purple_media_codec_get_encoding_name(PurpleMediaCodec *codec); -guint purple_media_codec_get_clock_rate(PurpleMediaCodec *codec); -guint purple_media_codec_get_channels(PurpleMediaCodec *codec); -GList *purple_media_codec_get_optional_parameters(PurpleMediaCodec *codec); - -/** - * Creates a string representation of the codec. - * - * @param codec The codec to create the string of. - * - * @return The new string representation. - * - * @since 2.6.0 - */ -gchar *purple_media_codec_to_string(const PurpleMediaCodec *codec); - -/** - * Adds an optional parameter to the codec. - * - * @param codec The codec to add the parameter to. - * @param name The name of the parameter to add. - * @param value The value of the parameter to add. - * - * @since 2.6.0 - */ -void purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec, - const gchar *name, const gchar *value); - -/** - * Removes an optional parameter from the codec. - * - * @param codec The codec to remove the parameter from. - * @param param A pointer to the parameter to remove. - * - * @since 2.6.0 - */ -void purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec, - PurpleKeyValuePair *param); - -/** - * Gets an optional parameter based on the values given. - * - * @param codec The codec to find the parameter in. - * @param name The name of the parameter to search for. - * @param value The value to search for or NULL. - * - * @return The value found or NULL. - * - * @since 2.6.0 - */ -PurpleKeyValuePair *purple_media_codec_get_optional_parameter( - PurpleMediaCodec *codec, const gchar *name, - const gchar *value); - -/** - * Copies a GList of PurpleMediaCodec and its contents. - * - * @param codecs The list of codecs to be copied. - * - * @return The copy of the GList. - * - * @since 2.6.0 - */ -GList *purple_media_codec_list_copy(GList *codecs); - -/** - * Frees a GList of PurpleMediaCodec and its contents. - * - * @param codecs The list of codecs to be freed. - * - * @since 2.6.0 - */ -void purple_media_codec_list_free(GList *codecs); - -/** * Gets a list of session IDs. * * @param media The media session from which to retrieve session IDs.