annotate libpurple/media/candidate.c @ 31218:b98d1ca8422d

This bits belong to SlpMessage, lets handle here, also I think it's easier to manage this bits being a pointer.
author masca@cpw.pidgin.im
date Tue, 08 Jun 2010 01:40:39 +0000
parents ec069900bf96
children a8cc50c2279f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29536
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.c 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 #include "candidate.h"
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
28
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
29 /** @copydoc _PurpleMediaCandidateClass */
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
30 typedef struct _PurpleMediaCandidateClass PurpleMediaCandidateClass;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
31 /** @copydoc _PurpleMediaCandidatePrivate */
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
32 typedef struct _PurpleMediaCandidatePrivate PurpleMediaCandidatePrivate;
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 #define PURPLE_MEDIA_CANDIDATE_GET_PRIVATE(obj) \
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
35 (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
36 PURPLE_TYPE_MEDIA_CANDIDATE, \
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
37 PurpleMediaCandidatePrivate))
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
38
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
39
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
40 struct _PurpleMediaCandidateClass
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
41 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
42 GObjectClass parent_class;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
43 };
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
44
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
45 struct _PurpleMediaCandidate
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 GObject parent;
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
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
50 G_DEFINE_TYPE(PurpleMediaCandidate, purple_media_candidate, G_TYPE_OBJECT);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
51
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
52 struct _PurpleMediaCandidatePrivate
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 gchar *foundation;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
55 guint component_id;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
56 gchar *ip;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
57 guint16 port;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
58 gchar *base_ip;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
59 guint16 base_port;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
60 PurpleMediaNetworkProtocol proto;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
61 guint32 priority;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
62 PurpleMediaCandidateType type;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
63 gchar *username;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
64 gchar *password;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
65 guint ttl;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
66 };
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
67
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
68 enum {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
69 PROP_CANDIDATE_0,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
70 PROP_FOUNDATION,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
71 PROP_COMPONENT_ID,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
72 PROP_IP,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
73 PROP_PORT,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
74 PROP_BASE_IP,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
75 PROP_BASE_PORT,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
76 PROP_PROTOCOL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
77 PROP_PRIORITY,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
78 PROP_TYPE,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
79 PROP_USERNAME,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
80 PROP_PASSWORD,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
81 PROP_TTL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
82 };
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 static void
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
85 purple_media_candidate_init(PurpleMediaCandidate *info)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
86 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
87 PurpleMediaCandidatePrivate *priv =
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
88 PURPLE_MEDIA_CANDIDATE_GET_PRIVATE(info);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
89 priv->foundation = NULL;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
90 priv->component_id = 0;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
91 priv->ip = NULL;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
92 priv->port = 0;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
93 priv->base_ip = NULL;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
94 priv->proto = PURPLE_MEDIA_NETWORK_PROTOCOL_UDP;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
95 priv->priority = 0;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
96 priv->type = PURPLE_MEDIA_CANDIDATE_TYPE_HOST;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
97 priv->username = NULL;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
98 priv->password = NULL;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
99 priv->ttl = 0;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
100 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
101
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
102 static void
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
103 purple_media_candidate_finalize(GObject *info)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
104 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
105 PurpleMediaCandidatePrivate *priv =
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
106 PURPLE_MEDIA_CANDIDATE_GET_PRIVATE(info);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
107
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
108 g_free(priv->foundation);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
109 g_free(priv->ip);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
110 g_free(priv->base_ip);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
111 g_free(priv->username);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
112 g_free(priv->password);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
113 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
114
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
115 static void
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
116 purple_media_candidate_set_property (GObject *object, guint prop_id,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
117 const GValue *value, GParamSpec *pspec)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
118 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
119 PurpleMediaCandidatePrivate *priv;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
120 g_return_if_fail(PURPLE_IS_MEDIA_CANDIDATE(object));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
121
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
122 priv = PURPLE_MEDIA_CANDIDATE_GET_PRIVATE(object);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
123
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
124 switch (prop_id) {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
125 case PROP_FOUNDATION:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
126 g_free(priv->foundation);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
127 priv->foundation = g_value_dup_string(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
128 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
129 case PROP_COMPONENT_ID:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
130 priv->component_id = g_value_get_uint(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
131 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
132 case PROP_IP:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
133 g_free(priv->ip);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
134 priv->ip = g_value_dup_string(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
135 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
136 case PROP_PORT:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
137 priv->port = g_value_get_uint(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
138 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
139 case PROP_BASE_IP:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
140 g_free(priv->base_ip);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
141 priv->base_ip = g_value_dup_string(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
142 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
143 case PROP_BASE_PORT:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
144 priv->base_port = g_value_get_uint(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
145 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
146 case PROP_PROTOCOL:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
147 priv->proto = g_value_get_enum(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
148 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
149 case PROP_PRIORITY:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
150 priv->priority = g_value_get_uint(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
151 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
152 case PROP_TYPE:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
153 priv->type = g_value_get_enum(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
154 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
155 case PROP_USERNAME:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
156 g_free(priv->username);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
157 priv->username = g_value_dup_string(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
158 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
159 case PROP_PASSWORD:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
160 g_free(priv->password);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
161 priv->password = g_value_dup_string(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
162 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
163 case PROP_TTL:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
164 priv->ttl = g_value_get_uint(value);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
165 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
166 default:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
167 G_OBJECT_WARN_INVALID_PROPERTY_ID(
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
168 object, prop_id, pspec);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
169 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
170 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
171 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
172
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
173 static void
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
174 purple_media_candidate_get_property (GObject *object, guint prop_id,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
175 GValue *value, GParamSpec *pspec)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
176 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
177 PurpleMediaCandidatePrivate *priv;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
178 g_return_if_fail(PURPLE_IS_MEDIA_CANDIDATE(object));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
179
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
180 priv = PURPLE_MEDIA_CANDIDATE_GET_PRIVATE(object);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
181
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
182 switch (prop_id) {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
183 case PROP_FOUNDATION:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
184 g_value_set_string(value, priv->foundation);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
185 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
186 case PROP_COMPONENT_ID:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
187 g_value_set_uint(value, priv->component_id);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
188 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
189 case PROP_IP:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
190 g_value_set_string(value, priv->ip);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
191 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
192 case PROP_PORT:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
193 g_value_set_uint(value, priv->port);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
194 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
195 case PROP_BASE_IP:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
196 g_value_set_string(value, priv->base_ip);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
197 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
198 case PROP_BASE_PORT:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
199 g_value_set_uint(value, priv->base_port);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
200 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
201 case PROP_PROTOCOL:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
202 g_value_set_enum(value, priv->proto);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
203 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
204 case PROP_PRIORITY:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
205 g_value_set_uint(value, priv->priority);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
206 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
207 case PROP_TYPE:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
208 g_value_set_enum(value, priv->type);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
209 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
210 case PROP_USERNAME:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
211 g_value_set_string(value, priv->username);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
212 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
213 case PROP_PASSWORD:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
214 g_value_set_string(value, priv->password);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
215 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
216 case PROP_TTL:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
217 g_value_set_uint(value, priv->ttl);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
218 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
219 default:
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
220 G_OBJECT_WARN_INVALID_PROPERTY_ID(
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
221 object, prop_id, pspec);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
222 break;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
223 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
224 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
225
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
226 static void
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
227 purple_media_candidate_class_init(PurpleMediaCandidateClass *klass)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
228 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
229 GObjectClass *gobject_class = (GObjectClass*)klass;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
230
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
231 gobject_class->finalize = purple_media_candidate_finalize;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
232 gobject_class->set_property = purple_media_candidate_set_property;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
233 gobject_class->get_property = purple_media_candidate_get_property;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
234
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
235 g_object_class_install_property(gobject_class, PROP_FOUNDATION,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
236 g_param_spec_string("foundation",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
237 "Foundation",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
238 "The foundation of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
239 NULL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
240 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
241
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
242 g_object_class_install_property(gobject_class, PROP_COMPONENT_ID,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
243 g_param_spec_uint("component-id",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
244 "Component ID",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
245 "The component id of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
246 0, G_MAXUINT, 0,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
247 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
248
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
249 g_object_class_install_property(gobject_class, PROP_IP,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
250 g_param_spec_string("ip",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
251 "IP Address",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
252 "The IP address of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
253 NULL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
254 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
255
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
256 g_object_class_install_property(gobject_class, PROP_PORT,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
257 g_param_spec_uint("port",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
258 "Port",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
259 "The port of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
260 0, G_MAXUINT16, 0,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
261 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
262
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
263 g_object_class_install_property(gobject_class, PROP_BASE_IP,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
264 g_param_spec_string("base-ip",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
265 "Base IP",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
266 "The internal IP address of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
267 NULL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
268 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
269
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
270 g_object_class_install_property(gobject_class, PROP_BASE_PORT,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
271 g_param_spec_uint("base-port",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
272 "Base Port",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
273 "The internal port of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
274 0, G_MAXUINT16, 0,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
275 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
276
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
277 g_object_class_install_property(gobject_class, PROP_PROTOCOL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
278 g_param_spec_enum("protocol",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
279 "Protocol",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
280 "The protocol of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
281 PURPLE_TYPE_MEDIA_NETWORK_PROTOCOL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
282 PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
283 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
284
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
285 g_object_class_install_property(gobject_class, PROP_PRIORITY,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
286 g_param_spec_uint("priority",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
287 "Priority",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
288 "The priority of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
289 0, G_MAXUINT32, 0,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
290 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
291
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
292 g_object_class_install_property(gobject_class, PROP_TYPE,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
293 g_param_spec_enum("type",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
294 "Type",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
295 "The type of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
296 PURPLE_TYPE_MEDIA_CANDIDATE_TYPE,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
297 PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
298 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
299
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
300 g_object_class_install_property(gobject_class, PROP_USERNAME,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
301 g_param_spec_string("username",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
302 "Username",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
303 "The username used to connect to the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
304 NULL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
305 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
306
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
307 g_object_class_install_property(gobject_class, PROP_PASSWORD,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
308 g_param_spec_string("password",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
309 "Password",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
310 "The password use to connect to the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
311 NULL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
312 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
313
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
314 g_object_class_install_property(gobject_class, PROP_TTL,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
315 g_param_spec_uint("ttl",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
316 "TTL",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
317 "The TTL of the candidate.",
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
318 0, G_MAXUINT, 0,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
319 G_PARAM_READWRITE));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
320
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
321 g_type_class_add_private(klass, sizeof(PurpleMediaCandidatePrivate));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
322 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
323
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
324 PurpleMediaCandidate *
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
325 purple_media_candidate_new(const gchar *foundation, guint component_id,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
326 PurpleMediaCandidateType type,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
327 PurpleMediaNetworkProtocol proto,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
328 const gchar *ip, guint port)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
329 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
330 return g_object_new(PURPLE_TYPE_MEDIA_CANDIDATE,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
331 "foundation", foundation,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
332 "component-id", component_id,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
333 "type", type,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
334 "protocol", proto,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
335 "ip", ip,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
336 "port", port, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
337 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
338
29558
ec069900bf96 Add purple_media_candidate_copy to the public API.
maiku@pidgin.im
parents: 29536
diff changeset
339 PurpleMediaCandidate *
29536
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
340 purple_media_candidate_copy(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
341 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
342 PurpleMediaCandidatePrivate *priv;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
343 PurpleMediaCandidate *new_candidate;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
344
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
345 if (candidate == NULL)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
346 return NULL;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
347
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
348 priv = PURPLE_MEDIA_CANDIDATE_GET_PRIVATE(candidate);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
349
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
350 new_candidate = purple_media_candidate_new(priv->foundation,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
351 priv->component_id, priv->type, priv->proto,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
352 priv->ip, priv->port);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
353 g_object_set(new_candidate,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
354 "base-ip", priv->base_ip,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
355 "base-port", priv->base_port,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
356 "priority", priv->priority,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
357 "username", priv->username,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
358 "password", priv->password,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
359 "ttl", priv->ttl, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
360 return new_candidate;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
361 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
362
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
363 GList *
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
364 purple_media_candidate_list_copy(GList *candidates)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
365 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
366 GList *new_list = NULL;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
367
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
368 for (; candidates; candidates = g_list_next(candidates)) {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
369 new_list = g_list_prepend(new_list,
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
370 purple_media_candidate_copy(candidates->data));
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
371 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
372
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
373 new_list = g_list_reverse(new_list);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
374 return new_list;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
375 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
376
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
377 void
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
378 purple_media_candidate_list_free(GList *candidates)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
379 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
380 for (; candidates; candidates =
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
381 g_list_delete_link(candidates, candidates)) {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
382 g_object_unref(candidates->data);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
383 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
384 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
385
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
386 gchar *
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
387 purple_media_candidate_get_foundation(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
388 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
389 gchar *foundation;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
390 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
391 g_object_get(candidate, "foundation", &foundation, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
392 return foundation;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
393 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
394
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
395 guint
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
396 purple_media_candidate_get_component_id(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
397 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
398 guint component_id;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
399 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), 0);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
400 g_object_get(candidate, "component-id", &component_id, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
401 return component_id;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
402 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
403
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
404 gchar *
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
405 purple_media_candidate_get_ip(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
406 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
407 gchar *ip;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
408 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
409 g_object_get(candidate, "ip", &ip, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
410 return ip;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
411 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
412
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
413 guint16
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
414 purple_media_candidate_get_port(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
415 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
416 guint port;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
417 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), 0);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
418 g_object_get(candidate, "port", &port, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
419 return port;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
420 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
421
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
422 gchar *
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
423 purple_media_candidate_get_base_ip(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
424 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
425 gchar *base_ip;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
426 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
427 g_object_get(candidate, "base-ip", &base_ip, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
428 return base_ip;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
429 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
430
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
431 guint16
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
432 purple_media_candidate_get_base_port(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
433 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
434 guint base_port;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
435 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), 0);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
436 g_object_get(candidate, "base_port", &base_port, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
437 return base_port;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
438 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
439
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
440 PurpleMediaNetworkProtocol
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
441 purple_media_candidate_get_protocol(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
442 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
443 PurpleMediaNetworkProtocol protocol;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
444 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate),
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
445 PURPLE_MEDIA_NETWORK_PROTOCOL_UDP);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
446 g_object_get(candidate, "protocol", &protocol, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
447 return protocol;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
448 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
449
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
450 guint32
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
451 purple_media_candidate_get_priority(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
452 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
453 guint priority;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
454 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), 0);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
455 g_object_get(candidate, "priority", &priority, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
456 return priority;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
457 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
458
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
459 PurpleMediaCandidateType
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
460 purple_media_candidate_get_candidate_type(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
461 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
462 PurpleMediaCandidateType type;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
463 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate),
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
464 PURPLE_MEDIA_CANDIDATE_TYPE_HOST);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
465 g_object_get(candidate, "type", &type, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
466 return type;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
467 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
468
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
469 gchar *
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
470 purple_media_candidate_get_username(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
471 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
472 gchar *username;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
473 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
474 g_object_get(candidate, "username", &username, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
475 return username;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
476 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
477
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
478 gchar *
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
479 purple_media_candidate_get_password(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
480 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
481 gchar *password;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
482 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
483 g_object_get(candidate, "password", &password, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
484 return password;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
485 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
486
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
487 guint
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
488 purple_media_candidate_get_ttl(PurpleMediaCandidate *candidate)
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
489 {
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
490 guint ttl;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
491 g_return_val_if_fail(PURPLE_IS_MEDIA_CANDIDATE(candidate), 0);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
492 g_object_get(candidate, "ttl", &ttl, NULL);
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
493 return ttl;
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
494 }
f585e10f156b Split out PurpleMediaCandidate into its own file.
maiku@pidgin.im
parents:
diff changeset
495