]> git.sesse.net Git - vlc/commitdiff
. vir� les aliases � xvlc �, � ggivlc � etc. qui faisaient un peu
authorSam Hocevar <sam@videolan.org>
Tue, 8 Aug 2000 22:51:04 +0000 (22:51 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 8 Aug 2000 22:51:04 +0000 (22:51 +0000)
  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.

ChangeLog
configure
configure.in
debian/vlc.1
include/config.h.in
include/vpar_synchro.h
src/interface/main.c
src/video_output/video_output.c
src/video_parser/video_parser.c
src/video_parser/vpar_synchro.c

index 683593cfa20c8a226c1fb20ddc08c0ca12dae816..92935b2986a1190c880f845b1eb5f7da4a3bdc3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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 :
 
index cb548f516aa39fa466034aefd275af812b35d92f..8ee6c6937f8052f3b76cdb80ed9fc915a9b3a84f 100755 (executable)
--- a/configure
+++ b/configure
@@ -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}
 "
+
index d8a2247e05efac02fce712b3229543339000f396..21da809e395ffc119ee4413ebce37623a297c422 100644 (file)
@@ -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}
 "
+
index cf928519b1e3a67d8563ce714b10888d7c49dab6..b122a130006c95d3462eb282e38f50eb223c2b35 100644 (file)
@@ -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)
index cdeeadfecee8ec30177c076d5292436cf5440cd8..17ed0cc8790a980822ff0bd8581f1472b8b1a21d 100644 (file)
 /* Maximum number of macroblocks in a picture. */
 #define MAX_MB                          2048
 
+/* The synchro variable name */
+#define VPAR_SYNCHRO_VAR                "vlc_synchro"
+
 /*****************************************************************************
  * Video decoder configuration
  *****************************************************************************/
index 151531053cdd2a376f86f3cfd5d84debbe7fffab..53fead85865a67ac587f5fe8fdacecbe2c659504 100644 (file)
@@ -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
index e8dacdebb9ee246363561ad102aac7ca45313b71..6ab90ca77af9225152502b31f79ff2f58c1baff9 100644 (file)
@@ -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");
 }
 
 /*****************************************************************************
index 49415559730dd030cc6437cbc2201371b4942101..c1a1156b6c400e0219fc7e78b77917491b4419ae 100644 (file)
@@ -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 );
index aaa559d31bdd2c0c8c85ca1f4edb52877047fdc5..4515a78e4397e0c996c31a20ea87561b978fe5f7 100644 (file)
@@ -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;
+
+}
+
index 49f8849b11381e4ce05e575acc648be28fd772de..998ee3f51c76ceca7bbaf010658e9b17856f1a69 100644 (file)
@@ -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 );
     }