int i_displayed_pictures;
int i_lost_pictures;
+ /* Sout */
+ int i_sent_packets;
+ int i_sent_bytes;
+ float f_send_bitrate;
+
/* Aout */
int i_played_abuffers;
int i_lost_abuffers;
video_bsizer->Layout();
sizer->Add( video_bsizer , 0, wxALL| wxGROW, 5 );
+ /* Sout */
+ wxStaticBox *sout_box = new wxStaticBox( this, -1,
+ wxU( _("Streaming" ) ) );
+ sout_box->SetAutoLayout( TRUE );
+ sout_bsizer = new wxStaticBoxSizer( sout_box, wxVERTICAL );
+ sout_sizer = new wxFlexGridSizer( 2,3, 20 );
+
+#define SOUT_ADD(txt,widget,dflt) \
+ { sout_sizer->Add ( new wxStaticText( this, -1, wxU(_( txt ) ) ), \
+ 0, wxEXPAND|wxLEFT|wxALIGN_LEFT , 5 ); \
+ widget = new wxStaticText( this, -1, wxU( dflt ) ); \
+ sout_sizer->Add( widget, 0, wxEXPAND|wxRIGHT|wxALIGN_RIGHT, 5 ); \
+ }
+ SOUT_ADD( "Sent packets", sout_sent_packets_text, "0" );
+ SOUT_ADD( "Sent bytes", sout_sent_bytes_text, "0 " );
+ SOUT_ADD( "Send rate", sout_send_bitrate_text, "0 " );
+ sout_sizer->Layout();
+ sout_bsizer->Add( sout_sizer, 0, wxALL | wxGROW, 5 );
+ sout_bsizer->Layout();
+ sizer->Add( sout_bsizer , 0, wxALL| wxGROW, 5 );
+
/* Aout */
wxStaticBox *audio_box = new wxStaticBox( this, -1,
wxU( _("Audio" ) ) );
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->AddSpacer( 0 );
sizer->Add( audio_bsizer , 0, wxALL| wxGROW, 5 );
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 );
+ /* Sout */
+ UPDATE( sout_sent_packets_text, "%5i", p_item->p_stats->i_sent_packets );
+ UPDATE( sout_sent_bytes_text, "%8.0f kB",
+ (float)(p_item->p_stats->i_sent_bytes)/1000 );
+ UPDATE( sout_send_bitrate_text, "%6.0f kB/S",
+ (float)(p_item->p_stats->f_send_bitrate)*1000 );
+
+ /* Audio*/
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 );
wxStaticText *displayed_text;
wxStaticText *lost_frames_text;
+ wxFlexGridSizer *sout_sizer;
+ wxStaticBoxSizer *sout_bsizer;
+ wxStaticText *sout_sent_packets_text;
+ wxStaticText *sout_sent_bytes_text;
+ wxStaticText *sout_send_bitrate_text;
+
wxFlexGridSizer *audio_sizer;
wxStaticBoxSizer *audio_bsizer;
wxStaticText *audio_decoded_text;
while( (p_audio_buf = id->p_decoder->pf_decode_audio( id->p_decoder,
&in )) )
{
+ stats_UpdateInteger( p_stream->p_parent->p_parent, "decoded_audio", 1 );
if( p_sys->b_master_sync )
{
mtime_t i_dts = date_Get( &id->interpolated_pts ) + 1;
while( (p_pic = id->p_decoder->pf_decode_video( id->p_decoder, &in )) )
{
subpicture_t *p_subpic = 0;
+ stats_UpdateInteger( p_stream->p_parent->p_parent, "decoded_video", 1 );
if( p_stream->p_sout->i_out_pace_nocontrol && p_sys->b_hurry_up )
{
{
vlc_mutex_unlock( &p_handler->object_lock );
vlc_object_release( p_handler );
+ val->i_int = val->f_float = 0.0;
return VLC_ENOOBJ;
}
vlc_mutex_lock( &p_handler->object_lock );
/* Look for existing element */
- p_counter = GetCounter( p_handler, p_this->i_object_id,
+ p_counter = GetCounter( p_handler, i_object_id,
psz_name );
vlc_mutex_unlock( &p_handler->object_lock );
vlc_object_release( p_handler );
stats_GetInteger( p_input, p_input->i_object_id, "decoded_audio",
&p_stats->i_decoded_audio );
+ /* Sout */
+ stats_GetInteger( p_input, p_input->i_object_id, "sout_sent_packets",
+ &p_stats->i_sent_packets );
+ stats_GetInteger( p_input, p_input->i_object_id, "sout_sent_bytes",
+ &p_stats->i_sent_bytes );
+ stats_GetFloat ( p_input, p_input->i_object_id, "sout_send_bitrate",
+ &p_stats->f_send_bitrate );
+
/* 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 */
+ /* Vouts - FIXME: Store all in input */
p_list = vlc_list_find( p_input, VLC_OBJECT_VOUT, FIND_CHILD );
if( p_list )
{
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;
+ p_stats->i_decoded_video = p_stats->i_decoded_audio =
+ p_stats->i_sent_bytes = p_stats->i_sent_packets = p_stats->f_send_bitrate
+ = 0;
}
void stats_DumpInputStats( input_stats_t *p_stats )
/* 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\n"
- " - Vout : %i/%i - Aout : %i/%i\n",
+ " - Vout : %i/%i - Aout : %i/%i - Vout : %f\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_played_abuffers, p_stats->i_lost_abuffers );
+ p_stats->i_played_abuffers, p_stats->i_lost_abuffers,
+ p_stats->f_send_bitrate );
vlc_mutex_unlock( &p_stats->lock );
}
{
sout_instance_t *p_sout;
vlc_value_t keep;
+ counter_t *p_counter;
if( var_Get( p_parent, "sout-keep", &keep ) < 0 )
{
/* attach it for inherit */
vlc_object_attach( p_sout, p_parent );
+ /* Create statistics */
+ stats_Create( p_parent, "sout_sent_packets",
+ VLC_VAR_INTEGER, STATS_COUNTER );
+ stats_Create( p_parent, "sout_sent_bytes", VLC_VAR_INTEGER, STATS_COUNTER );
+ stats_Create( p_parent, "sout_send_bitrate",
+ VLC_VAR_FLOAT, STATS_DERIVATIVE );
+ p_counter = stats_CounterGet( p_parent, p_parent->i_object_id,
+ "sout_send_bitrate" );
+ if( p_counter) p_counter->update_interval = 1000000;
+
p_sout->p_stream = sout_StreamNew( p_sout, p_sout->psz_chain );
if( p_sout->p_stream == NULL )
*****************************************************************************/
int sout_AccessOutWrite( sout_access_out_t *p_access, block_t *p_buffer )
{
+ int i_total;
+ /* Access_out -> sout_instance -> input_thread_t */
+ stats_UpdateInteger( p_access->p_parent->p_parent,
+ "sout_sent_packets", 1 );
+ stats_UpdateInteger( p_access->p_parent->p_parent,
+ "sout_sent_bytes", p_buffer->i_buffer );
+ stats_GetInteger( p_access->p_parent->p_parent,
+ p_access->p_parent->p_parent->i_object_id,
+ "sout_sent_bytes", &i_total );
+ stats_UpdateFloat( p_access->p_parent->p_parent, "sout_send_bitrate",
+ (float)i_total );
return p_access->pf_write( p_access, p_buffer );
}