* 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'.
* 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>
*
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;
/*****************************************************************************
* 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>
*
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 );
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 );
* 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>
*
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;
* 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>
*
MODULE_INIT_START
SET_DESCRIPTION( "EsounD audio module" )
ADD_CAPABILITY( AOUT, 50 )
+ ADD_SHORTCUT( "esd" )
+ ADD_SHORTCUT( "esound" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
* 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>
*
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;
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) );
*****************************************************************************/
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;
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++;
}
}
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++;
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 );
}
}
* 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>
*
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 ) ) )
* 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>
*
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
* 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>
}
#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 );
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 );
* 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>
*
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) );
}
/* 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 )
{