Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
04586748
Commit
04586748
authored
Jun 11, 2006
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/stats.c: fix no-stats mode.
parent
9296f9b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
31 deletions
+34
-31
src/misc/stats.c
src/misc/stats.c
+34
-31
No files found.
src/misc/stats.c
View file @
04586748
...
@@ -88,10 +88,8 @@ int __stats_Create( vlc_object_t *p_this, const char *psz_name, unsigned int i_i
...
@@ -88,10 +88,8 @@ int __stats_Create( vlc_object_t *p_this, const char *psz_name, unsigned int i_i
counter_t
*
p_counter
;
counter_t
*
p_counter
;
stats_handler_t
*
p_handler
;
stats_handler_t
*
p_handler
;
if
(
p_this
->
p_libvlc
->
b_stats
==
VLC_FALSE
)
if
(
!
p_this
->
p_libvlc
->
b_stats
)
return
VLC_EGENERIC
;
{
return
VLC_EGENERIC
;
}
p_handler
=
stats_HandlerGet
(
p_this
);
p_handler
=
stats_HandlerGet
(
p_this
);
if
(
!
p_handler
)
return
VLC_ENOMEM
;
if
(
!
p_handler
)
return
VLC_ENOMEM
;
...
@@ -128,13 +126,11 @@ int __stats_Update( vlc_object_t *p_this, unsigned int i_counter,
...
@@ -128,13 +126,11 @@ int __stats_Update( vlc_object_t *p_this, unsigned int i_counter,
{
{
int
i_ret
;
int
i_ret
;
counter_t
*
p_counter
;
counter_t
*
p_counter
;
stats_handler_t
*
p_handler
;
if
(
!
p_this
->
p_libvlc
->
b_stats
)
return
VLC_EGENERIC
;
/* Get stats handler singleton */
/* Get stats handler singleton */
stats_handler_t
*
p_handler
;
if
(
p_this
->
p_libvlc
->
b_stats
==
VLC_FALSE
)
{
return
VLC_EGENERIC
;
}
p_handler
=
stats_HandlerGet
(
p_this
);
p_handler
=
stats_HandlerGet
(
p_this
);
if
(
!
p_handler
)
return
VLC_ENOMEM
;
if
(
!
p_handler
)
return
VLC_ENOMEM
;
...
@@ -166,13 +162,11 @@ int __stats_Get( vlc_object_t *p_this, int i_object_id,
...
@@ -166,13 +162,11 @@ int __stats_Get( vlc_object_t *p_this, int i_object_id,
unsigned
int
i_counter
,
vlc_value_t
*
val
)
unsigned
int
i_counter
,
vlc_value_t
*
val
)
{
{
counter_t
*
p_counter
;
counter_t
*
p_counter
;
stats_handler_t
*
p_handler
;
if
(
!
p_this
->
p_libvlc
->
b_stats
)
return
VLC_EGENERIC
;
/* Get stats handler singleton */
/* Get stats handler singleton */
stats_handler_t
*
p_handler
;
if
(
p_this
->
p_libvlc
->
b_stats
==
VLC_FALSE
)
{
return
VLC_EGENERIC
;
}
p_handler
=
stats_HandlerGet
(
p_this
);
p_handler
=
stats_HandlerGet
(
p_this
);
if
(
!
p_handler
)
return
VLC_ENOMEM
;
if
(
!
p_handler
)
return
VLC_ENOMEM
;
vlc_mutex_lock
(
&
p_handler
->
object_lock
);
vlc_mutex_lock
(
&
p_handler
->
object_lock
);
...
@@ -244,12 +238,10 @@ counter_t *__stats_CounterGet( vlc_object_t *p_this, int i_object_id,
...
@@ -244,12 +238,10 @@ counter_t *__stats_CounterGet( vlc_object_t *p_this, int i_object_id,
unsigned
int
i_counter
)
unsigned
int
i_counter
)
{
{
counter_t
*
p_counter
;
counter_t
*
p_counter
;
stats_handler_t
*
p_handler
;
stats_handler_t
*
p_handler
;
if
(
p_this
->
p_libvlc
->
b_stats
==
VLC_FALSE
)
{
if
(
!
p_this
->
p_libvlc
->
b_stats
)
return
NULL
;
return
NULL
;
}
p_handler
=
stats_HandlerGet
(
p_this
);
p_handler
=
stats_HandlerGet
(
p_this
);
if
(
!
p_handler
)
return
NULL
;
if
(
!
p_handler
)
return
NULL
;
...
@@ -264,12 +256,14 @@ counter_t *__stats_CounterGet( vlc_object_t *p_this, int i_object_id,
...
@@ -264,12 +256,14 @@ counter_t *__stats_CounterGet( vlc_object_t *p_this, int i_object_id,
}
}
void
stats_ComputeInputStats
(
input_thread_t
*
p_input
,
void
stats_ComputeInputStats
(
input_thread_t
*
p_input
,
input_stats_t
*
p_stats
)
input_stats_t
*
p_stats
)
{
{
vlc_object_t
*
p_obj
;
vlc_object_t
*
p_obj
;
vlc_list_t
*
p_list
;
vlc_list_t
*
p_list
;
int
i_index
;
int
i_index
;
if
(
!
p_input
->
p_libvlc
->
b_stats
)
return
;
vlc_mutex_lock
(
&
p_stats
->
lock
);
vlc_mutex_lock
(
&
p_stats
->
lock
);
/* Input */
/* Input */
...
@@ -360,11 +354,13 @@ void stats_DumpInputStats( input_stats_t *p_stats )
...
@@ -360,11 +354,13 @@ void stats_DumpInputStats( input_stats_t *p_stats )
vlc_mutex_unlock
(
&
p_stats
->
lock
);
vlc_mutex_unlock
(
&
p_stats
->
lock
);
}
}
void
__stats_ComputeGlobalStats
(
vlc_object_t
*
p_obj
,
void
__stats_ComputeGlobalStats
(
vlc_object_t
*
p_obj
,
global_stats_t
*
p_stats
)
global_stats_t
*
p_stats
)
{
{
vlc_list_t
*
p_list
;
vlc_list_t
*
p_list
;
int
i_index
;
int
i_index
;
if
(
!
p_obj
->
p_libvlc
->
b_stats
)
return
;
vlc_mutex_lock
(
&
p_stats
->
lock
);
vlc_mutex_lock
(
&
p_stats
->
lock
);
p_list
=
vlc_list_find
(
p_obj
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
p_list
=
vlc_list_find
(
p_obj
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
...
@@ -401,8 +397,11 @@ void stats_ReinitGlobalStats( global_stats_t *p_stats )
...
@@ -401,8 +397,11 @@ void stats_ReinitGlobalStats( global_stats_t *p_stats )
void
__stats_TimerStart
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
,
void
__stats_TimerStart
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
,
unsigned
int
i_id
)
unsigned
int
i_id
)
{
{
counter_t
*
p_counter
=
stats_CounterGet
(
p_obj
,
counter_t
*
p_counter
;
p_obj
->
p_vlc
->
i_object_id
,
i_id
);
if
(
!
p_obj
->
p_libvlc
->
b_stats
)
return
;
p_counter
=
stats_CounterGet
(
p_obj
,
p_obj
->
p_vlc
->
i_object_id
,
i_id
);
if
(
!
p_counter
)
if
(
!
p_counter
)
{
{
counter_sample_t
*
p_sample
;
counter_sample_t
*
p_sample
;
...
@@ -432,9 +431,11 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
...
@@ -432,9 +431,11 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
void
__stats_TimerStop
(
vlc_object_t
*
p_obj
,
unsigned
int
i_id
)
void
__stats_TimerStop
(
vlc_object_t
*
p_obj
,
unsigned
int
i_id
)
{
{
counter_t
*
p_counter
=
stats_CounterGet
(
p_obj
,
counter_t
*
p_counter
;
p_obj
->
p_vlc
->
i_object_id
,
i_id
);
if
(
!
p_obj
->
p_libvlc
->
b_stats
)
return
;
p_counter
=
stats_CounterGet
(
p_obj
,
p_obj
->
p_vlc
->
i_object_id
,
i_id
);
if
(
!
p_counter
||
p_counter
->
i_samples
!=
2
)
if
(
!
p_counter
||
p_counter
->
i_samples
!=
2
)
{
{
msg_Err
(
p_obj
,
"Timer does not exist"
);
msg_Err
(
p_obj
,
"Timer does not exist"
);
...
@@ -448,9 +449,11 @@ void __stats_TimerStop( vlc_object_t *p_obj, unsigned int i_id )
...
@@ -448,9 +449,11 @@ void __stats_TimerStop( vlc_object_t *p_obj, unsigned int i_id )
void
__stats_TimerDump
(
vlc_object_t
*
p_obj
,
unsigned
int
i_id
)
void
__stats_TimerDump
(
vlc_object_t
*
p_obj
,
unsigned
int
i_id
)
{
{
counter_t
*
p_counter
=
stats_CounterGet
(
p_obj
,
counter_t
*
p_counter
;
p_obj
->
p_vlc
->
i_object_id
,
i_id
);
if
(
!
p_obj
->
p_libvlc
->
b_stats
)
return
;
p_counter
=
stats_CounterGet
(
p_obj
,
p_obj
->
p_vlc
->
i_object_id
,
i_id
);
TimerDump
(
p_obj
,
p_counter
,
VLC_TRUE
);
TimerDump
(
p_obj
,
p_counter
,
VLC_TRUE
);
}
}
...
...
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