;;
esac
-BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
+BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
+PLUGINS="${PLUGINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
dnl
dnl default modules
dnl
-BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
+BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
+PLUGINS="${PLUGINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
dnl
dnl Accelerated modules
;;
xno)
# don't use libdvdcss at all, build a DVD module that can dlopen() it
- BUILTINS="${BUILTINS} dvd"
+ PLUGINS="${PLUGINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
else
# XXX: no check for libdl is done, don't try this at home !
- BUILTINS="${BUILTINS} dvd"
+ PLUGINS="${PLUGINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
if test x$enable_vcd != xno
then
AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
- BUILTINS="${BUILTINS} vcd"
+ PLUGINS="${PLUGINS} vcd"
])
-fi
-if test x$enable_vcd != xno -a "${SYS}" = "bsdi"
-then
- BUILTINS="${BUILTINS} vcd"
-fi
+ if test "x${SYS}" = "xbsdi"
+ then
+ PLUGINS="${PLUGINS} vcd"
+ fi
-if test x$enable_vcd != xno -a "${SYS}" = "darwin"
-then
- BUILTINS="${BUILTINS} vcd"
- LIB_VCD="${LIB_VCD} -framework IOKit"
+ if test "x${SYS}" = "xdarwin"
+ then
+ PLUGINS="${PLUGINS} vcd"
+ LIB_VCD="${LIB_VCD} -framework IOKit"
+ fi
fi
dnl
* outputting an error message (in second) */
#define THREAD_COND_TIMEOUT 5
+/* The configuration file and directory */
+#define CONFIG_DIR ".videolan"
+#define CONFIG_FILE "vlcrc"
+
/*****************************************************************************
* Interface configuration
*****************************************************************************/
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
+/* Define if you have the getpwuid function. */
+#undef HAVE_GETPWUID
+
+/* Define if you have the getpwuid_r function. */
+#undef HAVE_GETPWUID_R
+
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the sigrelse function. */
#undef HAVE_SIGRELSE
-/* Define if you have the getpwuid_r function. */
-#undef HAVE_GETPWUID_R
-
-/* Define if you have the getpwuid function. */
-#undef HAVE_GETPWUID
-
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
* includes all common video types and constants.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video.h,v 1.45 2002/03/15 04:41:54 sam Exp $
+ * $Id: video.h,v 1.46 2002/03/16 23:03:19 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
int i_visible_bytes; /* How many real pixels are there ? */
boolean_t b_hidden; /* Are we allowed to write to the margin ? */
- /* Variables used for RGB planes */
- int i_red_mask;
- int i_green_mask;
- int i_blue_mask;
-
} plane_t;
/*****************************************************************************
boolean_t b_repeat_first_field; /* RFF bit */
boolean_t b_top_field_first; /* which field is first */
+ /* The picture heap we are attached to */
+ struct picture_heap_s* p_heap;
+
/* Private data - the video output plugin might want to put stuff here to
* keep track of the picture */
struct picture_sys_s *p_sys;
*****************************************************************************/
typedef struct picture_heap_s
{
- int i_pictures; /* current heap size */
+ int i_pictures; /* current heap size */
/* Picture static properties - those properties are fixed at initialization
* and should NOT be modified */
- int i_width; /* picture width */
- int i_height; /* picture height */
- u32 i_chroma; /* picture chroma */
- int i_aspect; /* aspect ratio */
+ int i_width; /* picture width */
+ int i_height; /* picture height */
+ u32 i_chroma; /* picture chroma */
+ int i_aspect; /* aspect ratio */
+
+ /* Variables used for RGB planes */
+ int i_rmask, i_rrshift, i_lrshift;
+ int i_gmask, i_rgshift, i_lgshift;
+ int i_bmask, i_rbshift, i_lbshift;
/* Real pictures */
picture_t* pp_picture[VOUT_MAX_PICTURES]; /* pictures */
} picture_heap_t;
+/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */
+#define RGB2PIXEL( p_vout, i_r, i_g, i_b ) \
+ (((((u32)i_r) >> p_vout->output.i_rrshift) << p_vout->output.i_lrshift) | \
+ ((((u32)i_g) >> p_vout->output.i_rgshift) << p_vout->output.i_lgshift) | \
+ ((((u32)i_b) >> p_vout->output.i_rbshift) << p_vout->output.i_lbshift))
+
/*****************************************************************************
* Flags used to describe the status of a picture
*****************************************************************************/
#define FOURCC_BI_BITFIELDS 0x00000003 /* RGB, for 16, 24, 32bpp */
#define FOURCC_RV15 0x35315652 /* RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
#define FOURCC_RV16 0x36315652 /* RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
+#define FOURCC_RV24 0x34325652 /* RGB 24bpp, 0xff, 0xff00, 0xff0000 */
#define FOURCC_RV32 0x32335652 /* RGB 32bpp, 0xff, 0xff00, 0xff0000 */
/* Planar YUV formats */
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_beos.cpp,v 1.44 2002/03/13 08:39:39 tcastley Exp $
+ * $Id: vout_beos.cpp,v 1.45 2002/03/16 23:03:19 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
p_vout->output.i_chroma = FOURCC_RV32;
+ p_vout->output.i_rmask = 0x00ff0000;
+ p_vout->output.i_gmask = 0x0000ff00;
+ p_vout->output.i_bmask = 0x000000ff;
+
p_pic = NULL;
/* Find an empty picture slot */
p_pic->p->b_margin = 0;
p_pic->p->i_pitch = 4 * p_vout->p_sys->i_width;
- p_pic->p->i_red_mask = 0x00ff0000;
- p_pic->p->i_green_mask = 0x0000ff00;
- p_pic->p->i_blue_mask = 0x000000ff;
-
p_pic->i_planes = 1;
p_pic->i_status = DESTROYED_PICTURE;
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_rgb.c,v 1.5 2002/02/15 13:32:53 sam Exp $
+ * $Id: i420_rgb.c,v 1.6 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "video_output.h"
#include "i420_rgb.h"
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+# include "i420_rgb_c.h"
+#endif
/*****************************************************************************
* Local and extern prototypes.
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+static void SetGammaTable ( int *pi_table, double f_gamma );
+static void SetYUV ( vout_thread_t *p_vout );
+#endif
+
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_INIT_START
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- SET_DESCRIPTION( "I420/IYUV/YV12 to RGB 8/15/16/24/32 conversions" )
+ SET_DESCRIPTION( "I420,IYUV,YV12 to RGB,RV15,RV16,RV24,RV32 conversions" )
ADD_CAPABILITY( CHROMA, 80 )
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
- SET_DESCRIPTION( "MMX I420/IYUV/YV12 to RGB 15/16/24/32 conversions" )
+ SET_DESCRIPTION( "MMX I420,IYUV,YV12 to RV15,RV16,RV24,RV32 conversions" )
ADD_CAPABILITY( CHROMA, 100 )
ADD_REQUIREMENT( MMX )
#endif
*****************************************************************************/
static int chroma_Init( vout_thread_t *p_vout )
{
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+ size_t i_tables_size;
+#endif
+
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
switch( p_vout->output.i_chroma )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- case FOURCC_BI_RGB:
+ case FOURCC_RGB:
p_vout->chroma.pf_convert = _M( I420_RGB8 );
break;
#endif
switch( p_vout->output.i_chroma )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- case FOURCC_BI_RGB:
+ case FOURCC_RGB:
p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH );
break;
#endif
return -1;
}
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+ switch( p_vout->output.i_chroma )
+ {
+ case FOURCC_RGB:
+ i_tables_size = sizeof( u8 ) * PALETTE_TABLE_SIZE;
+ break;
+ case FOURCC_RV15:
+ case FOURCC_RV16:
+ i_tables_size = sizeof( u16 ) * RGB_TABLE_SIZE;
+ break;
+ default: /* RV24, RV32 */
+ i_tables_size = sizeof( u32 ) * RGB_TABLE_SIZE;
+ break;
+ }
+
+ p_vout->chroma.p_sys->p_base = malloc( i_tables_size );
+ if( p_vout->chroma.p_sys->p_base == NULL )
+ {
+ free( p_vout->chroma.p_sys->p_offset );
+ free( p_vout->chroma.p_sys->p_buffer );
+ free( p_vout->chroma.p_sys );
+ return -1;
+ }
+
+ SetYUV( p_vout );
+#endif
+
return 0;
}
*****************************************************************************/
static void chroma_End( vout_thread_t *p_vout )
{
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+ free( p_vout->chroma.p_sys->p_base );
+#endif
free( p_vout->chroma.p_sys->p_offset );
free( p_vout->chroma.p_sys->p_buffer );
free( p_vout->chroma.p_sys );
}
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+/*****************************************************************************
+ * SetGammaTable: return intensity table transformed by gamma curve.
+ *****************************************************************************
+ * pi_table is a table of 256 entries from 0 to 255.
+ *****************************************************************************/
+static void SetGammaTable( int *pi_table, double f_gamma )
+{
+ int i_y; /* base intensity */
+
+ /* Use exp(gamma) instead of gamma */
+ f_gamma = exp( f_gamma );
+
+ /* Build gamma table */
+ for( i_y = 0; i_y < 256; i_y++ )
+ {
+ pi_table[ i_y ] = pow( (double)i_y / 256, f_gamma ) * 256;
+ }
+}
+
+/*****************************************************************************
+ * SetYUV: compute tables and set function pointers
+ *****************************************************************************/
+static void SetYUV( vout_thread_t *p_vout )
+{
+ int pi_gamma[256]; /* gamma table */
+ int i_index; /* index in tables */
+
+ /* Build gamma table */
+ SetGammaTable( pi_gamma, p_vout->f_gamma );
+
+ /*
+ * Set pointers and build YUV tables
+ */
+ /* Color: build red, green and blue tables */
+ switch( p_vout->output.i_chroma )
+ {
+ case FOURCC_RGB:
+ {
+ #define RGB_MIN 0
+ #define RGB_MAX 255
+ #define CLIP( x ) ( ((x < 0) ? 0 : (x > 255) ? 255 : x) << 8 )
+
+ int y,u,v;
+ int r,g,b;
+ int uvr, uvg, uvb;
+ int i = 0, j = 0;
+ u16 red[256], green[256], blue[256], transp[256];
+ unsigned char lookup[PALETTE_TABLE_SIZE];
+
+ p_vout->chroma.p_sys->yuv.p_rgb8 = (u8 *)p_vout->chroma.p_sys->p_base;
+
+ /* this loop calculates the intersection of an YUV box
+ * and the RGB cube. */
+ for ( y = 0; y <= 256; y += 16 )
+ {
+ for ( u = 0; u <= 256; u += 32 )
+ for ( v = 0; v <= 256; v += 32 )
+ {
+ uvr = (V_RED_COEF*(v-128)) >> SHIFT;
+ uvg = (U_GREEN_COEF*(u-128) + V_GREEN_COEF*(v-128)) >> SHIFT;
+ uvb = (U_BLUE_COEF*(u-128)) >> SHIFT;
+ r = y + uvr;
+ g = y + uvg;
+ b = y + uvb;
+
+ if( r >= RGB_MIN && g >= RGB_MIN && b >= RGB_MIN
+ && r <= RGB_MAX && g <= RGB_MAX && b <= RGB_MAX )
+ {
+ /* this one should never happen unless someone fscked up my code */
+ if(j == 256) { intf_ErrMsg( "vout error: no colors left to build palette" ); break; }
+
+ /* clip the colors */
+ red[j] = CLIP( r );
+ green[j] = CLIP( g );
+ blue[j] = CLIP( b );
+ transp[j] = 0;
+
+ /* allocate color */
+ lookup[i] = 1;
+ p_vout->chroma.p_sys->yuv.p_rgb8[i++] = j;
+ j++;
+ }
+ else
+ {
+ lookup[i] = 0;
+ p_vout->chroma.p_sys->yuv.p_rgb8[i++] = 0;
+ }
+ }
+ i += 128-81;
+ }
+
+ /* the colors have been allocated, we can set the palette */
+ /* there will eventually be a way to know which colors
+ * couldn't be allocated and try to find a replacement */
+#if 0
+ p_vout->pf_setpalette( p_vout, red, green, blue, transp );
+
+ p_vout->i_white_pixel = 0xff;
+ p_vout->i_black_pixel = 0x00;
+ p_vout->i_gray_pixel = 0x44;
+ p_vout->i_blue_pixel = 0x3b;
+#endif
+
+ i = 0;
+ /* this loop allocates colors that got outside
+ * the RGB cube */
+ for ( y = 0; y <= 256; y += 16 )
+ {
+ for ( u = 0; u <= 256; u += 32 )
+ for ( v = 0; v <= 256; v += 32 )
+ {
+ int u2, v2;
+ int dist, mindist = 100000000;
+
+ if( lookup[i] || y==0)
+ {
+ i++;
+ continue;
+ }
+
+ /* heavy. yeah. */
+ for( u2 = 0; u2 <= 256; u2 += 32 )
+ for( v2 = 0; v2 <= 256; v2 += 32 )
+ {
+ j = ((y>>4)<<7) + (u2>>5)*9 + (v2>>5);
+ dist = (u-u2)*(u-u2) + (v-v2)*(v-v2);
+ if( lookup[j] )
+ /* find the nearest color */
+ if( dist < mindist )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb8[i] = p_vout->chroma.p_sys->yuv.p_rgb8[j];
+ mindist = dist;
+ }
+ j -= 128;
+ if( lookup[j] )
+ /* find the nearest color */
+ if( dist + 128 < mindist )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb8[i] = p_vout->chroma.p_sys->yuv.p_rgb8[j];
+ mindist = dist + 128;
+ }
+ }
+ i++;
+ }
+ i += 128-81;
+ }
+
+ }
+ break;
+
+ case FOURCC_RV15:
+ case FOURCC_RV16:
+ p_vout->chroma.p_sys->yuv.p_rgb16 = (u16 *)p_vout->chroma.p_sys->p_base;
+ for( i_index = 0; i_index < RED_MARGIN; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb16[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb16[RED_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 );
+ }
+ for( i_index = 0; i_index < GREEN_MARGIN; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb16[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb16[GREEN_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 );
+ }
+ for( i_index = 0; i_index < BLUE_MARGIN; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb16[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] );
+ p_vout->chroma.p_sys->yuv.p_rgb16[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] );
+ }
+ for( i_index = 0; i_index < 256; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb16[RED_OFFSET + i_index] = RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb16[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb16[BLUE_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] );
+ }
+ break;
+
+ case FOURCC_RV24:
+ case FOURCC_RV32:
+ p_vout->chroma.p_sys->yuv.p_rgb32 = (u32 *)p_vout->chroma.p_sys->p_base;
+ for( i_index = 0; i_index < RED_MARGIN; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb32[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb32[RED_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 );
+ }
+ for( i_index = 0; i_index < GREEN_MARGIN; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb32[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb32[GREEN_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 );
+ }
+ for( i_index = 0; i_index < BLUE_MARGIN; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb32[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] );
+ p_vout->chroma.p_sys->yuv.p_rgb32[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] );
+ }
+ for( i_index = 0; i_index < 256; i_index++ )
+ {
+ p_vout->chroma.p_sys->yuv.p_rgb32[RED_OFFSET + i_index] = RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb32[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 );
+ p_vout->chroma.p_sys->yuv.p_rgb32[BLUE_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] );
+ }
+ break;
+ }
+}
+#endif
+
* i420_rgb.h : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: i420_rgb.h,v 1.3 2002/01/28 16:51:22 sam Exp $
+ * $Id: i420_rgb.h,v 1.4 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
u8 *p_buffer;
int *p_offset;
+#ifdef MODULE_NAME_IS_chroma_i420_rgb
+ /* Pre-calculated conversion tables */
+ void * p_base; /* base for all conversion tables */
+ union
+ {
+ u8 * p_rgb8; /* RGB 8 bits table */
+ u16 * p_rgb16; /* RGB 16 bits table */
+ u32 * p_rgb32; /* RGB 32 bits table */
+ } yuv;
+#endif
+
} chroma_sys_t;
/*****************************************************************************
* i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: i420_rgb16.c,v 1.3 2002/01/28 16:51:22 sam Exp $
+ * $Id: i420_rgb16.c,v 1.4 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
int i_scale_count; /* scale modulo counter */
int i_chroma_width = p_vout->render.i_width / 2; /* chroma width */
u16 * p_pic_start; /* beginning of the current line for copy */
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+ int i_uval, i_vval; /* U and V samples */
+ int i_red, i_green, i_blue; /* U and V modified samples */
+ u16 * p_yuv = p_vout->chroma.p_sys->yuv.p_rgb16;
+ u16 * p_ybase; /* Y dependant conversion table */
+#endif
/* Conversion buffer pointer */
u16 * p_buffer_start = (u16*)p_vout->chroma.p_sys->p_buffer;
p_vout->output.i_width, p_vout->output.i_height,
&b_hscale, &i_vscale, p_offset_start );
-#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- intf_ErrMsg( "vout error: I420_RGB16 unimplemented, "
- "please harass sam@zoy.org" );
-#endif
-
/*
* Perform conversion
*/
for ( i_x = p_vout->render.i_width / 8; i_x--; )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- /* FIXME: TODO */
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
p_v -= i_rewind >> 1;
p_buffer -= i_rewind;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- /* FIXME: TODO */
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
int i_scale_count; /* scale modulo counter */
int i_chroma_width = p_vout->render.i_width / 2; /* chroma width */
u16 * p_pic_start; /* beginning of the current line for copy */
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+ int i_uval, i_vval; /* U and V samples */
+ int i_red, i_green, i_blue; /* U and V modified samples */
+ u16 * p_yuv = p_vout->chroma.p_sys->yuv.p_rgb16;
+ u16 * p_ybase; /* Y dependant conversion table */
+#endif
/* Conversion buffer pointer */
u16 * p_buffer_start = (u16*)p_vout->chroma.p_sys->p_buffer;
p_vout->output.i_width, p_vout->output.i_height,
&b_hscale, &i_vscale, p_offset_start );
-#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- intf_ErrMsg( "vout error: I420_RGB16 unimplemented, "
- "please harass sam@zoy.org" );
-#endif
-
/*
* Perform conversion
*/
for ( i_x = p_vout->render.i_width / 8; i_x--; )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- /* FIXME: TODO */
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
p_v -= i_rewind >> 1;
p_buffer -= i_rewind;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- /* FIXME: TODO */
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
+ CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
* i420_ymga.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_ymga.c,v 1.2 2002/02/15 13:32:53 sam Exp $
+ * $Id: i420_ymga.c,v 1.3 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "video.h"
#include "video_output.h"
-#define SRC_FOURCC "I420/IYUV/YV12"
+#define SRC_FOURCC "I420,IYUV,YV12"
#define DEST_FOURCC "YMGA"
/*****************************************************************************
* i420_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_yuy2.c,v 1.2 2002/02/15 13:32:53 sam Exp $
+ * $Id: i420_yuy2.c,v 1.3 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "i420_yuy2.h"
-#define SRC_FOURCC "I420/IYUV/YV12"
+#define SRC_FOURCC "I420,IYUV,YV12"
#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
-# define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv/Y211"
+# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv,Y211"
#else
-# define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv"
+# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv"
#endif
/*****************************************************************************
* i422_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i422_yuy2.c,v 1.2 2002/02/15 13:32:53 sam Exp $
+ * $Id: i422_yuy2.c,v 1.3 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define SRC_FOURCC "I422"
#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
-# define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv/Y211"
+# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv,Y211"
#else
-# define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv"
+# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv"
#endif
/*****************************************************************************
* vout_directx.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: vout_directx.c,v 1.24 2002/03/11 07:23:09 gbazin Exp $
+ * $Id: vout_directx.c,v 1.25 2002/03/16 23:03:19 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
{
/* FixMe */
p_vout->output.i_chroma = FOURCC_RV16;
+ p_vout->output.i_rmask = 0x001f;
+ p_vout->output.i_gmask = 0x03e0;
+ p_vout->output.i_bmask = 0x7c00;
for( i = 0; i < i_num_pics; i++ )
{
p_pic->p->i_pixel_bytes = 2;
p_pic->p->b_margin = 0;
- p_pic->p->i_red_mask = 0x001f;
- p_pic->p->i_green_mask = 0x03e0;
- p_pic->p->i_blue_mask = 0x7c00;
-
p_pic->i_planes = 1;
break;
p_pic->p->i_pixel_bytes = 2;
p_pic->p->b_margin = 0;
- p_pic->p->i_red_mask = 0x001f;
- p_pic->p->i_green_mask = 0x07e0;
- p_pic->p->i_blue_mask = 0xf800;
-
p_pic->i_planes = 1;
break;
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_dummy.c,v 1.18 2002/02/15 13:32:53 sam Exp $
+ * $Id: vout_dummy.c,v 1.19 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
default:
p_vout->output.i_chroma = FOURCC_RV16;
+ p_vout->output.i_rmask = 0xf800;
+ p_vout->output.i_gmask = 0x07e0;
+ p_vout->output.i_bmask = 0x001f;
p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
p_pic->p->i_pitch = i_width;
p_pic->p->i_pixel_bytes = 2;
p_pic->p->b_margin = 0;
- p_pic->p->i_red_mask = 0xf800;
- p_pic->p->i_green_mask = 0x07e0;
- p_pic->p->i_blue_mask = 0x001f;
/* We allocated 1 plane */
p_pic->i_planes = 1;
* fb.c : framebuffer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: fb.c,v 1.14 2002/02/24 20:51:09 gbazin Exp $
+ * $Id: fb.c,v 1.15 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
return 0;
}
+ /* Only useful for p_vout->p_sys->var_info.bits_per_pixel != 8 */
+ p_vout->output.i_rmask = ( (1 << p_vout->p_sys->var_info.red.length) - 1 )
+ << p_vout->p_sys->var_info.red.offset;
+ p_vout->output.i_gmask = ( (1 << p_vout->p_sys->var_info.green.length) - 1 )
+ << p_vout->p_sys->var_info.green.offset;
+ p_vout->output.i_bmask = ( (1 << p_vout->p_sys->var_info.blue.length) - 1 )
+ << p_vout->p_sys->var_info.blue.offset;
+
p_vout->output.i_width = p_vout->p_sys->i_width;
p_vout->output.i_height = p_vout->p_sys->i_height;
* p_vout->p_sys->i_bytes_per_pixel;
}
- /* Only useful for p_vout->p_sys->var_info.bits_per_pixel != 8 */
- p_pic->p->i_red_mask = ( (1 << p_vout->p_sys->var_info.red.length) - 1 )
- << p_vout->p_sys->var_info.red.offset;
- p_pic->p->i_green_mask = ( (1 << p_vout->p_sys->var_info.green.length) - 1 )
- << p_vout->p_sys->var_info.green.offset;
- p_pic->p->i_blue_mask = ( (1 << p_vout->p_sys->var_info.blue.length) - 1 )
- << p_vout->p_sys->var_info.blue.offset;
-
p_pic->i_planes = 1;
p_pic->i_status = DESTROYED_PICTURE;
* ggi.c : GGI plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: ggi.c,v 1.16 2002/03/11 07:23:09 gbazin Exp $
+ * $Id: ggi.c,v 1.17 2002/03/16 23:03:19 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
return 0;
}
+ /* Only useful for bits_per_pixel != 8 */
+ p_vout->output.i_rmask = p_b[ 0 ]->buffer.plb.pixelformat->red_mask;
+ p_vout->output.i_gmask = p_b[ 0 ]->buffer.plb.pixelformat->green_mask;
+ p_vout->output.i_bmask = p_b[ 0 ]->buffer.plb.pixelformat->blue_mask;
+
p_pic = NULL;
/* Find an empty picture slot */
p_pic->p->i_pitch = p_b[ 0 ]->buffer.plb.stride;
}
- /* Only useful for bits_per_pixel != 8 */
- p_pic->p->i_red_mask = p_b[ 0 ]->buffer.plb.pixelformat->red_mask;
- p_pic->p->i_green_mask = p_b[ 0 ]->buffer.plb.pixelformat->green_mask;
- p_pic->p->i_blue_mask = p_b[ 0 ]->buffer.plb.pixelformat->blue_mask;
-
p_pic->i_planes = 1;
p_pic->i_status = DESTROYED_PICTURE;
* glide.c : 3dfx Glide plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: glide.c,v 1.12 2002/02/15 13:32:53 sam Exp $
+ * $Id: glide.c,v 1.13 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
int i_index;
picture_t *p_pic;
+ /* FIXME: we don't set i_chroma !! */
+ p_vout->output.i_rmask = 0xf800;
+ p_vout->output.i_gmask = 0x07e0;
+ p_vout->output.i_bmask = 0x001f;
+
I_OUTPUTPICTURES = 0;
p_pic = NULL;
p_pic->p->i_pitch = p_vout->p_sys->p_buffer_info.strideInBytes;
/*1024 * GLIDE_BYTES_PER_PIXEL*/
- p_pic->p->i_red_mask = 0xf800;
- p_pic->p->i_green_mask = 0x07e0;
- p_pic->p->i_blue_mask = 0x001f;
-
p_pic->i_status = DESTROYED_PICTURE;
p_pic->i_type = DIRECT_PICTURE;
switch( p_vout->i_screen_depth )
{
case 15:
- p_vout->i_red_mask = 0x7c00;
- p_vout->i_green_mask = 0x03e0;
- p_vout->i_blue_mask = 0x001f;
+ p_vout->output.i_rmask = 0x7c00;
+ p_vout->output.i_gmask = 0x03e0;
+ p_vout->output.i_bmask = 0x001f;
break;
case 16:
- p_vout->i_red_mask = 0xf800;
- p_vout->i_green_mask = 0x07e0;
- p_vout->i_blue_mask = 0x001f;
+ p_vout->output.i_rmask = 0xf800;
+ p_vout->output.i_gmask = 0x07e0;
+ p_vout->output.i_bmask = 0x001f;
break;
case 24:
case 32:
default:
- p_vout->i_red_mask = 0xff0000;
- p_vout->i_green_mask = 0x00ff00;
- p_vout->i_blue_mask = 0x0000ff;
+ p_vout->output.i_rmask = 0xff0000;
+ p_vout->output.i_gmask = 0x00ff00;
+ p_vout->output.i_bmask = 0x0000ff;
break;
}
* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_sdl.c,v 1.82 2002/02/19 00:50:19 sam Exp $
+ * $Id: vout_sdl.c,v 1.83 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
/* For RGB output */
int i_surfaces;
- int i_red_mask;
- int i_green_mask;
- int i_blue_mask;
boolean_t b_cursor;
boolean_t b_cursor_autohidden;
switch( p_vout->p_sys->p_display->format->BitsPerPixel )
{
case 8:
- p_vout->output.i_chroma = FOURCC_BI_RGB;
+ p_vout->output.i_chroma = FOURCC_RGB;
break;
case 15:
p_vout->output.i_chroma = FOURCC_RV15;
p_vout->output.i_chroma = FOURCC_RV16;
break;
case 24:
- p_vout->output.i_chroma = FOURCC_BI_BITFIELDS;
+ p_vout->output.i_chroma = FOURCC_RV24;
break;
case 32:
- p_vout->output.i_chroma = FOURCC_BI_BITFIELDS;
+ p_vout->output.i_chroma = FOURCC_RV32;
break;
default:
intf_ErrMsg( "vout error: unknown screen depth" );
return( -1 );
}
- p_vout->p_sys->i_red_mask = p_vout->p_sys->p_display->format->Rmask;
- p_vout->p_sys->i_green_mask = p_vout->p_sys->p_display->format->Gmask;
- p_vout->p_sys->i_blue_mask = p_vout->p_sys->p_display->format->Bmask;
+ p_vout->output.i_rmask = p_vout->p_sys->p_display->format->Rmask;
+ p_vout->output.i_gmask = p_vout->p_sys->p_display->format->Gmask;
+ p_vout->output.i_bmask = p_vout->p_sys->p_display->format->Bmask;
SDL_WM_SetCaption( VOUT_TITLE " (software RGB SDL output)",
VOUT_TITLE " (software RGB SDL output)" );
p_pic->p->i_visible_bytes = 2 * p_vout->p_sys->p_display->w;
}
- p_pic->p->i_red_mask = p_vout->p_sys->p_display->format->Rmask;
- p_pic->p->i_green_mask = p_vout->p_sys->p_display->format->Gmask;
- p_pic->p->i_blue_mask = p_vout->p_sys->p_display->format->Bmask;
-
p_vout->p_sys->i_surfaces++;
p_pic->i_planes = 1;
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.21 2002/03/11 07:23:09 gbazin Exp $
+ * $Id: xcommon.c,v 1.22 2002/03/16 23:03:19 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
int i_screen_depth;
int i_bytes_per_pixel;
int i_bytes_per_line;
- int i_red_mask;
- int i_green_mask;
- int i_blue_mask;
#endif
/* X11 generic properties */
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
+ switch( p_vout->output.i_chroma )
+ {
+ case FOURCC_RV15:
+ p_vout->output.i_rmask = 0x001f;
+ p_vout->output.i_gmask = 0x07e0;
+ p_vout->output.i_bmask = 0xf800;
+ break;
+ case FOURCC_RV16:
+ p_vout->output.i_rmask = 0x001f;
+ p_vout->output.i_gmask = 0x03e0;
+ p_vout->output.i_bmask = 0x7c00;
+ break;
+ }
+
#else
/* Initialize the output structure: RGB with square pixels, whatever
* the input format is, since it's the only format we know */
switch( p_vout->p_sys->i_screen_depth )
{
case 8: /* FIXME: set the palette */
- p_vout->output.i_chroma = FOURCC_BI_RGB; break;
+ p_vout->output.i_chroma = FOURCC_RGB; break;
case 15:
p_vout->output.i_chroma = FOURCC_RV15; break;
case 16:
p_vout->output.i_chroma = FOURCC_RV16; break;
case 24:
- p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
+ p_vout->output.i_chroma = FOURCC_RV24; break;
case 32:
- p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
+ p_vout->output.i_chroma = FOURCC_RV24; break;
default:
intf_ErrMsg( "vout error: unknown screen depth" );
return( 0 );
p_pic->p->i_pixel_bytes = 2;
p_pic->p->b_margin = 0;
- p_pic->p->i_red_mask = 0x001f;
- p_pic->p->i_green_mask = 0x07e0;
- p_pic->p->i_blue_mask = 0xf800;
-
p_pic->i_planes = 1;
break;
p_pic->p->i_pixel_bytes = 2;
p_pic->p->b_margin = 0;
- p_pic->p->i_red_mask = 0x001f;
- p_pic->p->i_green_mask = 0x03e0;
- p_pic->p->i_blue_mask = 0x7c00;
-
p_pic->i_planes = 1;
break;
p_pic->p->i_visible_bytes = 2 * p_pic->p_sys->p_image->width;
}
- p_pic->p->i_red_mask = p_pic->p_sys->p_image->red_mask;
- p_pic->p->i_green_mask = p_pic->p_sys->p_image->green_mask;
- p_pic->p->i_blue_mask = p_pic->p_sys->p_image->blue_mask;
-
p_pic->i_planes = 1;
break;
p_pic->p->i_visible_bytes = 4 * p_pic->p_sys->p_image->width;
}
- p_pic->p->i_red_mask = p_pic->p_sys->p_image->red_mask;
- p_pic->p->i_green_mask = p_pic->p_sys->p_image->green_mask;
- p_pic->p->i_blue_mask = p_pic->p_sys->p_image->blue_mask;
-
p_pic->i_planes = 1;
break;
intf_ErrMsg( "vout error: no TrueColor visual available" );
return( 1 );
}
- p_vout->p_sys->i_red_mask = p_xvisual->red_mask;
- p_vout->p_sys->i_green_mask = p_xvisual->green_mask;
- p_vout->p_sys->i_blue_mask = p_xvisual->blue_mask;
+
+ p_vout->output.i_rmask = p_xvisual->red_mask;
+ p_vout->output.i_gmask = p_xvisual->green_mask;
+ p_vout->output.i_bmask = p_xvisual->blue_mask;
/* There is no difference yet between 3 and 4 Bpp. The only way
* to find the actual number of bytes per pixel is to list supported
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.4 2002/03/16 01:40:58 gbazin Exp $
+ * $Id: configuration.c,v 1.5 2002/03/16 23:03:19 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+
#include <stdio.h> /* sprintf() */
#include <stdlib.h> /* free(), strtol() */
#include <string.h> /* strdup() */
#include <sys/stat.h>
#include <sys/types.h>
-static char *config_GetHomeDir(void);
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static char *GetHomeDir( void );
/*****************************************************************************
* config_GetIntVariable: get the value of an int variable
/* sanity checks */
if( !p_config )
{
- intf_ErrMsg( "config_GetIntVariable: option %s doesn't exist",
- psz_name );
+ intf_ErrMsg( "config error: option %s doesn't exist", psz_name );
return -1;
}
if( (p_config->i_type!=MODULE_CONFIG_ITEM_INTEGER) &&
(p_config->i_type!=MODULE_CONFIG_ITEM_BOOL) )
{
- intf_ErrMsg( "config_GetIntVariable: option %s doesn't refer to an int"
- , psz_name );
+ intf_ErrMsg( "config error: option %s doesn't refer to an int",
+ psz_name );
return -1;
}
/* sanity checks */
if( !p_config )
{
- intf_ErrMsg( "config_GetPszVariable: option %s doesn't exist",
- psz_name );
+ intf_ErrMsg( "config error: option %s doesn't exist", psz_name );
return NULL;
}
if( (p_config->i_type!=MODULE_CONFIG_ITEM_STRING) &&
(p_config->i_type!=MODULE_CONFIG_ITEM_FILE) &&
(p_config->i_type!=MODULE_CONFIG_ITEM_PLUGIN) )
{
- intf_ErrMsg( "config_GetPszVariable: option %s doesn't refer to a "
- "string", psz_name );
+ intf_ErrMsg( "config error: option %s doesn't refer to a string",
+ psz_name );
return NULL;
}
/* sanity checks */
if( !p_config )
{
- intf_ErrMsg( "config_PutPszVariable: option %s doesn't exist",
- psz_name );
+ intf_ErrMsg( "config error: option %s doesn't exist", psz_name );
return;
}
if( (p_config->i_type!=MODULE_CONFIG_ITEM_STRING) &&
(p_config->i_type!=MODULE_CONFIG_ITEM_FILE) &&
(p_config->i_type!=MODULE_CONFIG_ITEM_PLUGIN) )
{
- intf_ErrMsg( "config_PutPszVariable: option %s doesn't refer to a "
- "string", psz_name );
+ intf_ErrMsg( "config error: option %s doesn't refer to a string",
+ psz_name );
return;
}
/* sanity checks */
if( !p_config )
{
- intf_ErrMsg( "config_PutIntVariable: option %s doesn't exist",
- psz_name );
+ intf_ErrMsg( "config error: option %s doesn't exist", psz_name );
return;
}
if( (p_config->i_type!=MODULE_CONFIG_ITEM_INTEGER) &&
(p_config->i_type!=MODULE_CONFIG_ITEM_BOOL) )
{
- intf_ErrMsg( "config_PutIntVariable: option %s doesn't refer to an int"
- , psz_name );
+ intf_ErrMsg( "config error: option %s doesn't refer to an int",
+ psz_name );
return;
}
* p_module->i_config_lines );
if( p_config == NULL )
{
- intf_ErrMsg( "config_Duplicate error: can't allocate p_config" );
+ intf_ErrMsg( "config error: can't duplicate p_config" );
return( NULL );
}
/* Acquire config file lock */
vlc_mutex_lock( &p_main->config_lock );
- psz_homedir = config_GetHomeDir();
+ psz_homedir = GetHomeDir();
if( !psz_homedir )
{
- intf_ErrMsg( "config_LoadConfigFile: GetHomeDir failed" );
+ intf_ErrMsg( "config error: GetHomeDir failed" );
vlc_mutex_unlock( &p_main->config_lock );
return -1;
}
- psz_filename = (char *)malloc( strlen("/.VideoLan/vlc") +
+ psz_filename = (char *)malloc( strlen("/" CONFIG_DIR "/" CONFIG_FILE) +
strlen(psz_homedir) + 1 );
if( !psz_filename )
{
- intf_ErrMsg( "config err: couldn't malloc psz_filename" );
+ intf_ErrMsg( "config error: couldn't malloc psz_filename" );
free( psz_homedir );
vlc_mutex_unlock( &p_main->config_lock );
return -1;
}
- sprintf( psz_filename, "%s/.VideoLan/vlc", psz_homedir );
+ sprintf( psz_filename, "%s/" CONFIG_DIR "/" CONFIG_FILE, psz_homedir );
free( psz_homedir );
- intf_WarnMsg( 5, "config_SaveConfigFile: opening config file %s",
- psz_filename );
+ intf_WarnMsg( 5, "config: opening config file %s", psz_filename );
file = fopen( psz_filename, "r" );
if( !file )
{
- intf_WarnMsg( 1, "config_LoadConfigFile: couldn't open config file %s "
- "for reading", psz_filename );
+ intf_WarnMsg( 1, "config: couldn't open config file %s for reading",
+ psz_filename );
free( psz_filename );
vlc_mutex_unlock( &p_main->config_lock );
return -1;
!memcmp( &line[1], p_module->psz_name,
strlen(p_module->psz_name) ) )
{
- intf_WarnMsg( 5, "config_LoadConfigFile: loading config for "
- "module <%s>", p_module->psz_name );
+ intf_WarnMsg( 5, "config: loading config for module <%s>",
+ p_module->psz_name );
break;
}
case MODULE_CONFIG_ITEM_INTEGER:
p_module->p_config[i].i_value =
atoi( psz_option_value);
- intf_WarnMsg( 7, "config_LoadConfigFile: found <%s> "
- "option %s=%i",
+ intf_WarnMsg( 7, "config: found <%s> option %s=%i",
p_module->psz_name,
p_module->p_config[i].psz_name,
p_module->p_config[i].i_value );
vlc_mutex_unlock( p_module->p_config[i].p_lock );
- intf_WarnMsg( 7, "config_LoadConfigFile: found <%s> "
- "option %s=%s",
+ intf_WarnMsg( 7, "config: found <%s> option %s=%s",
p_module->psz_name,
p_module->p_config[i].psz_name,
p_module->p_config[i].psz_value );
/* Acquire config file lock */
vlc_mutex_lock( &p_main->config_lock );
- psz_homedir = config_GetHomeDir();
+ psz_homedir = GetHomeDir();
if( !psz_homedir )
{
- intf_ErrMsg( "config_SaveConfigFile: GetHomeDir failed" );
+ intf_ErrMsg( "config error: GetHomeDir failed" );
vlc_mutex_unlock( &p_main->config_lock );
return -1;
}
- psz_filename = (char *)malloc( strlen("/.VideoLan/vlc") +
+ psz_filename = (char *)malloc( strlen("/" CONFIG_DIR "/" CONFIG_FILE) +
strlen(psz_homedir) + 1 );
if( !psz_filename )
{
- intf_ErrMsg( "config err: couldn't malloc psz_filename" );
+ intf_ErrMsg( "config error: couldn't malloc psz_filename" );
free( psz_homedir );
vlc_mutex_unlock( &p_main->config_lock );
return -1;
}
- sprintf( psz_filename, "%s/.VideoLan", psz_homedir );
+ sprintf( psz_filename, "%s/" CONFIG_DIR, psz_homedir );
free( psz_homedir );
#ifndef WIN32
mkdir( psz_filename, 0755 );
#else
mkdir( psz_filename );
#endif
- strcat( psz_filename, "/vlc" );
+ strcat( psz_filename, "/" CONFIG_FILE );
- intf_WarnMsg( 5, "config_SaveConfigFile: opening config file %s",
- psz_filename );
+ intf_WarnMsg( 5, "config: opening config file %s", psz_filename );
file = fopen( psz_filename, "r" );
if( !file )
{
- intf_WarnMsg( 1, "config_SaveConfigFile: couldn't open config file %s "
- "for reading", psz_filename );
+ intf_WarnMsg( 1, "config: couldn't open config file %s for reading",
+ psz_filename );
}
else
{
p_bigbuffer = p_index = malloc( i_sizebuf+1 );
if( !p_bigbuffer )
{
- intf_ErrMsg( "config err: couldn't malloc bigbuffer" );
+ intf_ErrMsg( "config error: couldn't malloc bigbuffer" );
if( file ) fclose( file );
free( psz_filename );
vlc_mutex_unlock( &p_main->config_lock );
/* we don't have this section in our list so we need to back
* it up */
*p_index2 = 0;
- intf_WarnMsg( 5, "config_SaveConfigFile: backing up config for"
- " unknown module <%s>", &p_line[1] );
+ intf_WarnMsg( 5, "config: backing up config for "
+ "unknown module <%s>", &p_line[1] );
*p_index2 = ']';
b_backup = 1;
file = fopen( psz_filename, "w" );
if( !file )
{
- intf_WarnMsg( 1, "config_SaveConfigFile: couldn't open config file %s "
- "for writing", psz_filename );
+ intf_WarnMsg( 1, "config: couldn't open config file %s for writing",
+ psz_filename );
free( psz_filename );
vlc_mutex_unlock( &p_main->config_lock );
return -1;
}
- fprintf( file, "#\n# "COPYRIGHT_MESSAGE"\n#\n\n" );
+ fprintf( file, "###\n### " COPYRIGHT_MESSAGE "\n###\n\n" );
/* Look for the selected module, if NULL then save everything */
for( p_module = p_module_bank->first ; p_module != NULL ;
if( !p_module->i_config_items )
continue;
- intf_WarnMsg( 5, "config_SaveConfigFile: saving config for "
- "module <%s>", p_module->psz_name );
+ intf_WarnMsg( 5, "config: saving config for module <%s>",
+ p_module->psz_name );
- fprintf( file, "[%s]\n", p_module->psz_name );
if( p_module->psz_longname )
- fprintf( file, "# %s\n#\n", p_module->psz_longname );
+ fprintf( file, "###\n### %s\n###\n", p_module->psz_longname );
+
+ fprintf( file, "[%s]\n", p_module->psz_name );
for( i = 0; i < p_module->i_config_lines; i++ )
{
return 0;
}
+/* Following functions are local. */
+
/*****************************************************************************
- * config_GetHomeDir: find the user's home directory.
+ * GetHomeDir: find the user's home directory.
*****************************************************************************
* This function will try by different ways to find the user's home path.
*****************************************************************************/
-static char *config_GetHomeDir(void)
+static char *GetHomeDir( void )
{
char *p_tmp, *p_homedir = NULL;
p_buffer = (char *)malloc( bufsize );
if( ( ret = getpwuid_r( getuid(), &pwd, p_buffer, bufsize, &p_pw ) ) < 0 )
- {
-
#elif defined(HAVE_GETPWUID)
if( ( p_pw = getpwuid( getuid() ) ) == NULL )
- {
-
#endif
+ {
if( ( p_tmp = getenv( "HOME" ) ) == NULL )
{
- intf_ErrMsg( "Unable to get home directory, set it to /tmp" );
+ intf_ErrMsg( "config error: unable to get home directory, "
+ "using /tmp instead" );
p_homedir = strdup( "/tmp" );
}
else p_homedir = strdup( p_tmp );
-
-#if defined(HAVE_GETPWUID_R) || defined(HAVE_GETPWUID)
}
+#if defined(HAVE_GETPWUID_R) || defined(HAVE_GETPWUID)
else
{
if( p_pw ) p_homedir = strdup( p_pw->pw_dir );
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.166 2002/03/15 04:41:54 sam Exp $
+ * $Id: video_output.c,v 1.167 2002/03/16 23:03:19 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
static void ErrorThread ( vout_thread_t *p_vout );
static void EndThread ( vout_thread_t *p_vout );
static void DestroyThread ( vout_thread_t *p_vout, int i_status );
+
static int ReduceHeight ( int );
+static int BinaryLog ( u32 );
+static void MaskToShift ( int *, int *, u32 );
/*****************************************************************************
* vout_InitBank: initialize the video output bank.
p_vout->p_subpicture[i_index].i_type = EMPTY_SUBPICTURE;
}
- /* Initialize the rendering heap */
+ /* No images in the heap */
p_vout->i_heap_size = 0;
+ /* Initialize the rendering heap */
I_RENDERPICTURES = 0;
p_vout->render.i_width = i_width;
p_vout->render.i_height = i_height;
p_vout->render.i_chroma = i_chroma;
p_vout->render.i_aspect = i_aspect;
+ p_vout->render.i_rmask = 0;
+ p_vout->render.i_gmask = 0;
+ p_vout->render.i_bmask = 0;
+
+ /* Zero the output heap */
+ I_OUTPUTPICTURES = 0;
+ p_vout->output.i_width = 0;
+ p_vout->output.i_height = 0;
+ p_vout->output.i_chroma = 0;
+ p_vout->output.i_aspect = 0;
+
+ p_vout->output.i_rmask = 0;
+ p_vout->output.i_gmask = 0;
+ p_vout->output.i_bmask = 0;
+
/* Initialize misc stuff */
p_vout->i_changes = 0;
p_vout->f_gamma = 0;
p_vout->c_loops = 0;
#endif
- /* Initialize output method, it issues its own error messages */
+ /* Initialize output method, it allocates direct buffers for us */
if( p_vout->pf_init( p_vout ) )
{
vlc_mutex_unlock( &p_vout->change_lock );
p_vout->output.i_aspect / i_pgcd,
VOUT_ASPECT_FACTOR / i_pgcd );
+ /* Calculate shifts from system-updated masks */
+ MaskToShift( &p_vout->output.i_lrshift, &p_vout->output.i_rrshift,
+ p_vout->output.i_rmask );
+ MaskToShift( &p_vout->output.i_lgshift, &p_vout->output.i_rgshift,
+ p_vout->output.i_gmask );
+ MaskToShift( &p_vout->output.i_lbshift, &p_vout->output.i_rbshift,
+ p_vout->output.i_bmask );
+
/* Check whether we managed to create direct buffers similar to
* the render buffers, ie same size, chroma and aspect ratio */
if( ( p_vout->output.i_width == p_vout->render.i_width )
PP_RENDERPICTURE[ I_RENDERPICTURES ] = &p_vout->p_picture[ i ];
I_RENDERPICTURES++;
}
-
}
else
{
}
}
+ /* Link pictures back to their heap */
+ for( i = 0 ; i < I_RENDERPICTURES ; i++ )
+ {
+ PP_RENDERPICTURE[ i ]->p_heap = &p_vout->render;
+ }
+
+ for( i = 0 ; i < I_OUTPUTPICTURES ; i++ )
+ {
+ PP_OUTPUTPICTURE[ i ]->p_heap = &p_vout->output;
+ }
+
/* Mark thread as running and return */
p_vout->b_active = 1;
*p_vout->pi_status = THREAD_READY;
*pi_status = i_status;
}
+/* following functions are local */
+
static int ReduceHeight( int i_ratio )
{
int i_dummy = VOUT_ASPECT_FACTOR;
return i_pgcd;
}
+/*****************************************************************************
+ * BinaryLog: computes the base 2 log of a binary value
+ *****************************************************************************
+ * This functions is used by MaskToShift, to get a bit index from a binary
+ * value.
+ *****************************************************************************/
+static int BinaryLog(u32 i)
+{
+ int i_log = 0;
+
+ if(i & 0xffff0000) i_log += 16;
+ if(i & 0xff00ff00) i_log += 8;
+ if(i & 0xf0f0f0f0) i_log += 4;
+ if(i & 0xcccccccc) i_log += 2;
+ if(i & 0xaaaaaaaa) i_log += 1;
+
+ if (i != ((u32)1 << i_log))
+ {
+ intf_ErrMsg( "vout error: binary log overflow for %i", i );
+ }
+
+ return( i_log );
+}
+
+/*****************************************************************************
+ * MaskToShift: transform a color mask into right and left shifts
+ *****************************************************************************
+ * This function is used for obtaining color shifts from masks.
+ *****************************************************************************/
+static void MaskToShift( int *pi_left, int *pi_right, u32 i_mask )
+{
+ u32 i_low, i_high; /* lower hand higher bits of the mask */
+
+ if( !i_mask )
+ {
+ *pi_left = *pi_right = 0;
+ return;
+ }
+
+ /* Get bits */
+ i_low = i_mask & (- i_mask); /* lower bit of the mask */
+ i_high = i_mask + i_low; /* higher bit of the mask */
+
+ /* Transform bits into an index */
+ i_low = BinaryLog (i_low);
+ i_high = BinaryLog (i_high);
+
+ /* Update pointers and return */
+ *pi_left = i_low;
+ *pi_right = (8 - i_high + i_low);
+}
+
* vout_pictures.c : picture management functions
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.18 2002/02/27 18:19:21 sam Exp $
+ * $Id: vout_pictures.c,v 1.19 2002/03/16 23:03:19 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width * 2;
p_pic->p->i_pixel_bytes = 2;
- p_pic->p->i_red_mask = 0x001f;
- p_pic->p->i_green_mask = 0x03e0;
- p_pic->p->i_blue_mask = 0x7c00;
+ p_pic->p_heap->i_rmask = 0x001f;
+ p_pic->p_heap->i_gmask = 0x03e0;
+ p_pic->p_heap->i_bmask = 0x7c00;
p_pic->i_planes = 1;
break;
p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width * 2;
p_pic->p->i_pixel_bytes = 2;
- p_pic->p->i_red_mask = 0x001f;
- p_pic->p->i_green_mask = 0x07e0;
- p_pic->p->i_blue_mask = 0xf800;
+ p_pic->p_heap->i_rmask = 0x001f;
+ p_pic->p_heap->i_gmask = 0x07e0;
+ p_pic->p_heap->i_bmask = 0xf800;
p_pic->i_planes = 1;
break;
p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width * 4;
p_pic->p->i_pixel_bytes = 4;
- p_pic->p->i_red_mask = 0xff0000;
- p_pic->p->i_green_mask = 0x00ff00;
- p_pic->p->i_blue_mask = 0x0000ff;
+ p_pic->p_heap->i_rmask = 0xff0000;
+ p_pic->p_heap->i_gmask = 0x00ff00;
+ p_pic->p_heap->i_bmask = 0x0000ff;
p_pic->i_planes = 1;
break;