[Nice] [nice/master] main-context changed into a construct time property
Youness Alaoui
youness.alaoui at collabora.co.uk
Wed Nov 5 14:01:03 PST 2008
darcs-hash:20080422205938-4f0f6-f2829d40b33ed72022836cc0466e8d15fa362638.gz
---
agent/agent.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/agent/agent.c b/agent/agent.c
index 86a7407..a3445ad 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -75,6 +75,7 @@ enum
{
PROP_SOCKET_FACTORY = 1,
PROP_COMPATIBILITY,
+ PROP_MAIN_CONTEXT,
PROP_STUN_SERVER,
PROP_STUN_SERVER_PORT,
PROP_TURN_SERVER,
@@ -191,6 +192,14 @@ nice_agent_class_init (NiceAgentClass *klass)
"The socket factory used to create new UDP sockets",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (gobject_class, PROP_MAIN_CONTEXT,
+ g_param_spec_pointer (
+ "main-context",
+ "The GMainContext to use for timeouts",
+ "The GMainContext to use for timeouts",
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
g_object_class_install_property (gobject_class, PROP_COMPATIBILITY,
g_param_spec_uint (
"compatibility",
@@ -410,10 +419,9 @@ nice_agent_new (NiceUDPSocketFactory *factory,
NiceAgent *agent = g_object_new (NICE_TYPE_AGENT,
"socket-factory", factory,
"compatibility", compat,
+ "main-context", ctx,
NULL);
- agent->main_context = ctx;
-
return agent;
}
@@ -435,6 +443,10 @@ nice_agent_get_property (
g_value_set_pointer (value, agent->socket_factory);
break;
+ case PROP_MAIN_CONTEXT:
+ g_value_set_pointer (value, agent->main_context);
+ break;
+
case PROP_COMPATIBILITY:
g_value_set_uint (value, agent->compatibility);
break;
@@ -497,6 +509,10 @@ nice_agent_set_property (
agent->socket_factory = g_value_get_pointer (value);
break;
+ case PROP_MAIN_CONTEXT:
+ agent->main_context = g_value_get_pointer (value);
+ break;
+
case PROP_COMPATIBILITY:
agent->compatibility = g_value_get_uint (value);
break;
--
1.5.6.5
More information about the Nice
mailing list