Commit 682db2c8 authored by Jean-Paul Saman's avatar Jean-Paul Saman

stats: Add stream quality counters to Qt4 stastics by counting corrupted...

stats: Add stream quality counters to Qt4 stastics by counting corrupted blocks and discontinuities found.

Note the quality counters are mere indications and not exact reporting of how much blocks/discontinuity really occured. It will only tell you how often it is noticed.
parent 32f7fa10
...@@ -228,6 +228,8 @@ struct input_stats_t ...@@ -228,6 +228,8 @@ struct input_stats_t
int i_demux_read_bytes; int i_demux_read_bytes;
float f_demux_bitrate; float f_demux_bitrate;
float f_average_demux_bitrate; float f_average_demux_bitrate;
int i_demux_corrupted;
int i_demux_discontinuity;
/* Decoders */ /* Decoders */
int i_decoded_audio; int i_decoded_audio;
......
...@@ -171,6 +171,8 @@ enum ...@@ -171,6 +171,8 @@ enum
STATS_READ_PACKETS, STATS_READ_PACKETS,
STATS_DEMUX_READ, STATS_DEMUX_READ,
STATS_DEMUX_BITRATE, STATS_DEMUX_BITRATE,
STATS_DEMUX_CORRUPTED,
STATS_DEMUX_DISCONTINUITY,
STATS_PLAYED_ABUFFERS, STATS_PLAYED_ABUFFERS,
STATS_LOST_ABUFFERS, STATS_LOST_ABUFFERS,
STATS_DECODED_AUDIO, STATS_DECODED_AUDIO,
......
...@@ -526,6 +526,10 @@ InputStatsPanel::InputStatsPanel( QWidget *parent, ...@@ -526,6 +526,10 @@ InputStatsPanel::InputStatsPanel( QWidget *parent,
CREATE_AND_ADD_TO_CAT( demuxed_stat, qtr("Demuxed"), "0", input, "kB") ; CREATE_AND_ADD_TO_CAT( demuxed_stat, qtr("Demuxed"), "0", input, "kB") ;
CREATE_AND_ADD_TO_CAT( stream_bitrate_stat, qtr("Stream bitrate"), CREATE_AND_ADD_TO_CAT( stream_bitrate_stat, qtr("Stream bitrate"),
"0", input, "kb/s" ); "0", input, "kb/s" );
CREATE_AND_ADD_TO_CAT( corrupted_stat, qtr("Corrupted"),
"0", input, "" );
CREATE_AND_ADD_TO_CAT( discontinuity_stat, qtr("Discontinuities"),
"0", input, "" );
CREATE_AND_ADD_TO_CAT( vdecoded_stat, qtr("Decoded blocks"), CREATE_AND_ADD_TO_CAT( vdecoded_stat, qtr("Decoded blocks"),
"0", video, "" ); "0", video, "" );
...@@ -576,6 +580,8 @@ void InputStatsPanel::update( input_item_t *p_item ) ...@@ -576,6 +580,8 @@ void InputStatsPanel::update( input_item_t *p_item )
(float)(p_item->p_stats->i_demux_read_bytes)/1000 ); (float)(p_item->p_stats->i_demux_read_bytes)/1000 );
UPDATE( stream_bitrate_stat, "%6.0f", UPDATE( stream_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_demux_bitrate * 8000 )); (float)(p_item->p_stats->f_demux_bitrate * 8000 ));
UPDATE( corrupted_stat, "%5i", p_item->p_stats->i_demux_corrupted );
UPDATE( discontinuity_stat, "%5i", p_item->p_stats->i_demux_discontinuity );
/* Video */ /* Video */
UPDATE( vdecoded_stat, "%5i", p_item->p_stats->i_decoded_video ); UPDATE( vdecoded_stat, "%5i", p_item->p_stats->i_decoded_video );
......
...@@ -120,6 +120,8 @@ private: ...@@ -120,6 +120,8 @@ private:
QTreeWidgetItem *input_bitrate_stat; QTreeWidgetItem *input_bitrate_stat;
QTreeWidgetItem *demuxed_stat; QTreeWidgetItem *demuxed_stat;
QTreeWidgetItem *stream_bitrate_stat; QTreeWidgetItem *stream_bitrate_stat;
QTreeWidgetItem *corrupted_stat;
QTreeWidgetItem *discontinuity_stat;
QTreeWidgetItem *video; QTreeWidgetItem *video;
QTreeWidgetItem *vdecoded_stat; QTreeWidgetItem *vdecoded_stat;
......
...@@ -1863,6 +1863,19 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block ) ...@@ -1863,6 +1863,19 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
p_block->i_buffer, &i_total ); p_block->i_buffer, &i_total );
stats_UpdateFloat( p_input , p_input->p->counters.p_demux_bitrate, stats_UpdateFloat( p_input , p_input->p->counters.p_demux_bitrate,
(float)i_total, NULL ); (float)i_total, NULL );
/* Update number of corrupted data packats */
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
stats_UpdateInteger( p_input, p_input->p->counters.p_demux_corrupted,
1, NULL );
}
/* Update number of discontinuities */
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
stats_UpdateInteger( p_input, p_input->p->counters.p_demux_discontinuity,
1, NULL );
}
vlc_mutex_unlock( &p_input->p->counters.counters_lock ); vlc_mutex_unlock( &p_input->p->counters.counters_lock );
} }
......
...@@ -801,6 +801,8 @@ static void InitStatistics( input_thread_t * p_input ) ...@@ -801,6 +801,8 @@ static void InitStatistics( input_thread_t * p_input )
INIT_COUNTER( demux_read, INTEGER, COUNTER ); INIT_COUNTER( demux_read, INTEGER, COUNTER );
INIT_COUNTER( input_bitrate, FLOAT, DERIVATIVE ); INIT_COUNTER( input_bitrate, FLOAT, DERIVATIVE );
INIT_COUNTER( demux_bitrate, FLOAT, DERIVATIVE ); INIT_COUNTER( demux_bitrate, FLOAT, DERIVATIVE );
INIT_COUNTER( demux_corrupted, INTEGER, COUNTER );
INIT_COUNTER( demux_discontinuity, INTEGER, COUNTER );
INIT_COUNTER( played_abuffers, INTEGER, COUNTER ); INIT_COUNTER( played_abuffers, INTEGER, COUNTER );
INIT_COUNTER( lost_abuffers, INTEGER, COUNTER ); INIT_COUNTER( lost_abuffers, INTEGER, COUNTER );
INIT_COUNTER( displayed_pictures, INTEGER, COUNTER ); INIT_COUNTER( displayed_pictures, INTEGER, COUNTER );
......
...@@ -139,6 +139,8 @@ struct input_thread_private_t ...@@ -139,6 +139,8 @@ struct input_thread_private_t
counter_t *p_input_bitrate; counter_t *p_input_bitrate;
counter_t *p_demux_read; counter_t *p_demux_read;
counter_t *p_demux_bitrate; counter_t *p_demux_bitrate;
counter_t *p_demux_corrupted;
counter_t *p_demux_discontinuity;
counter_t *p_decoded_audio; counter_t *p_decoded_audio;
counter_t *p_decoded_video; counter_t *p_decoded_video;
counter_t *p_decoded_sub; counter_t *p_decoded_sub;
......
...@@ -171,6 +171,10 @@ void stats_ComputeInputStats( input_thread_t *p_input, input_stats_t *p_stats ) ...@@ -171,6 +171,10 @@ void stats_ComputeInputStats( input_thread_t *p_input, input_stats_t *p_stats )
&p_stats->i_demux_read_bytes ); &p_stats->i_demux_read_bytes );
stats_GetFloat( p_input, p_input->p->counters.p_demux_bitrate, stats_GetFloat( p_input, p_input->p->counters.p_demux_bitrate,
&p_stats->f_demux_bitrate ); &p_stats->f_demux_bitrate );
stats_GetInteger( p_input, p_input->p->counters.p_demux_corrupted,
&p_stats->i_demux_corrupted );
stats_GetInteger( p_input, p_input->p->counters.p_demux_discontinuity,
&p_stats->i_demux_discontinuity );
/* Decoders */ /* Decoders */
stats_GetInteger( p_input, p_input->p->counters.p_decoded_video, stats_GetInteger( p_input, p_input->p->counters.p_decoded_video,
...@@ -212,6 +216,7 @@ void stats_ReinitInputStats( input_stats_t *p_stats ) ...@@ -212,6 +216,7 @@ void stats_ReinitInputStats( input_stats_t *p_stats )
p_stats->f_input_bitrate = p_stats->f_average_input_bitrate = p_stats->f_input_bitrate = p_stats->f_average_input_bitrate =
p_stats->i_demux_read_packets = p_stats->i_demux_read_bytes = p_stats->i_demux_read_packets = p_stats->i_demux_read_bytes =
p_stats->f_demux_bitrate = p_stats->f_average_demux_bitrate = p_stats->f_demux_bitrate = p_stats->f_average_demux_bitrate =
p_stats->i_demux_corrupted = p_stats->i_demux_discontinuity =
p_stats->i_displayed_pictures = p_stats->i_lost_pictures = p_stats->i_displayed_pictures = p_stats->i_lost_pictures =
p_stats->i_played_abuffers = p_stats->i_lost_abuffers = p_stats->i_played_abuffers = p_stats->i_lost_abuffers =
p_stats->i_decoded_video = p_stats->i_decoded_audio = p_stats->i_decoded_video = p_stats->i_decoded_audio =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment