Changeset fc3815a7114f9fef7eb47e38903f33bfb10597b7
- Timestamp:
- 03/16/08 03:47:07 (6 months ago)
- git-parent:
- Files:
-
- modules/gui/ncurses.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/gui/ncurses.c
r6cf973e rfc3815a 52 52 #include <vlc_charset.h> 53 53 #include <vlc_input.h> 54 #include <vlc_es.h> 54 55 #include <vlc_playlist.h> 55 56 #include <vlc_meta.h> … … 2002 2003 vlc_mutex_lock( &p_item->p_stats->lock ); 2003 2004 2005 int i_audio = 0; 2006 int i_video = 0; 2007 int i; 2008 2009 if( !p_item->i_es ) 2010 i_video = i_audio = 1; 2011 else 2012 for( i = 0; i < p_item->i_es ; i++ ) 2013 { 2014 printf( "XXX %d\n", p_item->es[i]->i_cat ); 2015 i_audio += ( p_item->es[i]->i_cat == AUDIO_ES ); 2016 i_video += ( p_item->es[i]->i_cat == VIDEO_ES ); 2017 } 2018 2019 int l = 0; 2020 2021 #define SHOW_ACS(x,c) \ 2022 if(l >= p_sys->i_box_start && l - p_sys->i_box_start < p_sys->i_box_lines) \ 2023 mvaddch( p_sys->i_box_y - p_sys->i_box_start + l, x, c ) 2024 2004 2025 /* Input */ 2005 2026 if( p_sys->b_color ) wcolor_set( p_sys->w, C_CATEGORY, NULL ); 2006 mvnprintw( y++, 1, COLS-2, _("+-[Incoming]")); 2027 MainBoxWrite( p_intf, l, 1, _("+-[Incoming]")); 2028 SHOW_ACS( 1, ACS_ULCORNER ); SHOW_ACS( 2, ACS_HLINE ); l++; 2007 2029 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL ); 2008 mvnprintw( y++, 1, COLS-2, _("| input bytes read : %8.0f kB"),2030 MainBoxWrite( p_intf, l, 1, _("| input bytes read : %8.0f kB"), 2009 2031 (float)(p_item->p_stats->i_read_bytes)/1000 ); 2010 mvnprintw( y++, 1, COLS-2, _("| input bitrate : %6.0f kb/s"), 2032 SHOW_ACS( 1, ACS_VLINE ); l++; 2033 MainBoxWrite( p_intf, l, 1, _("| input bitrate : %6.0f kb/s"), 2011 2034 (float)(p_item->p_stats->f_input_bitrate)*8000 ); 2012 mvnprintw( y++, 1, COLS-2,_("| demux bytes read : %8.0f kB"),2035 MainBoxWrite( p_intf, l, 1, _("| demux bytes read : %8.0f kB"), 2013 2036 (float)(p_item->p_stats->i_demux_read_bytes)/1000 ); 2014 mvnprintw( y++, 1, COLS-2,_("| demux bitrate : %6.0f kb/s"), 2037 SHOW_ACS( 1, ACS_VLINE ); l++; 2038 MainBoxWrite( p_intf, l, 1, _("| demux bitrate : %6.0f kb/s"), 2015 2039 (float)(p_item->p_stats->f_demux_bitrate)*8000 ); 2016 mvnprintw( y++, 1, COLS-2,"|"); 2040 SHOW_ACS( 1, ACS_VLINE ); l++; SHOW_ACS( 1, ACS_VLINE ); l++; 2041 2017 2042 /* Video */ 2018 if( p_sys->b_color ) wcolor_set( p_sys->w, C_CATEGORY, NULL ); 2019 mvnprintw( y++, 1, COLS-2,_("+-[Video Decoding]")); 2020 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL ); 2021 mvnprintw( y++, 1, COLS-2,_("| video decoded : %5i"), 2022 p_item->p_stats->i_decoded_video ); 2023 mvnprintw( y++, 1, COLS-2,_("| frames displayed : %5i"), 2024 p_item->p_stats->i_displayed_pictures ); 2025 mvnprintw( y++, 1, COLS-2,_("| frames lost : %5i"), 2026 p_item->p_stats->i_lost_pictures ); 2027 mvnprintw( y++, 1, COLS-2,"|"); 2043 if( i_video ) 2044 { 2045 if( p_sys->b_color ) wcolor_set( p_sys->w, C_CATEGORY, NULL ); 2046 MainBoxWrite( p_intf, l, 1, _("+-[Video Decoding]")); 2047 SHOW_ACS( 1, ACS_LTEE ); SHOW_ACS( 2, ACS_HLINE ); l++; 2048 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL ); 2049 MainBoxWrite( p_intf, l, 1, _("| video decoded : %5i"), 2050 p_item->p_stats->i_decoded_video ); 2051 SHOW_ACS( 1, ACS_VLINE ); l++; 2052 MainBoxWrite( p_intf, l, 1, _("| frames displayed : %5i"), 2053 p_item->p_stats->i_displayed_pictures ); 2054 SHOW_ACS( 1, ACS_VLINE ); l++; 2055 MainBoxWrite( p_intf, l, 1, _("| frames lost : %5i"), 2056 p_item->p_stats->i_lost_pictures ); 2057 SHOW_ACS( 1, ACS_VLINE ); l++; SHOW_ACS( 1, ACS_VLINE ); l++; 2058 } 2028 2059 /* Audio*/ 2029 if( p_sys->b_color ) wcolor_set( p_sys->w, C_CATEGORY, NULL ); 2030 mvnprintw( y++, 1, COLS-2,_("+-[Audio Decoding]")); 2031 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL ); 2032 mvnprintw( y++, 1, COLS-2,_("| audio decoded : %5i"), 2033 p_item->p_stats->i_decoded_audio ); 2034 mvnprintw( y++, 1, COLS-2,_("| buffers played : %5i"), 2035 p_item->p_stats->i_played_abuffers ); 2036 mvnprintw( y++, 1, COLS-2,_("| buffers lost : %5i"), 2037 p_item->p_stats->i_lost_abuffers ); 2038 mvnprintw( y++, 1, COLS-2,"|"); 2060 if( i_audio ) 2061 { 2062 if( p_sys->b_color ) wcolor_set( p_sys->w, C_CATEGORY, NULL ); 2063 MainBoxWrite( p_intf, l, 1, _("+-[Audio Decoding]")); 2064 SHOW_ACS( 1, ACS_LTEE ); SHOW_ACS( 2, ACS_HLINE ); l++; 2065 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL ); 2066 MainBoxWrite( p_intf, l, 1, _("| audio decoded : %5i"), 2067 p_item->p_stats->i_decoded_audio ); 2068 SHOW_ACS( 1, ACS_VLINE ); l++; 2069 MainBoxWrite( p_intf, l, 1, _("| buffers played : %5i"), 2070 p_item->p_stats->i_played_abuffers ); 2071 SHOW_ACS( 1, ACS_VLINE ); l++; 2072 MainBoxWrite( p_intf, l, 1, _("| buffers lost : %5i"), 2073 p_item->p_stats->i_lost_abuffers ); 2074 SHOW_ACS( 1, ACS_VLINE ); l++; SHOW_ACS( 1, ACS_VLINE ); l++; 2075 } 2039 2076 /* Sout */ 2040 2077 if( p_sys->b_color ) wcolor_set( p_sys->w, C_CATEGORY, NULL ); 2041 mvnprintw( y++, 1, COLS-2,_("+-[Streaming]")); 2078 MainBoxWrite( p_intf, l, 1, _("+-[Streaming]")); 2079 SHOW_ACS( 1, ACS_LTEE ); SHOW_ACS( 2, ACS_HLINE ); l++; 2042 2080 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL ); 2043 mvnprintw( y++, 1, COLS-2,_("| packets sent : %5i"), p_item->p_stats->i_sent_packets ); 2044 mvnprintw( y++, 1, COLS-2,_("| bytes sent : %8.0f kB"), 2081 MainBoxWrite( p_intf, l, 1, _("| packets sent : %5i"), p_item->p_stats->i_sent_packets ); 2082 SHOW_ACS( 1, ACS_VLINE ); l++; 2083 MainBoxWrite( p_intf, l, 1, _("| bytes sent : %8.0f kB"), 2045 2084 (float)(p_item->p_stats->i_sent_bytes)/1000 ); 2046 mvnprintw( y++, 1, COLS-2,_("| sending bitrate : %6.0f kb/s"), 2085 SHOW_ACS( 1, ACS_VLINE ); l++; 2086 MainBoxWrite( p_intf, l, 1, _("\\ sending bitrate : %6.0f kb/s"), 2047 2087 (float)(p_item->p_stats->f_send_bitrate*8)*1000 ); 2088 SHOW_ACS( 1, ACS_LLCORNER ); l++; 2048 2089 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL ); 2090 2091 #undef SHOW_ACS 2092 2093 p_sys->i_box_lines_total = l; 2094 if( p_sys->i_box_start >= p_sys->i_box_lines_total ) 2095 p_sys->i_box_start = p_sys->i_box_lines_total - 1; 2096 2097 if( l - p_sys->i_box_start < p_sys->i_box_lines ) 2098 y += l - p_sys->i_box_start; 2099 else 2100 y += p_sys->i_box_lines; 2049 2101 2050 2102 vlc_mutex_unlock( &p_item->p_stats->lock ); 2051 2103 vlc_mutex_unlock( &p_item->lock ); 2104 2052 2105 } 2053 2106 }
