Changeset 5bd61a8060701e1c0c6b70066f0e2f27b117ea43

Show
Ignore:
Timestamp:
21/01/06 15:14:36 (3 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1137852876 +0000
git-parent:

[e328a29da456766a9a06b8de55177df0857c0400]

git-author:
Clément Stenac <zorglub@videolan.org> 1137852876 +0000
Message:

Audio - Refs:#473

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/aout_internal.h

    r2cb472d r5bd61a8  
    151151    vlc_mutex_t             lock; 
    152152 
     153    /* The input thread that spawned this input */ 
     154    input_thread_t         *p_input_thread; 
     155 
    153156    audio_sample_format_t   input; 
    154157    aout_alloc_t            input_alloc; 
  • include/vlc_messages.h

    r4f86b95 r5bd61a8  
    315315    int i_displayed_pictures; 
    316316    int i_lost_pictures; 
     317 
     318    /* Aout */ 
     319    int i_played_abuffers; 
     320    int i_lost_abuffers; 
    317321}; 
    318322 
  • modules/gui/wxwidgets/dialogs/infopanels.cpp

    rb930462 r5bd61a8  
    198198    sizer->Add( video_bsizer , 0, wxALL| wxGROW, 5 ); 
    199199 
     200   /* Aout */ 
     201    wxStaticBox *audio_box = new wxStaticBox( this, -1, 
     202                                              wxU( _("Audio" ) ) ); 
     203    audio_box->SetAutoLayout( TRUE ); 
     204    audio_bsizer = new wxStaticBoxSizer( audio_box, wxVERTICAL ); 
     205    audio_sizer = new wxFlexGridSizer( 2,3, 20 ); 
     206 
     207#define AUDIO_ADD(txt,widget,dflt) \ 
     208    { audio_sizer->Add ( new wxStaticText( this, -1, wxU(_( txt ) ) ),   \ 
     209                         0, wxEXPAND|wxLEFT , 5  );                      \ 
     210      widget = new wxStaticText( this, -1, wxU( dflt ) );                \ 
     211      audio_sizer->Add( widget, 0, wxEXPAND|wxRIGHT, 5 );                \ 
     212    } 
     213    AUDIO_ADD( "Decoded blocks", audio_decoded_text, "0" ); 
     214    /* Hack to get enough size */ 
     215    AUDIO_ADD( "Played buffers", played_abuffers_text, 
     216                                 "0                  " ); 
     217    AUDIO_ADD( "Lost buffers", lost_abuffers_text, "0" ); 
     218 
     219 
     220    audio_sizer->Layout(); 
     221    audio_bsizer->Add( audio_sizer, 0, wxALL | wxGROW, 5 ); 
     222    audio_bsizer->Layout(); 
     223    sizer->Add( audio_bsizer , 0, wxALL| wxGROW, 5 ); 
     224 
    200225    sizer->Layout(); 
    201226    panel_sizer->Add( sizer, 0, wxEXPAND, 5 ); 
     
    229254    UPDATE( lost_frames_text, "%5i", p_item->p_stats->i_lost_pictures ); 
    230255 
     256    UPDATE( audio_decoded_text, "%5i", p_item->p_stats->i_decoded_audio ); 
     257    UPDATE( played_abuffers_text, "%5i", p_item->p_stats->i_played_abuffers ); 
     258    UPDATE( lost_abuffers_text, "%5i", p_item->p_stats->i_lost_abuffers ); 
     259 
    231260    vlc_mutex_unlock( &p_item->p_stats->lock ); 
    232261 
  • modules/gui/wxwidgets/dialogs/infopanels.hpp

    rb930462 r5bd61a8  
    8787    wxFlexGridSizer *input_sizer; 
    8888    wxStaticBoxSizer *input_bsizer; 
    89  
    9089    wxStaticText *read_bytes_text; 
    9190    wxStaticText *input_bitrate_text; 
     
    9594    wxFlexGridSizer *video_sizer; 
    9695    wxStaticBoxSizer *video_bsizer; 
    97  
    9896    wxStaticText *video_decoded_text; 
    9997    wxStaticText *displayed_text; 
    10098    wxStaticText *lost_frames_text; 
     99 
     100    wxFlexGridSizer *audio_sizer; 
     101    wxStaticBoxSizer *audio_bsizer; 
     102    wxStaticText *audio_decoded_text; 
     103    wxStaticText *played_abuffers_text; 
     104    wxStaticText *lost_abuffers_text; 
    101105}; 
    102106}; 
  • src/audio_output/dec.c

    r2cb472d r5bd61a8  
    135135        p_input->i_pts_delay = p_input_thread->i_pts_delay; 
    136136        p_input->i_pts_delay += p_input->i_desync; 
     137        p_input->p_input_thread = p_input_thread; 
    137138        vlc_object_release( p_input_thread ); 
    138139    } 
     
    141142        p_input->i_pts_delay = DEFAULT_PTS_DELAY; 
    142143        p_input->i_pts_delay += p_input->i_desync; 
     144        p_input->p_input_thread = NULL; 
    143145    } 
    144146 
     
    309311        msg_Warn( p_aout, "received buffer in the future ("I64Fd")", 
    310312                  p_buffer->start_date - mdate()); 
     313        if( p_input->p_input_thread ) 
     314        { 
     315            stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 ); 
     316        } 
    311317        aout_BufferFree( p_buffer ); 
    312318        return -1; 
     
    359365    vlc_mutex_lock( &p_aout->mixer_lock ); 
    360366    aout_MixerRun( p_aout ); 
     367    if( p_input->p_input_thread ) 
     368    { 
     369        stats_UpdateInteger( p_input->p_input_thread, 
     370                            "played_abuffers", 1 ); 
     371    } 
    361372    vlc_mutex_unlock( &p_aout->mixer_lock ); 
    362373 
  • src/audio_output/input.c

    r2cb472d r5bd61a8  
    446446        } 
    447447        start_date = 0; 
     448        if( p_input->p_input_thread ) 
     449        { 
     450            stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 ); 
     451        } 
    448452    } 
    449453 
     
    454458        msg_Warn( p_aout, "PTS is out of range ("I64Fd"), dropping buffer", 
    455459                  mdate() - p_buffer->start_date ); 
     460        if( p_input->p_input_thread ) 
     461        { 
     462            stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 ); 
     463        } 
    456464        aout_BufferFree( p_buffer ); 
    457465        p_input->i_resampling_type = AOUT_RESAMPLING_NONE; 
     
    491499                  start_date - p_buffer->start_date ); 
    492500        aout_BufferFree( p_buffer ); 
     501        if( p_input->p_input_thread ) 
     502        { 
     503            stats_UpdateInteger( p_input->p_input_thread, "lost_abuffers", 1 ); 
     504        } 
    493505        return 0; 
    494506    } 
  • src/audio_output/mixer.c

    r2cb472d r5bd61a8  
    141141                p_buffer = aout_FifoPop( p_aout, p_fifo ); 
    142142                aout_BufferFree( p_buffer ); 
     143                if( p_input->p_input_thread ) 
     144                { 
     145//                    stats_UpdateInteger( p_input->p_input_thread, 
     146//                                         "lost_abuffers", 1 ); 
     147                } 
    143148                p_buffer = p_fifo->p_first; 
    144149                p_input->p_first_byte_to_mix = NULL; 
     
    198203                      start_date - p_buffer->end_date ); 
    199204            aout_BufferFree( p_buffer ); 
     205            if( p_input->p_input_thread ) 
     206            { 
     207//                stats_UpdateInteger( p_input->p_input_thread, 
     208//                                     "lost_abuffers", 1 ); 
     209            } 
    200210            p_fifo->p_first = p_buffer = p_next; 
    201211            p_input->p_first_byte_to_mix = NULL; 
  • src/input/input.c

    rdc6ed6d r5bd61a8  
    684684    if( !b_quick ) 
    685685    { 
     686        /* Prepare statistics */ 
    686687        counter_t *p_counter; 
    687688        stats_Create( p_input, "read_bytes", VLC_VAR_INTEGER, STATS_COUNTER ); 
     
    699700        if( p_counter ) p_counter->update_interval = 1000000; 
    700701 
     702        stats_Create( p_input, "played_abuffers", VLC_VAR_INTEGER, STATS_COUNTER ); 
     703        stats_Create( p_input, "lost_abuffers", VLC_VAR_INTEGER, STATS_COUNTER ); 
     704 
     705        /* handle sout */ 
    701706        psz = var_GetString( p_input, "sout" ); 
    702707        if( *psz && strncasecmp( p_input->input.p_item->psz_uri, "vlc:", 4 ) ) 
  • src/misc/stats.c

    rcb1196f r5bd61a8  
    139139 
    140140    vlc_mutex_lock( &p_handler->object_lock ); 
    141  
    142141    /* Look for existing element */ 
    143142    p_counter = GetCounter( p_handler, p_this->i_object_id, 
     
    177176    if( !p_handler ) return VLC_ENOMEM; 
    178177    vlc_mutex_lock( &p_handler->object_lock ); 
    179  
    180178 
    181179    /* Look for existing element */ 
     
    292290    stats_GetInteger( p_input, p_input->i_object_id, "decoded_audio", 
    293291                      &p_stats->i_decoded_audio ); 
     292 
     293    /* Aout - We store in p_input because aout is shared */ 
     294    stats_GetInteger( p_input, p_input->i_object_id, "played_abuffers", 
     295                      &p_stats->i_played_abuffers ); 
     296    stats_GetInteger( p_input, p_input->i_object_id, "lost_abuffers", 
     297                      &p_stats->i_lost_abuffers ); 
    294298 
    295299    /* Vouts */ 
     
    312316        vlc_list_release( p_list ); 
    313317    } 
     318 
    314319    vlc_mutex_unlock( &p_stats->lock ); 
    315320} 
     
    322327    p_stats->f_demux_bitrate = p_stats->f_average_demux_bitrate = 
    323328    p_stats->i_displayed_pictures = p_stats->i_lost_pictures = 
     329    p_stats->i_played_abuffers = p_stats->i_lost_abuffers = 
    324330    p_stats->i_decoded_video = p_stats->i_decoded_audio = 0; 
    325331} 
     
    330336    /* f_bitrate is in bytes / microsecond 
    331337     * *1000 => bytes / millisecond => kbytes / seconds */ 
    332     fprintf( stderr, "Input : %i (%i bytes) - %f kB/s -
    333                      "Demux : %i (%i bytes) - %f kB/s - Vout : %i/%i\n", 
     338    fprintf( stderr, "Input : %i (%i bytes) - %f kB/s - Demux : %i (%i bytes) - %f kB/s\n
     339                     " - Vout : %i/%i - Aout : %i/%i\n", 
    334340                    p_stats->i_read_packets, p_stats->i_read_bytes, 
    335341                    p_stats->f_input_bitrate * 1000, 
    336342                    p_stats->i_demux_read_packets, p_stats->i_demux_read_bytes, 
    337343                    p_stats->f_demux_bitrate * 1000, 
    338                     p_stats->i_displayed_pictures, p_stats->i_lost_pictures ); 
     344                    p_stats->i_displayed_pictures, p_stats->i_lost_pictures, 
     345                    p_stats->i_played_abuffers, p_stats->i_lost_abuffers ); 
    339346    vlc_mutex_unlock( &p_stats->lock ); 
    340347} 
     
    478485{ 
    479486    int i; 
    480     for( i = 0; i< p_handler->i_counters; i++ ) 
     487   for( i = 0; i< p_handler->i_counters; i++ ) 
    481488    { 
    482489        counter_t *p_counter = p_handler->pp_counters[i]; 
  • src/playlist/playlist.c

    r31e0a13 r5bd61a8  
    626626                stats_ComputeInputStats( p_playlist->p_input, 
    627627                                  p_playlist->p_input->input.p_item->p_stats ); 
    628 //               stats_DumpInputStats( 
     628//                stats_DumpInputStats( 
    629629//                            p_playlist->p_input->input.p_item->p_stats ); 
    630630            }