Commit 2f4af9df authored by Sam Hocevar's avatar Sam Hocevar

  * ./configure.in: more modules are plugins.
  * ./src/misc/configuration.c: changed ~/.VideoLan/vlc to ~/.videolan/vlcrc,
    and a few cosmetic changes (sorry Gildas for the butchery).
  * ./plugins/chroma/i420_rgb16.c: C version of the I420 to RV15/16 chroma.
parent 278bc72e
......@@ -5454,8 +5454,8 @@ case x"${target_cpu}" in
;;
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"
......
......@@ -444,8 +444,8 @@ esac
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
......@@ -810,7 +810,7 @@ AC_ARG_WITH(dvdcss,
;;
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"
......@@ -838,7 +838,7 @@ AC_ARG_WITH(dvdcss,
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"
......@@ -912,19 +912,19 @@ AC_ARG_ENABLE(vcd,
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
......
......@@ -47,6 +47,10 @@
* 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
*****************************************************************************/
......
......@@ -88,6 +88,12 @@
/* 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
......@@ -121,12 +127,6 @@
/* 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
......
......@@ -4,7 +4,7 @@
* 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>
*
......@@ -44,11 +44,6 @@ typedef struct plane_s
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;
/*****************************************************************************
......@@ -84,6 +79,9 @@ typedef struct picture_s
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;
......@@ -96,20 +94,31 @@ typedef struct picture_s
*****************************************************************************/
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
*****************************************************************************/
......@@ -138,6 +147,7 @@ typedef struct picture_heap_s
#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 */
......
......@@ -2,7 +2,7 @@
* 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>
......@@ -485,6 +485,10 @@ int vout_Init( vout_thread_t *p_vout )
* 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 */
......@@ -509,10 +513,6 @@ int vout_Init( vout_thread_t *p_vout )
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;
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -32,6 +32,17 @@ typedef struct chroma_sys_s
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;
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -70,6 +70,12 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
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;
......@@ -104,11 +110,6 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
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
*/
......@@ -122,7 +123,10 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
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) );
......@@ -149,7 +153,10 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
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) );
......@@ -198,6 +205,12 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
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;
......@@ -232,11 +245,6 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
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
*/
......@@ -250,7 +258,10 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
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) );
......@@ -277,7 +288,10 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
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) );
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -34,7 +34,7 @@
#include "video.h"
#include "video_output.h"
#define SRC_FOURCC "I420/IYUV/YV12"
#define SRC_FOURCC "I420,IYUV,YV12"
#define DEST_FOURCC "YMGA"
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -36,12 +36,12 @@
#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
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -38,9 +38,9 @@
#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
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -1045,6 +1045,9 @@ static int NewPictureVec( vout_thread_t *p_vout, picture_t *p_pic,
{
/* 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++ )
{
......@@ -1176,10 +1179,6 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic,
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;
......@@ -1191,10 +1190,6 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic,
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;
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -119,6 +119,9 @@ static int vout_Init( vout_thread_t *p_vout )
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;
......@@ -270,9 +273,6 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
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;
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -275,6 +275,14 @@ static int vout_Init( vout_thread_t *p_vout )
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;
......@@ -326,14 +334,6 @@ static int vout_Init( vout_thread_t *p_vout )
* 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;
......
......@@ -2,7 +2,7 @@
* 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>
......@@ -173,6 +173,11 @@ int vout_Init( vout_thread_t *p_vout )
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 */
......@@ -214,11 +219,6 @@ int vout_Init( vout_thread_t *p_vout )
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;
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -146,6 +146,11 @@ int vout_Init( vout_thread_t *p_vout )
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;
......@@ -179,10 +184,6 @@ int vout_Init( vout_thread_t *p_vout )
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;
......
......@@ -686,23 +686,23 @@ static int QNXInitDisplay( p_vout_thread_t p_vout )
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;
}
......
......@@ -2,7 +2,7 @@
* 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>
......@@ -70,9 +70,6 @@ typedef struct vout_sys_s
/* 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;
......@@ -648,7 +645,7 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
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;
......@@ -657,10 +654,10 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
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" );
......@@ -669,9 +666,9 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
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)" );
......@@ -750,10 +747,6 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
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;
......
......@@ -2,7 +2,7 @@
* 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>
......@@ -155,9 +155,6 @@ typedef struct vout_sys_s
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 */
......@@ -432,21 +429,35 @@ static int vout_Init( vout_thread_t *p_vout )
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 );
......@@ -1276,10 +1287,6 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
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;
......@@ -1292,10 +1299,6 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
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;
......@@ -1320,10 +1323,6 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
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;
......@@ -1347,10 +1346,6 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
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;
......@@ -2074,9 +2069,10 @@ static int InitDisplay( vout_thread_t *p_vout )
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
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
* 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>
*
......@@ -49,7 +49,10 @@ static void RunThread ( vout_thread_t *p_vout );
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.
......@@ -133,15 +136,31 @@ vout_thread_t * vout_CreateThread ( int *pi_status,
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;
......@@ -260,7 +279,7 @@ static int InitThread( vout_thread_t *p_vout )
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 );
......@@ -294,6 +313,14 @@ static int InitThread( vout_thread_t *p_vout )
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 )
......@@ -316,7 +343,6 @@ static int InitThread( vout_thread_t *p_vout )
PP_RENDERPICTURE[ I_RENDERPICTURES ] = &p_vout->p_picture[ i ];
I_RENDERPICTURES++;
}
}
else
{
......@@ -374,6 +400,17 @@ static int InitThread( vout_thread_t *p_vout )
}
}
/* 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;
......@@ -685,6 +722,8 @@ static void DestroyThread( vout_thread_t *p_vout, int i_status )
*pi_status = i_status;
}
/* following functions are local */
static int ReduceHeight( int i_ratio )
{
int i_dummy = VOUT_ASPECT_FACTOR;
......@@ -720,3 +759,55 @@ static int ReduceHeight( int i_ratio )
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);
}
......@@ -2,7 +2,7 @@
* 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>
......@@ -465,9 +465,9 @@ void vout_AllocatePicture( picture_t *p_pic,
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;
......@@ -475,9 +475,9 @@ void vout_AllocatePicture( picture_t *p_pic,
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;
......@@ -485,9 +485,9 @@ void vout_AllocatePicture( picture_t *p_pic,
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment