]> git.sesse.net Git - vlc/commitdiff
* Fixed detection of the esd plugin.
authorSam Hocevar <sam@videolan.org>
Mon, 31 Dec 2001 04:53:33 +0000 (04:53 +0000)
committerSam Hocevar <sam@videolan.org>
Mon, 31 Dec 2001 04:53:33 +0000 (04:53 +0000)
  * Fixed the ts plugin's input type detection.
  * Fixed the BadCursor error in the x11 and xvideo plugins. For real this
    time (unlike my 2001/08/03 fix :p).
  * Made the wall filter work a bit better. It now spawns a 3x2 mosaic,
    but this will eventually be configurable, � la `--filter wall:3x3'.

include/video.h
plugins/ac3_adec/ac3_adec.c
plugins/chroma/yv12_rgb16.c
plugins/esd/esd.c
plugins/filter/wall.c
plugins/mpeg_system/input_ts.c
plugins/mpeg_system/mpeg_ts.c
plugins/x11/xcommon.c
src/video_output/video_output.c

index 38e1c2ca8396dc90638c81462ee18070b5b742e3..a4c686aa05d6270097c52023b92ad622ee3c0c83 100644 (file)
@@ -4,7 +4,7 @@
  * includes all common video types and constants.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video.h,v 1.36 2001/12/30 07:09:54 sam Exp $
+ * $Id: video.h,v 1.37 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -30,9 +30,17 @@ typedef u8 pixel_data_t;
 
 typedef struct plane_s
 {
-    pixel_data_t *p_data;
-    int           i_bytes;
-    int           i_line_bytes;
+    pixel_data_t *p_data;                       /* Start of the plane's data */
+
+    /* Variables used for fast memcpy operations */
+    int i_bytes;                       /* Total number of bytes in the plane */
+    int i_line_bytes;                     /* Total number of bytes in a line */
+
+    /* Variables used for RGB planes */
+    int i_red_mask;
+    int i_green_mask;
+    int i_blue_mask;
+
 } plane_t;
 
 /*****************************************************************************
index 27e27854d014b834a51759a33aaf284a725a241e..1e52142e464527770090c3a3b8d46c7013fbb7eb 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_adec.c: ac3 decoder module main file
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_adec.c,v 1.11 2001/12/30 07:09:54 sam Exp $
+ * $Id: ac3_adec.c,v 1.12 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Michel Lespinasse <walken@zoy.org>
  *
@@ -312,17 +312,9 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
     intf_DbgMsg ( "ac3_adec debug: ac3_adec thread (%p) initialized", 
                   p_ac3thread );
 
-    /*
-     * Bit stream
-     */
-    p_ac3thread->p_config->pf_init_bit_stream(
-            &p_ac3thread->ac3_decoder->bit_stream,
-            p_ac3thread->p_config->p_decoder_fifo,
-            BitstreamCallback, (void *) p_ac3thread );
-    
     /* Creating the audio output fifo */
     p_ac3thread->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
-                                               AC3DEC_FRAME_SIZE, NULL  );
+                                                AC3DEC_FRAME_SIZE, NULL  );
     if ( p_ac3thread->p_aout_fifo == NULL )
     {
         free( IMDCT->w_1 );
@@ -357,6 +349,14 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
         return( -1 );
     }
 
+    /*
+     * Bit stream
+     */
+    p_ac3thread->p_config->pf_init_bit_stream(
+            &p_ac3thread->ac3_decoder->bit_stream,
+            p_ac3thread->p_config->p_decoder_fifo,
+            BitstreamCallback, (void *) p_ac3thread );
+    
     intf_DbgMsg("ac3dec debug: ac3 decoder thread %p initialized", p_ac3thread);
     
     return( 0 );
index e6a06e09e0d6ad43c188f6555890be2288ae4d9b..a8763f386f8e70a765f1029a00b06a4798ee0ec1 100644 (file)
@@ -2,7 +2,7 @@
  * yv12_rgb16.c : YUV to paletted RGB16 conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: yv12_rgb16.c,v 1.1 2001/12/30 07:09:54 sam Exp $
+ * $Id: yv12_rgb16.c,v 1.2 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -182,28 +182,33 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source,
         int i_dst = p_dest->planes[ RGB_PLANE ].i_line_bytes / 2;
 
         /* Masks: 0xf800 0x07e0 0x001f */
-#define RED ((u16*)p_out)[i_dst--] = (u16)(p_in[i_src--]>>3) << 11;
-#define GREEN ((u16*)p_out)[i_dst--] = (u16)(p_in[i_src--]>>2) << 5;
-#define BLUE ((u16*)p_out)[i_dst--] = (u16)(p_in[i_src--]>>3) << 0;
-#define WHITE ((u16*)p_out)[i_dst--] = ((u16)(p_in[i_src]>>3) << 11) | ((u16)(p_in[i_src]>>2) << 5) | ((u16)(p_in[i_src]>>3) << 0); i_src--;
-#define BLACK ((u16*)p_out)[i_dst--] = 0; i_src--;
+#define RED ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>3) << 11;
+#define GREEN ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>2) << 5;
+#define BLUE ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>3) << 0;
+#define WHITE ((u16*)p_out)[--i_dst] = ((u16)(p_in[i_src]>>3) << 11) | ((u16)(p_in[i_src]>>2) << 5) | ((u16)(p_in[i_src]>>3) << 0); --i_src;
+#define BLACK ((u16*)p_out)[--i_dst] = 0; --i_src;
         
         while( i_src && i_dst )
         {
-            BLACK; BLUE; GREEN; RED; GREEN; BLUE; WHITE; RED;
-            GREEN; BLUE; WHITE; RED; BLACK; BLUE; GREEN; RED;
+            WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE;
+            //BLACK; BLUE; GREEN; RED; GREEN; BLUE; WHITE; RED;
         }
 
         p_in += p_source->planes[ Y_PLANE ].i_line_bytes;
         p_out += p_dest->planes[ RGB_PLANE ].i_line_bytes;
 
+        if( p_in >= p_in_end || p_out >= p_out_end )
+        {
+            break;
+        }
+
         i_src = p_source->planes[ Y_PLANE ].i_line_bytes;
         i_dst = p_dest->planes[ RGB_PLANE ].i_line_bytes / 2;
 
         while( i_src && i_dst )
         {
-            GREEN; RED; WHITE; BLUE; BLACK; RED; GREEN; BLUE;
-            BLACK; RED; GREEN; BLUE; GREEN; RED; WHITE; BLUE;
+            WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE;
+            //GREEN; RED; WHITE; BLUE; BLACK; RED; GREEN; BLUE;
         }
 
         p_in += p_source->planes[ Y_PLANE ].i_line_bytes;
index e56e78492b0344bb91983ba176c7c9041f40df06..6b13adfe026312c2d596126b8761f30fc3922594 100644 (file)
@@ -2,7 +2,7 @@
  * esd.c : EsounD module
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: esd.c,v 1.11 2001/12/30 07:09:55 sam Exp $
+ * $Id: esd.c,v 1.12 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -46,6 +46,8 @@ MODULE_CONFIG_STOP
 MODULE_INIT_START
     SET_DESCRIPTION( "EsounD audio module" )
     ADD_CAPABILITY( AOUT, 50 )
+    ADD_SHORTCUT( "esd" )
+    ADD_SHORTCUT( "esound" )
 MODULE_INIT_STOP
 
 MODULE_ACTIVATE_START
index 7021c772709005e2337c342696e14272f64adaeb..eef1811a2ad3aed7edc7b2b4152f0b61a782de57 100644 (file)
@@ -2,7 +2,7 @@
  * wall.c : Wall video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: wall.c,v 1.3 2001/12/30 07:09:55 sam Exp $
+ * $Id: wall.c,v 1.4 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -72,7 +72,12 @@ typedef struct vout_sys_s
     int    i_col;
     int    i_row;
     int    i_vout;
-    struct vout_thread_s **pp_vout;
+    struct vout_list_s
+    {
+        int i_width;
+        int i_height;
+        struct vout_thread_s *p_vout;
+    } *pp_vout;
 
 } vout_sys_t;
 
@@ -128,12 +133,12 @@ static int vout_Create( vout_thread_t *p_vout )
         return( 1 );
     }
 
-    p_vout->p_sys->i_col = 2;
-    p_vout->p_sys->i_row = 3;
+    p_vout->p_sys->i_col = 3;
+    p_vout->p_sys->i_row = 2;
 
     p_vout->p_sys->pp_vout = malloc( p_vout->p_sys->i_row *
                                      p_vout->p_sys->i_col *
-                                     sizeof(vout_thread_t*) );
+                                     sizeof(struct vout_list_s) );
     if( p_vout->p_sys->pp_vout == NULL )
     {
         intf_ErrMsg("error: %s", strerror(ENOMEM) );
@@ -150,7 +155,7 @@ static int vout_Create( vout_thread_t *p_vout )
  *****************************************************************************/
 static int vout_Init( vout_thread_t *p_vout )
 {
-    int i_index;
+    int i_index, i_row, i_col, i_width, i_height;
     char *psz_filter;
     picture_t *p_pic;
     
@@ -177,23 +182,50 @@ static int vout_Init( vout_thread_t *p_vout )
 
     intf_WarnMsg( 1, "filter: spawning the real video outputs" );
 
-    for( p_vout->p_sys->i_vout = 0;
-         p_vout->p_sys->i_vout < p_vout->p_sys->i_row * p_vout->p_sys->i_col;
-         p_vout->p_sys->i_vout++ )
+    p_vout->p_sys->i_vout = 0;
+
+    for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
     {
-        p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ] =
-            vout_CreateThread( NULL,
-                p_vout->render.i_width / p_vout->p_sys->i_col,
-                p_vout->render.i_height / p_vout->p_sys->i_row,
-                p_vout->render.i_chroma,
-                p_vout->render.i_aspect * p_vout->p_sys->i_row
-                                        / p_vout->p_sys->i_col );
-        if( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ] == NULL )
+        for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
         {
-             intf_ErrMsg( "vout error: failed to get %ix%i vout threads",
-                          p_vout->p_sys->i_col, p_vout->p_sys->i_row );
-             RemoveAllVout( p_vout );
-             return 0;
+            if( i_col + 1 < p_vout->p_sys->i_col )
+            {
+                i_width = ( p_vout->render.i_width
+                             / p_vout->p_sys->i_col ) & ~0xf;
+            }
+            else
+            {
+                i_width = p_vout->render.i_width
+                           - ( ( p_vout->render.i_width
+                                  / p_vout->p_sys->i_col ) & ~0xf ) * i_col;
+            }
+
+            if( i_row + 1 < p_vout->p_sys->i_row )
+            {
+                i_height = p_vout->render.i_height / p_vout->p_sys->i_row;
+            }
+            else
+            {
+                i_height = p_vout->render.i_height
+                            - p_vout->render.i_height
+                               / p_vout->p_sys->i_row * i_row;
+            }
+
+            p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout =
+                vout_CreateThread( NULL, i_width, i_height,
+                                   p_vout->render.i_chroma,
+                                   p_vout->render.i_aspect
+                                    * p_vout->render.i_height / i_height
+                                    * i_width / p_vout->render.i_width );
+            if( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout == NULL )
+            {
+                intf_ErrMsg( "vout error: failed to get %ix%i vout threads",
+                             p_vout->p_sys->i_col, p_vout->p_sys->i_row );
+                RemoveAllVout( p_vout );
+                return 0;
+            }
+
+            p_vout->p_sys->i_vout++;
         }
     }
 
@@ -263,35 +295,74 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
         {
             while( ( p_outpic =
-                vout_CreatePicture( p_vout->p_sys->pp_vout[ i_vout ], 0, 0, 0 )
+                vout_CreatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
+                                    0, 0, 0 )
                    ) == NULL )
             {
                 if( p_vout->b_die || p_vout->b_error )
                 {
-                    vout_DestroyPicture( p_vout->p_sys->pp_vout[ i_vout ], 
-                                         p_outpic );
+                    vout_DestroyPicture(
+                        p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
                     return;
                 }
 
                 msleep( VOUT_OUTMEM_SLEEP );
             }
 
-            vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ],
+            vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                               p_outpic, i_date );
-            vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ],
+            vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                               p_outpic );
 
             for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
             {
-                FAST_MEMCPY( p_outpic->planes[ i_index ].p_data,
-                             p_pic->planes[ i_index ].p_data
-                                 + p_pic->planes[ i_index ].i_bytes / 2,
-                             p_outpic->planes[ i_index ].i_bytes );
+                yuv_data_t *p_in, *p_in_end, *p_out;
+                int i_out_bytes, i_offset;
+
+                /* XXX: beware, it's p_outpic ! */
+                i_out_bytes = p_outpic->planes[ i_index ].i_line_bytes;
+
+                if( i_col + 1 < p_vout->p_sys->i_col )
+                {
+                    i_offset = i_out_bytes * i_col;
+                }
+                else
+                {
+                    i_offset = p_pic->planes[ i_index ].i_line_bytes
+                                - i_out_bytes;
+                }
+
+                p_in = p_pic->planes[ i_index ].p_data
+                        + p_pic->planes[ i_index ].i_bytes
+                           / p_vout->p_sys->i_row * i_row
+                        + i_offset;
+
+                if( i_row + 1 < p_vout->p_sys->i_row )
+                {
+                    p_in_end = p_in
+                                + p_pic->planes[ i_index ].i_bytes
+                                   / p_vout->p_sys->i_row;
+                }
+                else
+                {
+                    p_in_end = p_pic->planes[ i_index ].p_data
+                                + p_pic->planes[ i_index ].i_bytes
+                                + i_offset;
+                }
+
+                p_out = p_outpic->planes[ i_index ].p_data;
+
+                while( p_in < p_in_end )
+                {
+                    FAST_MEMCPY( p_out, p_in, i_out_bytes );
+                    p_in += p_pic->planes[ i_index ].i_line_bytes;
+                    p_out += i_out_bytes;
+                }
             }
 
-            vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ],
+            vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                                 p_outpic );
-            vout_DisplayPicture( p_vout->p_sys->pp_vout[ i_vout ],
+            vout_DisplayPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                                  p_outpic );
 
             i_vout++;
@@ -304,8 +375,8 @@ static void RemoveAllVout( vout_thread_t *p_vout )
     while( p_vout->p_sys->i_vout )
     {
          --p_vout->p_sys->i_vout;
-         vout_DestroyThread( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ],
-                             NULL );
+         vout_DestroyThread(
+             p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout, NULL );
     }
 }
 
index d794d11be659cc4f286062530c276e6da2fa29fa..785b4b2a6643476580077d7d750f83ca5ebe2c96 100644 (file)
@@ -2,7 +2,7 @@
  * input_ts.c: TS demux and netlist management
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ts.c,v 1.10 2001/12/30 07:09:55 sam Exp $
+ * $Id: input_ts.c,v 1.11 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Henri Fallon <henri@videolan.org>
  *
@@ -126,7 +126,7 @@ static int TSProbe( probedata_t * p_data )
     input_thread_t * p_input = (input_thread_t *)p_data;
 
     char * psz_name = p_input->p_source;
-    int i_score = 2;
+    int i_score = 0;
 
     if( ( strlen(psz_name) >= 10 && !strncasecmp( psz_name, "udpstream:", 10 ) )
             || ( strlen(psz_name) >= 4 && !strncasecmp( psz_name, "udp:", 4 ) ) )
index 4717079b3ebee1d32751cb8479cb3b2bb5ec2370..83e9702c38b2174b0ad17a6bc8a91c33cf4f58df 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_ts.c : Transport Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ts.c,v 1.2 2001/12/30 07:09:55 sam Exp $
+ * $Id: mpeg_ts.c,v 1.3 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Henri Fallon <henri@via.ecp.fr>
  *
@@ -42,7 +42,7 @@ MODULE_CONFIG_STOP
 
 MODULE_INIT_START
     SET_DESCRIPTION( "ISO 13818-1 MPEG Transport Stream input" )
-    ADD_CAPABILITY( INPUT, 50 )
+    ADD_CAPABILITY( INPUT, 150 )
     ADD_SHORTCUT( "ts" )
 MODULE_INIT_STOP
 
index 0857b209795159194342a2126e0101b87c3439bc..6b0be5f1345a43ef60c99080ed8fa5c27d8105d7 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.1 2001/12/30 07:09:56 sam Exp $
+ * $Id: xcommon.c,v 1.2 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -333,11 +333,16 @@ static int vout_Create( vout_thread_t *p_vout )
     }
 #endif
 
+    /* Create blank cursor (for mouse cursor autohiding) */
+    p_vout->p_sys->b_mouse_pointer_visible = 1;
+    CreateCursor( p_vout );
+
     /* Spawn base window - this window will include the video output window,
      * but also command buttons, subtitles and other indicators */
     if( CreateWindow( p_vout ) )
     {
         intf_ErrMsg( "vout error: cannot create X11 window" );
+        DestroyCursor( p_vout );
         XCloseDisplay( p_vout->p_sys->p_display );
         free( p_vout->p_sys );
         return( 1 );
@@ -347,16 +352,12 @@ static int vout_Create( vout_thread_t *p_vout )
     if( InitDisplay( p_vout ) )
     {
         intf_ErrMsg( "vout error: cannot initialize X11 display" );
+        DestroyCursor( p_vout );
         XCloseDisplay( p_vout->p_sys->p_display );
         free( p_vout->p_sys );
         return( 1 );
     }
 
-    /* Create blank cursor (for mouse cursor autohiding) */
-    CreateCursor( p_vout );
-
-    p_vout->p_sys->b_mouse_pointer_visible = 1;
-
     /* Disable screen saver and return */
     DisableXScreenSaver( p_vout );
 
index ee8bfac532f333a6a2ac38cfbe32e531c2e3ef4b..7091c69b56ce53b740a9452e47f83e719d50ebb3 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.149 2001/12/30 07:09:56 sam Exp $
+ * $Id: video_output.c,v 1.150 2001/12/31 04:53:33 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -94,6 +94,7 @@ vout_thread_t * vout_CreateThread   ( int *pi_status,
     vout_thread_t * p_vout;                             /* thread descriptor */
     int             i_status;                               /* thread status */
     int             i_index;                                /* loop variable */
+    char          * psz_plugin;
 
     /* Allocate descriptor */
     p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
@@ -105,11 +106,13 @@ vout_thread_t * vout_CreateThread   ( int *pi_status,
     }
 
     /* Choose the best module */
-    p_vout->p_module =
-        module_Need( MODULE_CAPABILITY_VOUT,
-                     main_GetPszVariable( VOUT_FILTER_VAR,
-                         main_GetPszVariable( VOUT_METHOD_VAR, NULL ) ),
-                     NULL );
+    psz_plugin = main_GetPszVariable( VOUT_FILTER_VAR, "" );
+    if( psz_plugin[0] == '\0' )
+    {
+        psz_plugin = main_GetPszVariable( VOUT_METHOD_VAR, "" );
+    }
+
+    p_vout->p_module = module_Need( MODULE_CAPABILITY_VOUT, psz_plugin, NULL );
 
     if( p_vout->p_module == NULL )
     {