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
1ab90751
Commit
1ab90751
authored
Jan 28, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compute global input/output stats (Refs:#473)
parent
8eaff121
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
include/vlc_messages.h
include/vlc_messages.h
+1
-0
include/vlc_playlist.h
include/vlc_playlist.h
+2
-0
src/misc/stats.c
src/misc/stats.c
+9
-4
src/playlist/playlist.c
src/playlist/playlist.c
+8
-1
No files found.
include/vlc_messages.h
View file @
1ab90751
...
...
@@ -344,6 +344,7 @@ struct global_stats_t
vlc_mutex_t
lock
;
float
f_input_bitrate
;
float
f_demux_bitrate
;
float
f_output_bitrate
;
int
i_http_clients
;
...
...
include/vlc_playlist.h
View file @
1ab90751
...
...
@@ -218,6 +218,8 @@ struct playlist_t
// thread
interaction_t
*
p_interaction
;
global_stats_t
*
p_stats
;
/*@}*/
};
...
...
src/misc/stats.c
View file @
1ab90751
...
...
@@ -370,20 +370,25 @@ void __stats_ComputeGlobalStats( vlc_object_t *p_obj,
int
i_index
;
vlc_mutex_lock
(
&
p_stats
->
lock
);
p_list
=
vlc_list_find
(
p_obj
,
VLC_OBJECT_INPUT
,
FIND_
CHILD
);
p_list
=
vlc_list_find
(
p_obj
,
VLC_OBJECT_INPUT
,
FIND_
ANYWHERE
);
if
(
p_list
)
{
float
f_total_in
=
0
,
f_total_out
=
0
,
f_total_demux
=
0
;
for
(
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
float
f_in
=
0
,
f_out
=
0
;
float
f_in
=
0
,
f_out
=
0
,
f_demux
=
0
;
p_obj
=
(
vlc_object_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
stats_GetFloat
(
p_obj
,
p_obj
->
i_object_id
,
"input_bitrate"
,
&
f_in
);
stats_GetFloat
(
p_obj
,
p_obj
->
i_object_id
,
"sout_send_bitrate"
,
&
f_out
);
p_stats
->
f_input_bitrate
+=
f_in
;
p_stats
->
f_output_bitrate
+=
f_out
;
stats_GetFloat
(
p_obj
,
p_obj
->
i_object_id
,
"demux_bitrate"
,
&
f_demux
);
f_total_in
+=
f_in
;
f_total_out
+=
f_out
;
f_total_demux
+=
f_demux
;
}
p_stats
->
f_input_bitrate
=
f_total_in
;
p_stats
->
f_output_bitrate
=
f_total_out
;
p_stats
->
f_demux_bitrate
=
f_total_demux
;
vlc_list_release
(
p_list
);
}
...
...
src/playlist/playlist.c
View file @
1ab90751
...
...
@@ -173,10 +173,12 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
p_playlist
->
request
.
b_request
=
VLC_FALSE
;
p_playlist
->
status
.
i_status
=
PLAYLIST_STOPPED
;
p_playlist
->
i_sort
=
SORT_ID
;
p_playlist
->
i_order
=
ORDER_NORMAL
;
p_playlist
->
p_stats
=
(
global_stats_t
*
)
malloc
(
sizeof
(
global_stats_t
)
);
vlc_mutex_init
(
p_playlist
,
&
p_playlist
->
p_stats
->
lock
);
/* Finally, launch the thread ! */
if
(
vlc_thread_create
(
p_playlist
,
"playlist"
,
RunThread
,
VLC_THREAD_PRIORITY_LOW
,
VLC_TRUE
)
)
...
...
@@ -598,6 +600,11 @@ static void RunThread ( playlist_t *p_playlist )
stats_TimerStop
(
p_playlist
,
"Interaction thread"
);
}
if
(
i_loops
%
5
==
0
&&
p_playlist
->
p_stats
)
{
stats_ComputeGlobalStats
(
p_playlist
,
p_playlist
->
p_stats
);
}
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
/* First, check if we have something to do */
...
...
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