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
20a5868e
Commit
20a5868e
authored
Nov 14, 2014
by
Philip Withnall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent: Add debug output for lifetime of Components and Streams
parent
28d1c100
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
agent/component.c
agent/component.c
+13
-0
agent/stream.c
agent/stream.c
+13
-0
No files found.
agent/component.c
View file @
20a5868e
...
...
@@ -42,6 +42,11 @@
* @brief ICE component functions
*/
/* Simple tracking for the number of alive components. These must be accessed
* atomically. */
static
volatile
unsigned
int
n_components_created
=
0
;
static
volatile
unsigned
int
n_components_destroyed
=
0
;
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
...
...
@@ -121,6 +126,10 @@ component_new (guint id, NiceAgent *agent, Stream *stream)
{
Component
*
component
;
g_atomic_int_inc
(
&
n_components_created
);
nice_debug
(
"Created NiceComponent (%u created, %u destroyed)"
,
n_components_created
,
n_components_destroyed
);
component
=
g_slice_new0
(
Component
);
component
->
id
=
id
;
component
->
state
=
NICE_COMPONENT_STATE_DISCONNECTED
;
...
...
@@ -318,6 +327,10 @@ component_free (Component *cmp)
g_main_context_unref
(
cmp
->
own_ctx
);
g_slice_free
(
Component
,
cmp
);
g_atomic_int_inc
(
&
n_components_destroyed
);
nice_debug
(
"Destroyed NiceComponent (%u created, %u destroyed)"
,
n_components_created
,
n_components_destroyed
);
}
/*
...
...
agent/stream.c
View file @
20a5868e
...
...
@@ -43,6 +43,11 @@
#include "stream.h"
/* Simple tracking for the number of alive streams. These must be accessed
* atomically. */
static
volatile
unsigned
int
n_streams_created
=
0
;
static
volatile
unsigned
int
n_streams_destroyed
=
0
;
/*
* @file stream.c
* @brief ICE stream functionality
...
...
@@ -54,6 +59,10 @@ stream_new (guint n_components, NiceAgent *agent)
guint
n
;
Component
*
component
;
g_atomic_int_inc
(
&
n_streams_created
);
nice_debug
(
"Created NiceStream (%u created, %u destroyed)"
,
n_streams_created
,
n_streams_destroyed
);
stream
=
g_slice_new0
(
Stream
);
for
(
n
=
0
;
n
<
n_components
;
n
++
)
{
component
=
component_new
(
n
+
1
,
agent
,
stream
);
...
...
@@ -83,6 +92,10 @@ stream_free (Stream *stream)
g_free
(
stream
->
name
);
g_slist_free_full
(
stream
->
components
,
(
GDestroyNotify
)
component_free
);
g_slice_free
(
Stream
,
stream
);
g_atomic_int_inc
(
&
n_streams_destroyed
);
nice_debug
(
"Destroyed NiceStream (%u created, %u destroyed)"
,
n_streams_created
,
n_streams_destroyed
);
}
Component
*
...
...
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