* third-party. */
vlc_mutex_t lock;
+ /* The input thread that spawned this input */
+ input_thread_t *p_input_thread;
+
audio_sample_format_t input;
aout_alloc_t input_alloc;
/* Vout */
int i_displayed_pictures;
int i_lost_pictures;
+
+ /* Aout */
+ int i_played_abuffers;
+ int i_lost_abuffers;
};
VLC_EXPORT( void, stats_ComputeInputStats, (input_thread_t*, input_stats_t*) );
video_bsizer->Layout();
sizer->Add( video_bsizer , 0, wxALL| wxGROW, 5 );
+ /* Aout */
+ wxStaticBox *audio_box = new wxStaticBox( this, -1,
+ wxU( _("Audio" ) ) );
+ audio_box->SetAutoLayout( TRUE );
+ audio_bsizer = new wxStaticBoxSizer( audio_box, wxVERTICAL );
+ audio_sizer = new wxFlexGridSizer( 2,3, 20 );
+
+#define AUDIO_ADD(txt,widget,dflt) \
+ { audio_sizer->Add ( new wxStaticText( this, -1, wxU(_( txt ) ) ), \
+ 0, wxEXPAND|wxLEFT , 5 ); \
+ widget = new wxStaticText( this, -1, wxU( dflt ) ); \
+ audio_sizer->Add( widget, 0, wxEXPAND|wxRIGHT, 5 ); \
+ }
+ AUDIO_ADD( "Decoded blocks", audio_decoded_text, "0" );
+ /* Hack to get enough size */
+ AUDIO_ADD( "Played buffers", played_abuffers_text,
+ "0 " );
+ AUDIO_ADD( "Lost buffers", lost_abuffers_text, "0" );
+
+
+ audio_sizer->Layout();
+ audio_bsizer->Add( audio_sizer, 0, wxALL | wxGROW, 5 );
+ audio_bsizer->Layout();
+ sizer->Add( audio_bsizer , 0, wxALL| wxGROW, 5 );
+
sizer->Layout();
panel_sizer->Add( sizer, 0, wxEXPAND, 5 );
panel_sizer->Layout();
UPDATE( displayed_text, "%5i", p_item->p_stats->i_displayed_pictures );
UPDATE( lost_frames_text, "%5i", p_item->p_stats->i_lost_pictures );
+ UPDATE( audio_decoded_text, "%5i", p_item->p_stats->i_decoded_audio );
+ UPDATE( played_abuffers_text, "%5i", p_item->p_stats->i_played_abuffers );
+ UPDATE( lost_abuffers_text, "%5i", p_item->p_stats->i_lost_abuffers );
+
vlc_mutex_unlock( &p_item->p_stats->lock );
input_sizer->Layout();
wxFlexGridSizer *input_sizer;
wxStaticBoxSizer *input_bsizer;
-
wxStaticText *read_bytes_text;
wxStaticText *input_bitrate_text;
wxStaticText *demux_bytes_text;
wxFlexGridSizer *video_sizer;
wxStaticBoxSizer *video_bsizer;
-
wxStaticText *video_decoded_text;
wxStaticText *displayed_text;
wxStaticText *lost_frames_text;
+
+ wxFlexGridSizer *audio_sizer;
+ wxStaticBoxSizer *audio_bsizer;
+ wxStaticText *audio_decoded_text;
+ wxStaticText *played_abuffers_text;
+ wxStaticText *lost_abuffers_text;
};
};
#endif
{
p_input->i_pts_delay = p_input_thread->i_pts_delay;
p_input->i_pts_delay += p_input->i_desync;
+ p_input->p_input_thread = p_input_thread;
vlc_object_release( p_input_thread );
}
else
{
p_input->i_pts_delay = DEFAULT_PTS_DELAY;
p_input->i_pts_delay += p_input->i_desync;
+ p_input->p_input_thread = NULL;
}
return p_input;
{
msg_Warn( p_aout, "received buffer in the future ("I64Fd")",
p_buffer->start_date - mdate());
+ if( p_input->p_input_thread )
+ {
+ stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 );
+ }
aout_BufferFree( p_buffer );
return -1;
}
/* Run the mixer if it is able to run. */
vlc_mutex_lock( &p_aout->mixer_lock );
aout_MixerRun( p_aout );
+ if( p_input->p_input_thread )
+ {
+ stats_UpdateInteger( p_input->p_input_thread,
+ "played_abuffers", 1 );
+ }
vlc_mutex_unlock( &p_aout->mixer_lock );
return 0;
p_input->pp_resamplers[0]->b_continuity = VLC_FALSE;
}
start_date = 0;
+ if( p_input->p_input_thread )
+ {
+ stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 );
+ }
}
if ( p_buffer->start_date < mdate() + AOUT_MIN_PREPARE_TIME )
* can't present it anyway, so drop the buffer. */
msg_Warn( p_aout, "PTS is out of range ("I64Fd"), dropping buffer",
mdate() - p_buffer->start_date );
+ if( p_input->p_input_thread )
+ {
+ stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 );
+ }
aout_BufferFree( p_buffer );
p_input->i_resampling_type = AOUT_RESAMPLING_NONE;
if ( p_input->i_nb_resamplers != 0 )
msg_Warn( p_aout, "audio drift is too big ("I64Fd"), dropping buffer",
start_date - p_buffer->start_date );
aout_BufferFree( p_buffer );
+ if( p_input->p_input_thread )
+ {
+ stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 );
+ }
return 0;
}
"trashing", mdate() - p_buffer->start_date );
p_buffer = aout_FifoPop( p_aout, p_fifo );
aout_BufferFree( p_buffer );
+ if( p_input->p_input_thread )
+ {
+// stats_UpdateInteger( p_input->p_input_thread,
+// "lost_abuffers", 1 );
+ }
p_buffer = p_fifo->p_first;
p_input->p_first_byte_to_mix = NULL;
}
msg_Warn( p_aout, "the mixer got a packet in the past ("I64Fd")",
start_date - p_buffer->end_date );
aout_BufferFree( p_buffer );
+ if( p_input->p_input_thread )
+ {
+// stats_UpdateInteger( p_input->p_input_thread,
+// "lost_abuffers", 1 );
+ }
p_fifo->p_first = p_buffer = p_next;
p_input->p_first_byte_to_mix = NULL;
}
*/
if( !b_quick )
{
+ /* Prepare statistics */
counter_t *p_counter;
stats_Create( p_input, "read_bytes", VLC_VAR_INTEGER, STATS_COUNTER );
stats_Create( p_input, "read_packets", VLC_VAR_INTEGER, STATS_COUNTER );
"demux_bitrate" );
if( p_counter ) p_counter->update_interval = 1000000;
+ stats_Create( p_input, "played_abuffers", VLC_VAR_INTEGER, STATS_COUNTER );
+ stats_Create( p_input, "lost_abuffers", VLC_VAR_INTEGER, STATS_COUNTER );
+
+ /* handle sout */
psz = var_GetString( p_input, "sout" );
if( *psz && strncasecmp( p_input->input.p_item->psz_uri, "vlc:", 4 ) )
{
if( !p_handler ) return VLC_ENOMEM;
vlc_mutex_lock( &p_handler->object_lock );
-
/* Look for existing element */
p_counter = GetCounter( p_handler, p_this->i_object_id,
psz_name );
if( !p_handler ) return VLC_ENOMEM;
vlc_mutex_lock( &p_handler->object_lock );
-
/* Look for existing element */
p_counter = GetCounter( p_handler, i_object_id,
psz_name );
stats_GetInteger( p_input, p_input->i_object_id, "decoded_audio",
&p_stats->i_decoded_audio );
+ /* Aout - We store in p_input because aout is shared */
+ stats_GetInteger( p_input, p_input->i_object_id, "played_abuffers",
+ &p_stats->i_played_abuffers );
+ stats_GetInteger( p_input, p_input->i_object_id, "lost_abuffers",
+ &p_stats->i_lost_abuffers );
+
/* Vouts */
p_list = vlc_list_find( p_input, VLC_OBJECT_VOUT, FIND_CHILD );
if( p_list )
}
vlc_list_release( p_list );
}
+
vlc_mutex_unlock( &p_stats->lock );
}
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->i_displayed_pictures = p_stats->i_lost_pictures =
+ p_stats->i_played_abuffers = p_stats->i_lost_abuffers =
p_stats->i_decoded_video = p_stats->i_decoded_audio = 0;
}
vlc_mutex_lock( &p_stats->lock );
/* f_bitrate is in bytes / microsecond
* *1000 => bytes / millisecond => kbytes / seconds */
- fprintf( stderr, "Input : %i (%i bytes) - %f kB/s - "
- "Demux : %i (%i bytes) - %f kB/s - Vout : %i/%i\n",
+ fprintf( stderr, "Input : %i (%i bytes) - %f kB/s - Demux : %i (%i bytes) - %f kB/s\n"
+ " - Vout : %i/%i - Aout : %i/%i\n",
p_stats->i_read_packets, p_stats->i_read_bytes,
p_stats->f_input_bitrate * 1000,
p_stats->i_demux_read_packets, p_stats->i_demux_read_bytes,
p_stats->f_demux_bitrate * 1000,
- 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 );
vlc_mutex_unlock( &p_stats->lock );
}
char *psz_name )
{
int i;
- for( i = 0; i< p_handler->i_counters; i++ )
+ for( i = 0; i< p_handler->i_counters; i++ )
{
counter_t *p_counter = p_handler->pp_counters[i];
if( p_counter->i_source_object == i_object_id &&
{
stats_ComputeInputStats( p_playlist->p_input,
p_playlist->p_input->input.p_item->p_stats );
-// stats_DumpInputStats(
+// stats_DumpInputStats(
// p_playlist->p_input->input.p_item->p_stats );
}