Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
7032788b
Commit
7032788b
authored
Jun 19, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small stats improvements
parent
666dc088
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
29 deletions
+33
-29
src/input/input.c
src/input/input.c
+31
-25
src/misc/stats.c
src/misc/stats.c
+2
-4
No files found.
src/input/input.c
View file @
7032788b
...
...
@@ -683,26 +683,28 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
/* Prepare statistics */
#define INIT_COUNTER( p, type, compute ) p_input->counters.p_##p = \
stats_CounterCreate( p_input, VLC_VAR_##type, STATS_##compute);
INIT_COUNTER
(
read_bytes
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
read_packets
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
demux_read
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
input_bitrate
,
FLOAT
,
DERIVATIVE
);
INIT_COUNTER
(
demux_bitrate
,
FLOAT
,
DERIVATIVE
);
INIT_COUNTER
(
played_abuffers
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
lost_abuffers
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
displayed_pictures
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
lost_pictures
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
decoded_audio
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
decoded_video
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
decoded_sub
,
INTEGER
,
COUNTER
);
p_input
->
counters
.
p_sout_send_bitrate
=
NULL
;
p_input
->
counters
.
p_sout_sent_packets
=
NULL
;
p_input
->
counters
.
p_sout_sent_bytes
=
NULL
;
if
(
p_input
->
counters
.
p_demux_bitrate
)
p_input
->
counters
.
p_demux_bitrate
->
update_interval
=
1000000
;
if
(
p_input
->
counters
.
p_input_bitrate
)
p_input
->
counters
.
p_input_bitrate
->
update_interval
=
1000000
;
if
(
p_this
->
p_libvlc
->
b_stats
)
{
INIT_COUNTER
(
read_bytes
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
read_packets
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
demux_read
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
input_bitrate
,
FLOAT
,
DERIVATIVE
);
INIT_COUNTER
(
demux_bitrate
,
FLOAT
,
DERIVATIVE
);
INIT_COUNTER
(
played_abuffers
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
lost_abuffers
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
displayed_pictures
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
lost_pictures
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
decoded_audio
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
decoded_video
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
decoded_sub
,
INTEGER
,
COUNTER
);
p_input
->
counters
.
p_sout_send_bitrate
=
NULL
;
p_input
->
counters
.
p_sout_sent_packets
=
NULL
;
p_input
->
counters
.
p_sout_sent_bytes
=
NULL
;
if
(
p_input
->
counters
.
p_demux_bitrate
)
p_input
->
counters
.
p_demux_bitrate
->
update_interval
=
1000000
;
if
(
p_input
->
counters
.
p_input_bitrate
)
p_input
->
counters
.
p_input_bitrate
->
update_interval
=
1000000
;
}
vlc_mutex_init
(
p_input
,
&
p_input
->
counters
.
counters_lock
);
/* handle sout */
...
...
@@ -717,11 +719,15 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
free
(
psz
);
return
VLC_EGENERIC
;
}
INIT_COUNTER
(
sout_sent_packets
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
sout_sent_bytes
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
sout_send_bitrate
,
FLOAT
,
DERIVATIVE
);
if
(
p_input
->
counters
.
p_sout_send_bitrate
)
p_input
->
counters
.
p_sout_send_bitrate
->
update_interval
=
1000000
;
if
(
p_input
->
p_libvlc
->
b_stats
)
{
INIT_COUNTER
(
sout_sent_packets
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
sout_sent_bytes
,
INTEGER
,
COUNTER
);
INIT_COUNTER
(
sout_send_bitrate
,
FLOAT
,
DERIVATIVE
);
if
(
p_input
->
counters
.
p_sout_send_bitrate
)
p_input
->
counters
.
p_sout_send_bitrate
->
update_interval
=
1000000
;
}
}
free
(
psz
);
}
...
...
src/misc/stats.c
View file @
7032788b
...
...
@@ -94,9 +94,7 @@ int __stats_Update( vlc_object_t *p_this, counter_t *p_counter,
*/
int
__stats_Get
(
vlc_object_t
*
p_this
,
counter_t
*
p_counter
,
vlc_value_t
*
val
)
{
if
(
!
p_this
->
p_libvlc
->
b_stats
)
return
VLC_EGENERIC
;
if
(
p_counter
->
i_samples
==
0
)
if
(
!
p_this
->
p_libvlc
->
b_stats
||
p_counter
->
i_samples
==
0
)
{
val
->
i_int
=
val
->
f_float
=
0
.
0
;
return
VLC_EGENERIC
;
...
...
@@ -147,7 +145,7 @@ void stats_ComputeInputStats( input_thread_t *p_input, input_stats_t *p_stats )
/* Input */
stats_GetInteger
(
p_input
,
p_input
->
counters
.
p_read_packets
,
&
p_stats
->
i_read_packets
);
stats_GetInteger
(
p_input
,
p_input
->
counters
.
p_read_bytes
,
stats_GetInteger
(
p_input
,
p_input
->
counters
.
p_read_bytes
,
&
p_stats
->
i_read_bytes
);
stats_GetFloat
(
p_input
,
p_input
->
counters
.
p_input_bitrate
,
&
p_stats
->
f_input_bitrate
);
...
...
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