Commit 57947f96 authored by Sam Hocevar's avatar Sam Hocevar

. vir� les aliases � xvlc �, � ggivlc � etc. qui faisaient un peu

  piti�, pour ne laisser que � vlc �, � gvlc � (gnome) et � fbvlc �
  (framebuffer) ; les autres restent bien entendu accessibles avec
  par exemple � vlc --vout ggi �.

 . IMPORTANT - nouvelle option --synchro pour forcer un type de
  synchro. Pour le moment les options possibles sont :

    --synchro I     /* n'affiche que les I */
    --synchro IP    /* affiche les I et toutes les P */
    --synchro IP+   /* affiche les I, les P, et la moiti� des B */
    --synchro IPB   /* affiche toutes les images */

   Toute autre valeur de --synchro sera ignor�e et c'est l'algo
  par d�faut bas� sur la consommation de processeur qui sera
  utilis�. Notez que si vous en demandez trop au vlc, il va
  bien entendu planter, ou tout du moins remplir sa fifo comme
  un gros cochon. On n'y peut pas grand chose, c'est la vie.
parent 9667c930
0.1.99g :
* removed all "*vlc" aliases except "gvlc" and "fbvlc". The other sucked.
* new --synchro flag which lets you force which images are decoded.
Tue Aug 8 11:24:01 CEST 2000
0.1.99f :
......
......@@ -3094,13 +3094,13 @@ fi
# Check whether --enable-ggi or --disable-ggi was given.
if test "${enable_ggi+set}" = set; then
enableval="$enable_ggi"
if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; ALIASES=${ALIASES}"ggivlc "; fi
if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; fi
fi
# Check whether --enable-glide or --disable-glide was given.
if test "${enable_glide+set}" = set; then
enableval="$enable_glide"
if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; ALIASES=${ALIASES}"glidevlc "; fi
if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; fi
fi
# Check whether --enable-gnome or --disable-gnome was given.
......@@ -3115,7 +3115,7 @@ if test "${enable_x11+set}" = set; then
:
fi
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; ALIASES=${ALIASES}"xvlc "; fi
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
fi
......@@ -3504,3 +3504,4 @@ architecture : ${ARCH}
plugins : ${PLUGINS}
vlc aliases : ${ALIASES}
"
......@@ -92,16 +92,16 @@ AC_ARG_ENABLE(fb,
[if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; ALIASES=${ALIASES}"fbvlc "; fi])
AC_ARG_ENABLE(ggi,
[ --enable-ggi GGI support (default disabled)],
[if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; ALIASES=${ALIASES}"ggivlc "; fi])
[if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; fi])
AC_ARG_ENABLE(glide,
[ --enable-glide Glide (3dfx) support (default disabled)],
[if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; ALIASES=${ALIASES}"glidevlc "; fi])
[if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; fi])
AC_ARG_ENABLE(gnome,
[ --enable-gnome Gnome support (default disabled)],
[if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
AC_ARG_ENABLE(x11,
[ --enable-x11 X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; ALIASES=${ALIASES}"xvlc "; fi
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
fi
......@@ -121,3 +121,4 @@ architecture : ${ARCH}
plugins : ${PLUGINS}
vlc aliases : ${ALIASES}
"
......@@ -81,6 +81,17 @@ Disable VLANs support.
.B \-\-server <host>, \-\-port <port>
Choose the video server address and port.
.TP
.B \-\-synchro <type>
Choose a fixed synchro value instead of the internal auto-adaptative
heuristics based on CPU usage.
`I' displays only I images, `IP' displays I and P images, `IP+'
displays I and P images and every second B image, and `IPB' forces
displaying of all images.
Note that the vlc is certainly going to crash if you ask it to
display more images than your CPU can cope with.
.TP
.B \-h, \-\-help
Print help and exit.
.TP
......@@ -122,6 +133,9 @@ also accepts a lot of parameters to customize its behaviour.
vlc_iface=<interface> network interface
vlc_vlan_server=<host> vlan server
vlc_vlan_port=<port> vlan server port
.TP
.B Synchro parameters:
vlc_synchro=<type> synchro algorithm
.SH SEE ALSO
.BR vls (1), vlms (1)
......
......@@ -372,6 +372,9 @@
/* Maximum number of macroblocks in a picture. */
#define MAX_MB 2048
/* The synchro variable name */
#define VPAR_SYNCHRO_VAR "vlc_synchro"
/*****************************************************************************
* Video decoder configuration
*****************************************************************************/
......
......@@ -43,6 +43,9 @@
#ifdef SAM_SYNCHRO
typedef struct video_synchro_s
{
/* synchro algorithm */
int i_type;
/* fifo containing decoding dates */
mtime_t i_date_fifo[16];
unsigned int i_start;
......@@ -70,12 +73,19 @@ typedef struct video_synchro_s
int displayable_p;
boolean_t b_all_B;
int displayable_b;
boolean_t b_dropped_last_B;
} video_synchro_t;
#define FIFO_INCREMENT( i_counter ) \
p_vpar->synchro.i_counter = (p_vpar->synchro.i_counter + 1) & 0xf;
#define VPAR_SYNCHRO_DEFAULT 0
#define VPAR_SYNCHRO_I 1
#define VPAR_SYNCHRO_IP 2
#define VPAR_SYNCHRO_IPplus 3
#define VPAR_SYNCHRO_IPB 4
#endif
#ifdef MEUUH_SYNCHRO
......
......@@ -80,6 +80,8 @@
#define OPT_SERVER 171
#define OPT_PORT 172
#define OPT_SYNCHRO 180
/* Usage fashion */
#define USAGE 0
#define SHORT_HELP 1
......@@ -121,6 +123,9 @@ static const struct option longopts[] =
{ "server", 1, 0, OPT_SERVER },
{ "port", 1, 0, OPT_PORT },
/* Synchro options */
{ "synchro", 1, 0, OPT_SYNCHRO },
{ 0, 0, 0, 0 }
};
......@@ -433,7 +438,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
intf_MsgImm( COPYRIGHT_MESSAGE "\n" );
/* Get the executable name */
/* Get the executable name (similar to the basename command) */
p_main->psz_arg0 = p_pointer = ppsz_argv[ 0 ];
while( *p_pointer )
{
......@@ -537,6 +542,11 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutPszVariable( INPUT_PORT_VAR, optarg );
break;
/* Synchro options */
case OPT_SYNCHRO:
main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg );
break;
/* Internal error: unknown option */
case '?':
default:
......@@ -587,14 +597,16 @@ static void Usage( int i_fashion )
" -g, --grayscale \tgrayscale output\n"
" --color \tcolor output\n"
"\n"
" -a, --dvdaudio \tchoose DVD audio type\n"
" -c, --dvdchannel \tchoose DVD audio channel\n"
" -s, --dvdsubtitle \tchoose DVD subtitle channel\n"
" -a, --dvdaudio <type> \tchoose DVD audio type\n"
" -c, --dvdchannel <channel> \tchoose DVD audio channel\n"
" -s, --dvdsubtitle <channel> \tchoose DVD subtitle channel\n"
"\n"
" --novlans \tdisable vlans\n"
" --server <host> \tvideo server address\n"
" --port <port> \tvideo server port\n"
"\n"
" --synchro <type> \tforce synchro algorithm\n"
"\n"
" -h, --help \tprint help and exit\n"
" -H, --longhelp \tprint long help and exit\n"
" -v, --version \toutput version information and exit\n" );
......@@ -605,7 +617,7 @@ static void Usage( int i_fashion )
/* Interface parameters */
intf_Msg( "\n"
"Interface parameters:\n"
" " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script\n"
" " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script\n"
" " INTF_CHANNELS_VAR "=<filename> \tchannels list\n" );
/* Audio parameters */
......@@ -641,6 +653,11 @@ static void Usage( int i_fashion )
" " INPUT_IFACE_VAR "=<interface> \tnetwork interface\n"
" " INPUT_VLAN_SERVER_VAR "=<hostname> \tvlan server\n"
" " INPUT_VLAN_PORT_VAR "=<port> \tvlan server port\n" );
/* Synchro parameters */
intf_Msg( "\n"
"Synchro parameters:\n"
" " VPAR_SYNCHRO_VAR "={I|IP|IP+|IPB} \tsynchro algorithm\n");
}
/*****************************************************************************
......
......@@ -1691,7 +1691,7 @@ static void RenderPictureInfo( vout_thread_t *p_vout, picture_t *p_pic )
*/
if( p_vout->c_fps_samples > VOUT_FPS_SAMPLES )
{
sprintf( psz_buffer, "%.2f fps/10", VOUT_FPS_SAMPLES * 1000000 * 10 /
sprintf( psz_buffer, "%lli fps/10", VOUT_FPS_SAMPLES * 1000000 * 10 /
( p_vout->p_fps_sample[ (p_vout->c_fps_samples - 1) % VOUT_FPS_SAMPLES ] -
p_vout->p_fps_sample[ p_vout->c_fps_samples % VOUT_FPS_SAMPLES ] ) );
Print( p_vout, 0, 0, RIGHT_RALIGN, TOP_RALIGN, psz_buffer );
......
......@@ -65,6 +65,7 @@ static int InitThread ( vpar_thread_t *p_vpar );
static void RunThread ( vpar_thread_t *p_vpar );
static void ErrorThread ( vpar_thread_t *p_vpar );
static void EndThread ( vpar_thread_t *p_vpar );
static int SynchroType ( );
/*****************************************************************************
* vpar_CreateThread: create a generic parser thread
......@@ -272,11 +273,14 @@ static int InitThread( vpar_thread_t *p_vpar )
vpar_InitBMBType( p_vpar );
vpar_InitDCTTables( p_vpar );
/*
* Initialize the synchro properties
*/
#ifdef SAM_SYNCHRO
/* Get an possible synchro algorithm */
p_vpar->synchro.i_type = SynchroType();
/* last seen PTS */
p_vpar->synchro.i_last_pts = 0;
/* for i frames */
......@@ -296,6 +300,7 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->synchro.displayable_p = 2 << 10;
p_vpar->synchro.b_all_B = 0;
p_vpar->synchro.displayable_b = 0;
p_vpar->synchro.b_dropped_last_B = 0;
/* assume there were about 3 P and 6 B images between I's */
p_vpar->synchro.i_P_seen = p_vpar->synchro.i_P_kept = 1 << 10;
p_vpar->synchro.i_B_seen = p_vpar->synchro.i_B_kept = 1 << 10;
......@@ -470,3 +475,57 @@ static void EndThread( vpar_thread_t *p_vpar )
intf_DbgMsg("vpar debug: EndThread(%p)\n", p_vpar);
}
/*****************************************************************************
* SynchroType: Get the user's synchro type
*****************************************************************************
* This function is called at initialization.
*****************************************************************************/
static int SynchroType( )
{
char * psz_synchro = main_GetPszVariable( VPAR_SYNCHRO_VAR, NULL );
if( psz_synchro == NULL )
{
return VPAR_SYNCHRO_DEFAULT;
}
switch( *psz_synchro++ )
{
case 'i':
case 'I':
switch( *psz_synchro++ )
{
case '\0':
return VPAR_SYNCHRO_I;
case 'p':
case 'P':
switch( *psz_synchro++ )
{
case '\0':
return VPAR_SYNCHRO_IP;
case '+':
if( *psz_synchro ) return 0;
return VPAR_SYNCHRO_IPplus;
case 'b':
case 'B':
if( *psz_synchro ) return 0;
return VPAR_SYNCHRO_IPB;
default:
return VPAR_SYNCHRO_DEFAULT;
}
default:
return VPAR_SYNCHRO_DEFAULT;
}
}
return VPAR_SYNCHRO_DEFAULT;
}
......@@ -203,52 +203,81 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
{
case I_CODING_TYPE:
//intf_ErrMsg( " I %f %f\nI ", 1000000.0 / p_vpar->synchro.i_theorical_delay, 1000000.0 / p_vpar->synchro.i_delay );
if( p_vpar->synchro.i_type != VPAR_SYNCHRO_DEFAULT )
{
/* I, IP, IP+, IPB */
return( 1 );
}
return( p_vpar->synchro.b_all_I );
case P_CODING_TYPE:
//return(1);
if( p_vpar->synchro.i_type == VPAR_SYNCHRO_I ) /* I */
{
return( 0 );
}
if( p_vpar->synchro.i_type >= VPAR_SYNCHRO_IP ) /* IP, IP+, IPB */
{
return( 1 );
}
if( p_vpar->synchro.b_all_P )
{
//intf_ErrMsg( " p " );
return( 1 );
}
if( p_vpar->synchro.displayable_p * i_delay
< p_vpar->synchro.i_delay )
{
//intf_ErrMsg( " - " );
return( 0 );
}
p_vpar->synchro.displayable_p--;
//intf_ErrMsg( " p> " );
p_vpar->synchro.displayable_p -= 1024;
return( 1 );
case B_CODING_TYPE:
if( p_vpar->synchro.i_type != VPAR_SYNCHRO_DEFAULT )
{
if( p_vpar->synchro.i_type <= VPAR_SYNCHRO_IP ) /* I, IP */
{
return( 0 );
}
else if( p_vpar->synchro.i_type == VPAR_SYNCHRO_IPB ) /* IPB */
{
return( 1 );
}
if( p_vpar->synchro.b_dropped_last_B ) /* IP+ */
{
p_vpar->synchro.b_dropped_last_B = 0;
return( 1 );
}
p_vpar->synchro.b_dropped_last_B = 1;
return( 0 );
}
if( p_vpar->synchro.b_all_B )
{
//intf_ErrMsg( "b " );
return( 1 );
}
if( p_vpar->synchro.displayable_b <= 0 )
{
//intf_ErrMsg( " " );
return( 0 );
}
if( i_delay < 0 )
{
//intf_ErrMsg( " " );
p_vpar->synchro.displayable_b -= 0.5;
p_vpar->synchro.displayable_b -= 512;
return( 0 );
}
//intf_ErrMsg( "b " );
p_vpar->synchro.displayable_b--;
p_vpar->synchro.displayable_b -= 1024;
return( 1 );
}
......
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