Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
fb6df6a0
Commit
fb6df6a0
authored
Jan 17, 2012
by
Rohan Garg
Committed by
Youness Alaoui
Jan 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix builds for systems using glib 2.3.81 and above
parent
acbd8f09
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
12 deletions
+58
-12
agent/agent.c
agent/agent.c
+19
-4
tests/test-add-remove-stream.c
tests/test-add-remove-stream.c
+2
-1
tests/test-dribble.c
tests/test-dribble.c
+3
-0
tests/test-fallback.c
tests/test-fallback.c
+3
-0
tests/test-fullmode.c
tests/test-fullmode.c
+4
-1
tests/test-mainloop.c
tests/test-mainloop.c
+4
-1
tests/test-restart.c
tests/test-restart.c
+4
-1
tests/test-thread.c
tests/test-thread.c
+16
-3
tests/test.c
tests/test.c
+3
-1
No files found.
agent/agent.c
View file @
fb6df6a0
...
@@ -121,7 +121,11 @@ enum
...
@@ -121,7 +121,11 @@ enum
static
guint
signals
[
N_SIGNALS
];
static
guint
signals
[
N_SIGNALS
];
static
GStaticRecMutex
agent_mutex
=
G_STATIC_REC_MUTEX_INIT
;
/* Mutex used for thread-safe lib */
#if GLIB_CHECK_VERSION(2,31,8)
static
GRecMutex
agent_mutex
;
/* Mutex used for thread-safe lib */
#else
static
GStaticRecMutex
agent_mutex
=
G_STATIC_REC_MUTEX_INIT
;
#endif
static
gboolean
priv_attach_stream_component
(
NiceAgent
*
agent
,
static
gboolean
priv_attach_stream_component
(
NiceAgent
*
agent
,
Stream
*
stream
,
Stream
*
stream
,
...
@@ -130,18 +134,29 @@ static void priv_detach_stream_component (Stream *stream, Component *component);
...
@@ -130,18 +134,29 @@ static void priv_detach_stream_component (Stream *stream, Component *component);
static
void
priv_free_upnp
(
NiceAgent
*
agent
);
static
void
priv_free_upnp
(
NiceAgent
*
agent
);
#if GLIB_CHECK_VERSION(2,31,8)
void
agent_lock
(
void
)
void
agent_lock
(
void
)
{
{
g_
static_
rec_mutex_lock
(
&
agent_mutex
);
g_rec_mutex_lock
(
&
agent_mutex
);
}
}
void
agent_unlock
(
void
)
void
agent_unlock
(
void
)
{
{
g_static_rec_mutex_unlock
(
&
agent_mutex
);
g_rec_mutex_unlock
(
&
agent_mutex
);
}
#else
void
agent_lock
(
void
)
{
g_static_rec_mutex_lock
(
&
agent_mutex
);
}
}
void
agent_unlock
(
void
)
{
g_static_rec_mutex_unlock
(
&
agent_mutex
);
}
#endif
StunUsageIceCompatibility
StunUsageIceCompatibility
agent_to_ice_compatibility
(
NiceAgent
*
agent
)
agent_to_ice_compatibility
(
NiceAgent
*
agent
)
...
...
tests/test-add-remove-stream.c
View file @
fb6df6a0
...
@@ -51,8 +51,9 @@ main (void)
...
@@ -51,8 +51,9 @@ main (void)
nice_address_init
(
&
addr
);
nice_address_init
(
&
addr
);
g_type_init
();
g_type_init
();
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
);
g_thread_init
(
NULL
);
#endif
if
(
!
nice_address_set_from_string
(
&
addr
,
"127.0.0.1"
))
if
(
!
nice_address_set_from_string
(
&
addr
,
"127.0.0.1"
))
g_assert_not_reached
();
g_assert_not_reached
();
...
...
tests/test-dribble.c
View file @
fb6df6a0
...
@@ -208,7 +208,10 @@ int main (void)
...
@@ -208,7 +208,10 @@ int main (void)
guint
ls_id
,
rs_id
;
guint
ls_id
,
rs_id
;
g_type_init
();
g_type_init
();
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
);
g_thread_init
(
NULL
);
#endif
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
/* step: create the agents L and R */
/* step: create the agents L and R */
...
...
tests/test-fallback.c
View file @
fb6df6a0
...
@@ -484,7 +484,10 @@ int main (void)
...
@@ -484,7 +484,10 @@ int main (void)
const
char
*
stun_server
=
NULL
,
*
stun_server_port
=
NULL
;
const
char
*
stun_server
=
NULL
,
*
stun_server_port
=
NULL
;
g_type_init
();
g_type_init
();
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
);
g_thread_init
(
NULL
);
#endif
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
/* Note: impl limits ...
/* Note: impl limits ...
...
...
tests/test-fullmode.c
View file @
fb6df6a0
...
@@ -804,7 +804,10 @@ int main (void)
...
@@ -804,7 +804,10 @@ int main (void)
const
char
*
stun_server
=
NULL
,
*
stun_server_port
=
NULL
;
const
char
*
stun_server
=
NULL
,
*
stun_server_port
=
NULL
;
g_type_init
();
g_type_init
();
g_thread_init
(
NULL
);
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
);
#endif
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
/* Note: impl limits ...
/* Note: impl limits ...
...
...
tests/test-mainloop.c
View file @
fb6df6a0
...
@@ -73,7 +73,10 @@ main (void)
...
@@ -73,7 +73,10 @@ main (void)
nice_address_init
(
&
addr
);
nice_address_init
(
&
addr
);
g_type_init
();
g_type_init
();
g_thread_init
(
NULL
);
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
);
#endif
loop
=
g_main_loop_new
(
NULL
,
FALSE
);
loop
=
g_main_loop_new
(
NULL
,
FALSE
);
agent
=
nice_agent_new
(
g_main_loop_get_context
(
loop
),
NICE_COMPATIBILITY_RFC5245
);
agent
=
nice_agent_new
(
g_main_loop_get_context
(
loop
),
NICE_COMPATIBILITY_RFC5245
);
...
...
tests/test-restart.c
View file @
fb6df6a0
...
@@ -394,7 +394,10 @@ int main (void)
...
@@ -394,7 +394,10 @@ int main (void)
const
char
*
stun_server
=
NULL
,
*
stun_server_port
=
NULL
;
const
char
*
stun_server
=
NULL
,
*
stun_server_port
=
NULL
;
g_type_init
();
g_type_init
();
g_thread_init
(
NULL
);
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
)
#endif
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
/* Note: impl limits ...
/* Note: impl limits ...
...
...
tests/test-thread.c
View file @
fb6df6a0
...
@@ -189,7 +189,9 @@ int main (void)
...
@@ -189,7 +189,9 @@ int main (void)
GThread
*
ldthread
,
*
rdthread
;
GThread
*
ldthread
,
*
rdthread
;
g_type_init
();
g_type_init
();
g_thread_init
(
NULL
);
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
);
#endif
lmainctx
=
g_main_context_new
();
lmainctx
=
g_main_context_new
();
rmainctx
=
g_main_context_new
();
rmainctx
=
g_main_context_new
();
...
@@ -268,9 +270,15 @@ int main (void)
...
@@ -268,9 +270,15 @@ int main (void)
/* step: run test the first time */
/* step: run test the first time */
g_debug
(
"test-thread: TEST STARTS / running test for the 1st time"
);
g_debug
(
"test-thread: TEST STARTS / running test for the 1st time"
);
#if !GLIB_CHECK_VERSION(2,31,8)
lthread
=
g_thread_create
(
mainloop_thread
,
lmainloop
,
TRUE
,
NULL
);
lthread
=
g_thread_create
(
mainloop_thread
,
lmainloop
,
TRUE
,
NULL
);
g_assert
(
lthread
);
rthread
=
g_thread_create
(
mainloop_thread
,
rmainloop
,
TRUE
,
NULL
);
rthread
=
g_thread_create
(
mainloop_thread
,
rmainloop
,
TRUE
,
NULL
);
#else
lthread
=
g_thread_new
(
"lthread libnice"
,
mainloop_thread
,
lmainloop
);
rthread
=
g_thread_new
(
"rthread libnice"
,
mainloop_thread
,
rmainloop
);
#endif
g_assert
(
lthread
);
g_assert
(
rthread
);
g_assert
(
rthread
);
ls_id
=
nice_agent_add_stream
(
lagent
,
2
);
ls_id
=
nice_agent_add_stream
(
lagent
,
2
);
...
@@ -289,9 +297,14 @@ int main (void)
...
@@ -289,9 +297,14 @@ int main (void)
nice_agent_attach_recv
(
ragent
,
rs_id
,
1
,
rdmainctx
,
cb_nice_recv
,
nice_agent_attach_recv
(
ragent
,
rs_id
,
1
,
rdmainctx
,
cb_nice_recv
,
GUINT_TO_POINTER
(
2
));
GUINT_TO_POINTER
(
2
));
#if !GLIB_CHECK_VERSION(2,31,8)
ldthread
=
g_thread_create
(
mainloop_thread
,
ldmainloop
,
TRUE
,
NULL
);
ldthread
=
g_thread_create
(
mainloop_thread
,
ldmainloop
,
TRUE
,
NULL
);
g_assert
(
ldthread
);
rdthread
=
g_thread_create
(
mainloop_thread
,
rdmainloop
,
TRUE
,
NULL
);
rdthread
=
g_thread_create
(
mainloop_thread
,
rdmainloop
,
TRUE
,
NULL
);
#else
ldthread
=
g_thread_new
(
"ldthread libnice"
,
mainloop_thread
,
ldmainloop
);
rdthread
=
g_thread_new
(
"rdthread libnice"
,
mainloop_thread
,
rdmainloop
);
#endif
g_assert
(
ldthread
);
g_assert
(
rdthread
);
g_assert
(
rdthread
);
/* Run loop for error timer */
/* Run loop for error timer */
...
...
tests/test.c
View file @
fb6df6a0
...
@@ -55,8 +55,10 @@ main (void)
...
@@ -55,8 +55,10 @@ main (void)
nice_address_init
(
&
addr_local
);
nice_address_init
(
&
addr_local
);
nice_address_init
(
&
addr_remote
);
nice_address_init
(
&
addr_remote
);
g_type_init
();
g_type_init
();
g_thread_init
(
NULL
);
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init
(
NULL
);
#endif
g_assert
(
nice_address_set_from_string
(
&
addr_local
,
"127.0.0.1"
));
g_assert
(
nice_address_set_from_string
(
&
addr_local
,
"127.0.0.1"
));
g_assert
(
nice_address_set_from_string
(
&
addr_remote
,
"127.0.0.1"
));
g_assert
(
nice_address_set_from_string
(
&
addr_remote
,
"127.0.0.1"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment