Mercurial > pidgin
annotate libpurple/media/candidate.h @ 32769:d9d55a03ec7b
propagate from branch 'im.pidgin.pidgin.2.x.y' (head c67a060046437347c5cc4f58bdff008d7b8c4496)
to branch 'im.pidgin.pidgin' (head 40617c1e9cdf903724dbeee455fccc8d64ace22f)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Fri, 06 Apr 2012 04:30:06 +0000 |
parents | 02a2e8183b1d |
children |
rev | line source |
---|---|
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
1 /** |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
2 * @file candidate.h Candidate for Media API |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
3 * @ingroup core |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
4 */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
5 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
6 /* purple |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
7 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
8 * Purple is the legal property of its developers, whose names are too numerous |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
10 * source distribution. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
11 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
15 * (at your option) any later version. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
16 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
21 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
25 */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
26 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
27 #ifndef _PURPLE_MEDIA_CANDIDATE_H_ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
28 #define _PURPLE_MEDIA_CANDIDATE_H_ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
29 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
30 #include "enum-types.h" |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
31 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
32 #include <glib-object.h> |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
33 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
34 G_BEGIN_DECLS |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
35 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
36 #define PURPLE_TYPE_MEDIA_CANDIDATE (purple_media_candidate_get_type()) |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
37 #define PURPLE_IS_MEDIA_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_CANDIDATE)) |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
38 #define PURPLE_IS_MEDIA_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_CANDIDATE)) |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
39 #define PURPLE_MEDIA_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate)) |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
40 #define PURPLE_MEDIA_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate)) |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
41 #define PURPLE_MEDIA_CANDIDATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_CANDIDATE, PurpleMediaCandidate)) |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
42 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
43 /** An opaque structure representing a network candidate (IP Address and port pair). */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
44 typedef struct _PurpleMediaCandidate PurpleMediaCandidate; |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
45 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
46 /** |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
47 * Gets the type of the media candidate structure. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
48 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
49 * @return The media canditate's GType |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
50 */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
51 GType purple_media_candidate_get_type(void); |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
52 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
53 /** |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
54 * Creates a PurpleMediaCandidate instance. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
55 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
56 * @param foundation The foundation of the candidate. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
57 * @param component_id The component this candidate is for. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
58 * @param type The type of candidate. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
59 * @param proto The protocol this component is for. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
60 * @param ip The IP address of this component. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
61 * @param port The network port. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
62 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
63 * @return The newly created PurpleMediaCandidate instance. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
64 */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
65 PurpleMediaCandidate *purple_media_candidate_new( |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
66 const gchar *foundation, guint component_id, |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
67 PurpleMediaCandidateType type, |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
68 PurpleMediaNetworkProtocol proto, |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
69 const gchar *ip, guint port); |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
70 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
71 /** |
29164
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
72 * Copies a PurpleMediaCandidate. |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
73 * |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
74 * @param candidate The candidate to copy. |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
75 * |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
76 * @return The copy of the PurpleMediaCandidate. |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
77 */ |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
78 PurpleMediaCandidate *purple_media_candidate_copy( |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
79 PurpleMediaCandidate *candidate); |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
80 |
ec069900bf96
Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents:
29142
diff
changeset
|
81 /** |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
82 * Copies a GList of PurpleMediaCandidate and its contents. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
83 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
84 * @param candidates The list of candidates to be copied. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
85 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
86 * @return The copy of the GList. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
87 */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
88 GList *purple_media_candidate_list_copy(GList *candidates); |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
89 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
90 /** |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
91 * Frees a GList of PurpleMediaCandidate and its contents. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
92 * |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
93 * @param candidates The list of candidates to be freed. |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
94 */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
95 void purple_media_candidate_list_free(GList *candidates); |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
96 |
29242 | 97 /** |
98 * Gets the foundation (identifier) from the candidate. | |
99 * | |
100 * @param candidate The candidate to get the foundation from. | |
101 * | |
102 * @return The foundation. | |
103 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
104 gchar *purple_media_candidate_get_foundation(PurpleMediaCandidate *candidate); |
29242 | 105 |
106 /** | |
107 * Gets the component id (rtp or rtcp) | |
108 * | |
109 * @param candidate The candidate to get the compnent id from. | |
110 * | |
111 * @return The component id. | |
112 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
113 guint purple_media_candidate_get_component_id(PurpleMediaCandidate *candidate); |
29242 | 114 |
115 /** | |
116 * Gets the IP address. | |
117 * | |
118 * @param candidate The candidate to get the IP address from. | |
119 * | |
120 * @return The IP address. | |
121 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
122 gchar *purple_media_candidate_get_ip(PurpleMediaCandidate *candidate); |
29242 | 123 |
124 /** | |
125 * Gets the port. | |
126 * | |
127 * @param candidate The candidate to get the port from. | |
128 * | |
129 * @return The port. | |
130 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
131 guint16 purple_media_candidate_get_port(PurpleMediaCandidate *candidate); |
29242 | 132 |
133 /** | |
134 * Gets the base (internal) IP address. | |
135 * | |
136 * This can be NULL. | |
137 * | |
138 * @param candidate The candidate to get the base IP address from. | |
139 * | |
140 * @return The base IP address. | |
141 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
142 gchar *purple_media_candidate_get_base_ip(PurpleMediaCandidate *candidate); |
29242 | 143 |
144 /** | |
145 * Gets the base (internal) port. | |
146 * | |
147 * Invalid if the base IP is NULL. | |
148 * | |
149 * @param candidate The candidate to get the base port. | |
150 * | |
151 * @return The base port. | |
152 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
153 guint16 purple_media_candidate_get_base_port(PurpleMediaCandidate *candidate); |
29242 | 154 |
155 /** | |
156 * Gets the protocol (TCP or UDP). | |
157 * | |
158 * @param candidate The candidate to get the protocol from. | |
159 * | |
160 * @return The protocol. | |
161 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
162 PurpleMediaNetworkProtocol purple_media_candidate_get_protocol( |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
163 PurpleMediaCandidate *candidate); |
29242 | 164 |
165 /** | |
166 * Gets the priority. | |
167 * | |
168 * @param candidate The candidate to get the priority from. | |
169 * | |
170 * @return The priority. | |
171 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
172 guint32 purple_media_candidate_get_priority(PurpleMediaCandidate *candidate); |
29242 | 173 |
174 /** | |
175 * Gets the candidate type. | |
176 * | |
177 * @param candidate The candidate to get the candidate type from. | |
178 * | |
179 * @return The candidate type. | |
180 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
181 PurpleMediaCandidateType purple_media_candidate_get_candidate_type( |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
182 PurpleMediaCandidate *candidate); |
29242 | 183 |
184 /** | |
185 * Gets the username. | |
186 * | |
187 * This can be NULL. It depends on the transmission type. | |
188 * | |
189 * @param The candidate to get the username from. | |
190 * | |
191 * @return The username. | |
192 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
193 gchar *purple_media_candidate_get_username(PurpleMediaCandidate *candidate); |
29242 | 194 |
195 /** | |
196 * Gets the password. | |
197 * | |
198 * This can be NULL. It depends on the transmission type. | |
199 * | |
200 * @param The candidate to get the password from. | |
201 * | |
202 * @return The password. | |
203 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
204 gchar *purple_media_candidate_get_password(PurpleMediaCandidate *candidate); |
29242 | 205 |
206 /** | |
207 * Gets the TTL. | |
208 * | |
209 * @param The candidate to get the TTL from. | |
210 * | |
211 * @return The TTL. | |
212 */ | |
29142
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
213 guint purple_media_candidate_get_ttl(PurpleMediaCandidate *candidate); |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
214 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
215 G_END_DECLS |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
216 |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
217 #endif /* _PURPLE_MEDIA_CANDIDATE_H_ */ |
f585e10f156b
Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff
changeset
|
218 |