comparison libpurple/media.h @ 26103:f7cf50180e1d

Duplicate FsCandidate to remove it from the public interface.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 10 Jan 2009 03:58:54 +0000
parents b6457b2a8e14
children 8c9db11d82cd
comparison
equal deleted inserted replaced
26102:ade5b2c51047 26103:f7cf50180e1d
35 #include <glib-object.h> 35 #include <glib-object.h>
36 36
37 G_BEGIN_DECLS 37 G_BEGIN_DECLS
38 38
39 #define PURPLE_TYPE_MEDIA (purple_media_get_type()) 39 #define PURPLE_TYPE_MEDIA (purple_media_get_type())
40 #define PURPLE_TYPE_MEDIA_CANDIDATE (purple_media_candidate_get_type())
40 #define PURPLE_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia)) 41 #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_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(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_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 #define PURPLE_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
49 typedef struct _PurpleMedia PurpleMedia; 50 typedef struct _PurpleMedia PurpleMedia;
50 /** @copydoc _PurpleMediaClass */ 51 /** @copydoc _PurpleMediaClass */
51 typedef struct _PurpleMediaClass PurpleMediaClass; 52 typedef struct _PurpleMediaClass PurpleMediaClass;
52 /** @copydoc _PurpleMediaPrivate */ 53 /** @copydoc _PurpleMediaPrivate */
53 typedef struct _PurpleMediaPrivate PurpleMediaPrivate; 54 typedef struct _PurpleMediaPrivate PurpleMediaPrivate;
55 /** @copydoc _PurpleMediaCandidate */
56 typedef struct _PurpleMediaCandidate PurpleMediaCandidate;
54 57
55 #else 58 #else
56 59
57 typedef void PurpleMedia; 60 typedef void PurpleMedia;
58 61
74 PURPLE_MEDIA_STATE_CHANGED_NEW = 0, 77 PURPLE_MEDIA_STATE_CHANGED_NEW = 0,
75 PURPLE_MEDIA_STATE_CHANGED_CONNECTED, 78 PURPLE_MEDIA_STATE_CHANGED_CONNECTED,
76 PURPLE_MEDIA_STATE_CHANGED_END, 79 PURPLE_MEDIA_STATE_CHANGED_END,
77 } PurpleMediaStateChangedType; 80 } PurpleMediaStateChangedType;
78 81
82 typedef enum {
83 PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
84 PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
85 PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX,
86 PURPLE_MEDIA_CANDIDATE_TYPE_RELAY,
87 PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST,
88 } PurpleMediaCandidateType;
89
90 typedef enum {
91 PURPLE_MEDIA_COMPONENT_NONE = 0,
92 PURPLE_MEDIA_COMPONENT_RTP = 1,
93 PURPLE_MEDIA_COMPONENT_RTCP = 2,
94 } PurpleMediaComponentType;
95
96 typedef enum {
97 PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
98 PURPLE_MEDIA_NETWORK_PROTOCOL_TCP,
99 } PurpleMediaNetworkProtocol;
100
79 #ifdef USE_VV 101 #ifdef USE_VV
80 102
81 /** The media class */ 103 /** The media class */
82 struct _PurpleMediaClass 104 struct _PurpleMediaClass
83 { 105 {
89 { 111 {
90 GObject parent; /**< The parent of this object. */ 112 GObject parent; /**< The parent of this object. */
91 PurpleMediaPrivate *priv; /**< The private data of this object. */ 113 PurpleMediaPrivate *priv; /**< The private data of this object. */
92 }; 114 };
93 115
116 struct _PurpleMediaCandidate
117 {
118 const gchar *foundation;
119 guint component_id;
120 const gchar *ip;
121 guint16 port;
122 const gchar *base_ip;
123 guint16 base_port;
124 PurpleMediaNetworkProtocol proto;
125 guint32 priority;
126 PurpleMediaSessionType type;
127 const gchar *username;
128 const gchar *password;
129 guint ttl;
130 };
131
94 #ifdef __cplusplus 132 #ifdef __cplusplus
95 extern "C" { 133 extern "C" {
96 #endif 134 #endif
97 135
98 /** 136 /**
106 * Gets the type of the state-changed enum 144 * Gets the type of the state-changed enum
107 * 145 *
108 * @return The state-changed enum's GType 146 * @return The state-changed enum's GType
109 */ 147 */
110 GType purple_media_state_changed_get_type(void); 148 GType purple_media_state_changed_get_type(void);
149
150 /**
151 * Gets the type of the media candidate structure.
152 *
153 * @return The media canditate's GType
154 */
155 GType purple_media_candidate_get_type(void);
156
157 /**
158 * Creates a PurpleMediaCandidate instance.
159 *
160 * @param foundation The foundation of the candidate.
161 * @param component_id The component this candidate is for.
162 * @param type The type of candidate.
163 * @param proto The protocol this component is for.
164 * @param ip The IP address of this component.
165 * @param port The network port.
166 *
167 * @return The newly created PurpleMediaCandidate instance.
168 */
169 PurpleMediaCandidate *purple_media_candidate_new(
170 const gchar *foundation, guint component_id,
171 PurpleMediaCandidateType type,
172 PurpleMediaNetworkProtocol proto,
173 const gchar *ip, guint port);
174
175 /**
176 * Copies a GList of PurpleMediaCandidate and its contents.
177 *
178 * @param candidates The list of candidates to be copied.
179 *
180 * @return The copy of the GList.
181 */
182 GList *purple_media_candidate_list_copy(GList *candidates);
183
184 /**
185 * Frees a GList of PurpleMediaCandidate and its contents.
186 *
187 * @param candidates The list of candidates to be freed.
188 */
189 void purple_media_candidate_list_free(GList *candidates);
111 190
112 /** 191 /**
113 * Combines all the separate session types into a single PurpleMediaSessionType. 192 * Combines all the separate session types into a single PurpleMediaSessionType.
114 * 193 *
115 * @param media The media session to retrieve session types from. 194 * @param media The media session to retrieve session types from.
386 * @param sess_id The session id of the session to find the stream in. 465 * @param sess_id The session id of the session to find the stream in.
387 * @param name The name of the remote user to get the active candidate from. 466 * @param name The name of the remote user to get the active candidate from.
388 * 467 *
389 * @return The active candidate retrieved. 468 * @return The active candidate retrieved.
390 */ 469 */
391 FsCandidate *purple_media_get_local_candidate(PurpleMedia *media, const gchar *sess_id, const gchar *name); 470 PurpleMediaCandidate *purple_media_get_local_candidate(PurpleMedia *media,
471 const gchar *sess_id, const gchar *name);
392 472
393 /** 473 /**
394 * Gets the active remote candidate for the stream. 474 * Gets the active remote candidate for the stream.
395 * 475 *
396 * @param media The media object to find the session in. 476 * @param media The media object to find the session in.
397 * @param sess_id The session id of the session to find the stream in. 477 * @param sess_id The session id of the session to find the stream in.
398 * @param name The name of the remote user to get the remote candidate from. 478 * @param name The name of the remote user to get the remote candidate from.
399 * 479 *
400 * @return The remote candidate retrieved. 480 * @return The remote candidate retrieved.
401 */ 481 */
402 FsCandidate *purple_media_get_remote_candidate(PurpleMedia *media, const gchar *sess_id, const gchar *name); 482 PurpleMediaCandidate *purple_media_get_remote_candidate(PurpleMedia *media,
483 const gchar *sess_id, const gchar *name);
403 484
404 /** 485 /**
405 * Gets remote candidates from the stream. 486 * Gets remote candidates from the stream.
406 * 487 *
407 * @param media The media object to find the session in. 488 * @param media The media object to find the session in.