Commit 00ac3ff5 authored by Sam Hocevar's avatar Sam Hocevar

  * ./plugins/chroma/i420_rgb16.c: 24/32 bpp software YUV.
  * ./plugins/ggi/ggi.c: activated double buffering.
  * ./src/video_output/vout_pictures.c: we create more Xv pictures to
    get smoother rendering.
parent 38573f3b
...@@ -3,7 +3,7 @@ Section: graphics ...@@ -3,7 +3,7 @@ Section: graphics
Priority: optional Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org> Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>=2.2.0), Build-Depends: debhelper (>=2.2.0),
xlibs-dev, xlibs-dev, xlibs-pic
libgnome-dev, libgnome-dev,
libggi2-dev, libggi2-dev,
libglide2-dev [i386], libglide2-dev [i386],
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc * i420_rgb.c : YUV to bitmap RGB conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: i420_rgb.c,v 1.1 2002/01/04 14:01:34 sam Exp $ * $Id: i420_rgb.c,v 1.2 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -151,7 +151,6 @@ static int chroma_Init( vout_thread_t *p_vout ) ...@@ -151,7 +151,6 @@ static int chroma_Init( vout_thread_t *p_vout )
break; break;
case FOURCC_BI_BITFIELDS: case FOURCC_BI_BITFIELDS:
//p_vout->chroma.pf_convert = _M( I420_RGB24 );
p_vout->chroma.pf_convert = _M( I420_RGB32 ); p_vout->chroma.pf_convert = _M( I420_RGB32 );
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* i420_rgb.h : YUV to bitmap RGB conversion module for vlc * i420_rgb.h : YUV to bitmap RGB conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: i420_rgb.h,v 1.1 2002/01/04 14:01:34 sam Exp $ * $Id: i420_rgb.h,v 1.2 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -41,7 +41,6 @@ typedef struct chroma_sys_s ...@@ -41,7 +41,6 @@ typedef struct chroma_sys_s
void _M( I420_RGB8 ) ( vout_thread_t *, picture_t *, picture_t * ); void _M( I420_RGB8 ) ( vout_thread_t *, picture_t *, picture_t * );
#endif #endif
void _M( I420_RGB16 )( vout_thread_t *, picture_t *, picture_t * ); void _M( I420_RGB16 )( vout_thread_t *, picture_t *, picture_t * );
void _M( I420_RGB24 )( vout_thread_t *, picture_t *, picture_t * );
void _M( I420_RGB32 )( vout_thread_t *, picture_t *, picture_t * ); void _M( I420_RGB32 )( vout_thread_t *, picture_t *, picture_t * );
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* i420_rgb16.c : YUV to bitmap RGB conversion module for vlc * i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: i420_rgb16.c,v 1.1 2002/01/04 14:01:34 sam Exp $ * $Id: i420_rgb16.c,v 1.2 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -171,24 +171,132 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src, ...@@ -171,24 +171,132 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
} }
} }
/*****************************************************************************
* I420_RGB24: color YUV 4:2:0 to RGB 24 bpp
*****************************************************************************/
void _M( I420_RGB24 )( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
{
intf_ErrMsg( "vout error: I420_RGB24 unimplemented, "
"please harass sam@zoy.org" );
}
/***************************************************************************** /*****************************************************************************
* I420_RGB32: color YUV 4:2:0 to RGB 32 bpp * I420_RGB32: color YUV 4:2:0 to RGB 32 bpp
*****************************************************************************
* Horizontal alignment needed:
* - input: 8 pixels (8 Y bytes, 4 U/V bytes), margins not allowed
* - output: 1 pixel (2 bytes), margins allowed
* Vertical alignment needed:
* - input: 2 lines (2 Y lines, 1 U/V line)
* - output: 1 line
*****************************************************************************/ *****************************************************************************/
void _M( I420_RGB32 )( vout_thread_t *p_vout, picture_t *p_src, void _M( I420_RGB32 )( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest ) picture_t *p_dest )
{ {
/* We got this one from the old arguments */
u32 *p_pic = (u32*)p_dest->p->p_pixels;
u8 *p_y = p_src->Y_PIXELS;
u8 *p_u = p_src->U_PIXELS;
u8 *p_v = p_src->V_PIXELS;
boolean_t b_hscale; /* horizontal scaling type */
int i_vscale; /* vertical scaling type */
int i_x, i_y; /* horizontal and vertical indexes */
int i_right_margin;
int i_rewind;
int i_scale_count; /* scale modulo counter */
int i_chroma_width = p_vout->render.i_width / 2; /* chroma width */
u32 * p_pic_start; /* beginning of the current line for copy */
/* Conversion buffer pointer */
u32 * p_buffer_start = (u32*)p_vout->chroma.p_sys->p_buffer;
u32 * p_buffer;
/* Offset array pointer */
int * p_offset_start = p_vout->chroma.p_sys->p_offset;
int * p_offset;
if( p_dest->p->b_margin )
{
i_right_margin = (p_dest->p->i_pitch - p_dest->p->i_visible_bytes) / 2;
}
else
{
i_right_margin = 0;
}
if( p_vout->render.i_width & 7 )
{
i_rewind = 8 - ( p_vout->render.i_width & 7 );
}
else
{
i_rewind = 0;
}
/* Rule: when a picture of size (x1,y1) with aspect ratio r1 is rendered
* on a picture of size (x2,y2) with aspect ratio r2, if x1 grows to x1'
* then y1 grows to y1' = x1' * y2/x2 * r2/r1 */
SetOffset( p_vout->render.i_width, p_vout->render.i_height,
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_RGB32 unimplemented, " intf_ErrMsg( "vout error: I420_RGB32 unimplemented, "
"please harass sam@zoy.org" ); "please harass sam@zoy.org" );
#endif
/*
* Perform conversion
*/
i_scale_count = ( i_vscale == 1 ) ?
p_vout->output.i_height : p_vout->render.i_height;
for( i_y = 0; i_y < p_vout->render.i_height; i_y++ )
{
p_pic_start = p_pic;
p_buffer = b_hscale ? p_buffer_start : p_pic;
for ( i_x = p_vout->render.i_width / 8; i_x--; )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
/* FIXME: TODO */
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_32
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
__asm__( ".align 8"
MMX_YUV_MUL
MMX_YUV_ADD
MMX_UNPACK_32
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
p_y += 8;
p_u += 4;
p_v += 4;
p_buffer += 8;
#endif
}
/* Here we do some unaligned reads and duplicate conversions, but
* at least we have all the pixels */
if( i_rewind )
{
p_y -= i_rewind;
p_u -= i_rewind >> 1;
p_v -= i_rewind >> 1;
p_buffer -= i_rewind;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
/* FIXME: TODO */
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_32
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
__asm__( ".align 8"
MMX_YUV_MUL
MMX_YUV_ADD
MMX_UNPACK_32
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
p_y += 8;
p_u += 4;
p_v += 4;
p_buffer += 8;
#endif
}
SCALE_WIDTH;
SCALE_HEIGHT( 420, 4 );
}
} }
/* Following functions are local */ /* Following functions are local */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* i420_rgb8.c : YUV to bitmap RGB conversion module for vlc * i420_rgb8.c : YUV to bitmap RGB conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: i420_rgb8.c,v 1.1 2002/01/04 14:01:34 sam Exp $ * $Id: i420_rgb8.c,v 1.2 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -76,6 +76,7 @@ void _M( I420_RGB8 )( vout_thread_t *p_vout, picture_t *p_source, ...@@ -76,6 +76,7 @@ void _M( I420_RGB8 )( vout_thread_t *p_vout, picture_t *p_source,
&b_hscale, &i_vscale, p_offset_start ); &b_hscale, &i_vscale, p_offset_start );
/* FIXME */ /* FIXME */
#warning "Please ignore the following warnings, I already know about them"
intf_ErrMsg( "vout error: I420_RGB8 unimplemented, " intf_ErrMsg( "vout error: I420_RGB8 unimplemented, "
"please harass sam@zoy.org" ); "please harass sam@zoy.org" );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_dummy.c: Dummy video output display method for testing purposes * vout_dummy.c: Dummy video output display method for testing purposes
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_dummy.c,v 1.16 2002/01/05 03:49:18 sam Exp $ * $Id: vout_dummy.c,v 1.17 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define DUMMY_WIDTH 16 #define DUMMY_WIDTH 16
#define DUMMY_HEIGHT 16 #define DUMMY_HEIGHT 16
#define DUMMY_MAX_DIRECTBUFFERS 5 #define DUMMY_MAX_DIRECTBUFFERS 10
/***************************************************************************** /*****************************************************************************
* vout_sys_t: dummy video output method descriptor * vout_sys_t: dummy video output method descriptor
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* fb.c : framebuffer plugin for vlc * fb.c : framebuffer plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: fb.c,v 1.11 2002/01/06 00:07:37 sam Exp $ * $Id: fb.c,v 1.12 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -60,7 +60,6 @@ static void vout_End ( vout_thread_t * ); ...@@ -60,7 +60,6 @@ static void vout_End ( vout_thread_t * );
static int OpenDisplay ( vout_thread_t * ); static int OpenDisplay ( vout_thread_t * );
static void CloseDisplay ( vout_thread_t * ); static void CloseDisplay ( vout_thread_t * );
static int NewPicture ( vout_thread_t *, picture_t * );
static void SwitchDisplay ( int i_signal ); static void SwitchDisplay ( int i_signal );
static void TextMode ( int i_tty ); static void TextMode ( int i_tty );
static void GfxMode ( int i_tty ); static void GfxMode ( int i_tty );
...@@ -292,7 +291,7 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -292,7 +291,7 @@ static int vout_Init( vout_thread_t *p_vout )
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break; p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
default: default:
intf_ErrMsg( "vout error: unknown screen depth" ); intf_ErrMsg( "vout error: unknown screen depth" );
return( 0 ); return 0;
} }
p_vout->output.i_width = p_vout->p_sys->i_width; p_vout->output.i_width = p_vout->p_sys->i_width;
...@@ -305,9 +304,7 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -305,9 +304,7 @@ static int vout_Init( vout_thread_t *p_vout )
/* Clear the screen */ /* Clear the screen */
memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size ); memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
/* Try to initialize up to 1 direct buffers */ /* Try to initialize 1 direct buffer */
while( I_OUTPUTPICTURES < 1 )
{
p_pic = NULL; p_pic = NULL;
/* Find an empty picture slot */ /* Find an empty picture slot */
...@@ -321,18 +318,49 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -321,18 +318,49 @@ static int vout_Init( vout_thread_t *p_vout )
} }
/* Allocate the picture */ /* Allocate the picture */
if( p_pic == NULL || NewPicture( p_vout, p_pic ) ) if( p_pic == NULL )
{ {
break; return 0;
} }
/* We know the chroma, allocate a buffer which will be used
* directly by the decoder */
p_pic->p->p_pixels = p_vout->p_sys->p_video;
p_pic->p->i_pixel_bytes = p_vout->p_sys->i_bytes_per_pixel;
p_pic->p->i_lines = p_vout->p_sys->var_info.yres;
if( p_vout->p_sys->var_info.xres_virtual )
{
p_pic->p->b_margin = 1;
p_pic->p->b_hidden = 1;
p_pic->p->i_pitch = p_vout->p_sys->var_info.xres_virtual
* p_vout->p_sys->i_bytes_per_pixel;
p_pic->p->i_visible_bytes = p_vout->p_sys->var_info.xres
* p_vout->p_sys->i_bytes_per_pixel;
}
else
{
p_pic->p->b_margin = 0;
p_pic->p->i_pitch = p_vout->p_sys->var_info.xres
* 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; p_pic->i_status = DESTROYED_PICTURE;
p_pic->i_type = DIRECT_PICTURE; p_pic->i_type = DIRECT_PICTURE;
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic; PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
I_OUTPUTPICTURES++; I_OUTPUTPICTURES++;
}
return( 0 ); return( 0 );
} }
...@@ -647,48 +675,6 @@ static void CloseDisplay( vout_thread_t *p_vout ) ...@@ -647,48 +675,6 @@ static void CloseDisplay( vout_thread_t *p_vout )
close( p_vout->p_sys->i_fd ); close( p_vout->p_sys->i_fd );
} }
/*****************************************************************************
* NewPicture: allocate a picture
*****************************************************************************
* Returns 0 on success, -1 otherwise
*****************************************************************************/
static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
/* We know the chroma, allocate a buffer which will be used
* directly by the decoder */
p_pic->p->p_pixels = p_vout->p_sys->p_video;
p_pic->p->i_pixel_bytes = p_vout->p_sys->i_bytes_per_pixel;
p_pic->p->i_lines = p_vout->p_sys->var_info.yres;
if( p_vout->p_sys->var_info.xres_virtual )
{
p_pic->p->b_margin = 1;
p_pic->p->b_hidden = 1;
p_pic->p->i_pitch = p_vout->p_sys->var_info.xres_virtual
* p_vout->p_sys->i_bytes_per_pixel;
p_pic->p->i_visible_bytes = p_vout->p_sys->var_info.xres
* p_vout->p_sys->i_bytes_per_pixel;
}
else
{
p_pic->p->b_margin = 0;
p_pic->p->i_pitch = p_vout->p_sys->var_info.xres
* 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;
return 0;
}
/***************************************************************************** /*****************************************************************************
* SwitchDisplay: VT change signal handler * SwitchDisplay: VT change signal handler
***************************************************************************** *****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ggi.c : GGI plugin for vlc * ggi.c : GGI plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: ggi.c,v 1.11 2002/01/07 02:12:29 sam Exp $ * $Id: ggi.c,v 1.12 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -55,7 +55,6 @@ static void vout_Display ( vout_thread_t *, picture_t * ); ...@@ -55,7 +55,6 @@ static void vout_Display ( vout_thread_t *, picture_t * );
static int OpenDisplay ( vout_thread_t * ); static int OpenDisplay ( vout_thread_t * );
static void CloseDisplay ( vout_thread_t * ); static void CloseDisplay ( vout_thread_t * );
static int NewPicture ( vout_thread_t *, picture_t * );
/***************************************************************************** /*****************************************************************************
* Building configuration tree * Building configuration tree
...@@ -91,7 +90,7 @@ typedef struct vout_sys_s ...@@ -91,7 +90,7 @@ typedef struct vout_sys_s
int i_bits_per_pixel; int i_bits_per_pixel;
/* Buffer information */ /* Buffer information */
ggi_directbuffer * p_buffer[2]; /* buffers */ ggi_directbuffer * pp_buffer[2]; /* buffers */
int i_index; int i_index;
boolean_t b_must_acquire; /* must be acquired before writing */ boolean_t b_must_acquire; /* must be acquired before writing */
...@@ -162,6 +161,8 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -162,6 +161,8 @@ int vout_Init( vout_thread_t *p_vout )
int i_index; int i_index;
picture_t *p_pic; picture_t *p_pic;
I_OUTPUTPICTURES = 0;
p_vout->output.i_width = p_vout->p_sys->mode.visible.x; p_vout->output.i_width = p_vout->p_sys->mode.visible.x;
p_vout->output.i_height = p_vout->p_sys->mode.visible.y; p_vout->output.i_height = p_vout->p_sys->mode.visible.y;
p_vout->output.i_aspect = p_vout->p_sys->mode.visible.x p_vout->output.i_aspect = p_vout->p_sys->mode.visible.x
...@@ -182,14 +183,9 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -182,14 +183,9 @@ int vout_Init( vout_thread_t *p_vout )
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break; p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
default: default:
intf_ErrMsg( "vout error: unknown screen depth" ); intf_ErrMsg( "vout error: unknown screen depth" );
return( 0 ); return 0;
} }
I_OUTPUTPICTURES = 0;
/* Try to initialize up to 1 direct buffers */
while( I_OUTPUTPICTURES < 1 )
{
p_pic = NULL; p_pic = NULL;
/* Find an empty picture slot */ /* Find an empty picture slot */
...@@ -202,23 +198,49 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -202,23 +198,49 @@ int vout_Init( vout_thread_t *p_vout )
} }
} }
/* Allocate the picture */ if( p_pic == NULL )
if( p_pic == NULL || NewPicture( p_vout, p_pic ) )
{ {
break; return 0;
}
#define p_b p_vout->p_sys->pp_buffer
/* We know the chroma, allocate a buffer which will be used
* directly by the decoder */
p_vout->p_sys->i_index = 0;
p_pic->p->p_pixels = p_b[ 0 ]->write;
p_pic->p->i_pixel_bytes = p_b[ 0 ]->buffer.plb.pixelformat->size / 8;
p_pic->p->i_lines = p_vout->p_sys->mode.visible.y;
if( p_b[ 0 ]->buffer.plb.pixelformat->size / 8
* p_vout->p_sys->mode.visible.x
!= p_b[ 0 ]->buffer.plb.stride )
{
p_pic->p->b_margin = 1;
p_pic->p->b_hidden = 1;
p_pic->p->i_pitch = p_b[ 0 ]->buffer.plb.stride;
p_pic->p->i_visible_bytes = p_b[ 0 ]->buffer.plb.pixelformat->size
/ 8 * p_vout->p_sys->mode.visible.x;
}
else
{
p_pic->p->b_margin = 0;
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; p_pic->i_status = DESTROYED_PICTURE;
p_pic->i_type = DIRECT_PICTURE; p_pic->i_type = DIRECT_PICTURE;
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic; PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
I_OUTPUTPICTURES++; I_OUTPUTPICTURES++;
}
return( 0 );
#if 0
#define p_b p_vout->p_sys->p_buffer
/* Acquire first buffer */ /* Acquire first buffer */
if( p_vout->p_sys->b_must_acquire ) if( p_vout->p_sys->b_must_acquire )
{ {
...@@ -235,7 +257,6 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -235,7 +257,6 @@ int vout_Init( vout_thread_t *p_vout )
return( 0 ); return( 0 );
#undef p_b #undef p_b
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -245,11 +266,11 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -245,11 +266,11 @@ int vout_Init( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
void vout_End( vout_thread_t *p_vout ) void vout_End( vout_thread_t *p_vout )
{ {
#define p_b p_vout->p_sys->p_buffer #define p_b p_vout->p_sys->pp_buffer
/* Release buffer */ /* Release buffer */
if( p_vout->p_sys->b_must_acquire ) if( p_vout->p_sys->b_must_acquire )
{ {
ggiResourceRelease( p_b[ 0 ]->resource ); ggiResourceRelease( p_b[ p_vout->p_sys->i_index ]->resource );
} }
#undef p_b #undef p_b
} }
...@@ -336,23 +357,28 @@ void vout_Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -336,23 +357,28 @@ void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
*****************************************************************************/ *****************************************************************************/
void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{ {
#define p_b p_vout->p_sys->p_buffer #define p_b p_vout->p_sys->pp_buffer
p_pic->p->p_pixels = p_b[ p_vout->p_sys->i_index ]->write;
/* Change display frame */ /* Change display frame */
if( p_vout->p_sys->b_must_acquire ) if( p_vout->p_sys->b_must_acquire )
{ {
ggiResourceRelease( p_b[ 0 ]->resource ); ggiResourceRelease( p_b[ p_vout->p_sys->i_index ]->resource );
} }
ggiSetDisplayFrame( p_vout->p_sys->p_display, ggiSetDisplayFrame( p_vout->p_sys->p_display,
p_b[ 0 ]->frame ); p_b[ p_vout->p_sys->i_index ]->frame );
/* Swap buffers and change write frame */ /* Swap buffers and change write frame */
p_vout->p_sys->i_index ^= 1;
p_pic->p->p_pixels = p_b[ p_vout->p_sys->i_index ]->write;
if( p_vout->p_sys->b_must_acquire ) if( p_vout->p_sys->b_must_acquire )
{ {
ggiResourceAcquire( p_b[ 0 ]->resource, ggiResourceAcquire( p_b[ p_vout->p_sys->i_index ]->resource,
GGI_ACTYPE_WRITE ); GGI_ACTYPE_WRITE );
} }
ggiSetWriteFrame( p_vout->p_sys->p_display, ggiSetWriteFrame( p_vout->p_sys->p_display,
p_b[ 0 ]->frame ); p_b[ p_vout->p_sys->i_index ]->frame );
/* Flush the output so that it actually displays */ /* Flush the output so that it actually displays */
ggiFlush( p_vout->p_sys->p_display ); ggiFlush( p_vout->p_sys->p_display );
...@@ -369,7 +395,7 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -369,7 +395,7 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
*****************************************************************************/ *****************************************************************************/
static int OpenDisplay( vout_thread_t *p_vout ) static int OpenDisplay( vout_thread_t *p_vout )
{ {
#define p_b p_vout->p_sys->p_buffer #define p_b p_vout->p_sys->pp_buffer
ggi_color col_fg; /* foreground color */ ggi_color col_fg; /* foreground color */
ggi_color col_bg; /* background color */ ggi_color col_bg; /* background color */
int i_index; /* all purposes index */ int i_index; /* all purposes index */
...@@ -425,7 +451,7 @@ static int OpenDisplay( vout_thread_t *p_vout ) ...@@ -425,7 +451,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
for( i_index = 0; i_index < 2; i_index++ ) for( i_index = 0; i_index < 2; i_index++ )
{ {
/* Get buffer address */ /* Get buffer address */
p_vout->p_sys->p_buffer[ i_index ] = p_vout->p_sys->pp_buffer[ i_index ] =
(ggi_directbuffer *)ggiDBGetBuffer( p_vout->p_sys->p_display, (ggi_directbuffer *)ggiDBGetBuffer( p_vout->p_sys->p_display,
i_index ); i_index );
if( p_b[ i_index ] == NULL ) if( p_b[ i_index ] == NULL )
...@@ -508,44 +534,3 @@ static void CloseDisplay( vout_thread_t *p_vout ) ...@@ -508,44 +534,3 @@ static void CloseDisplay( vout_thread_t *p_vout )
ggiExit(); ggiExit();
} }
/*****************************************************************************
* NewPicture: allocate a picture
*****************************************************************************
* Returns 0 on success, -1 otherwise
*****************************************************************************/
static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
#define p_b p_vout->p_sys->p_buffer
/* We know the chroma, allocate a buffer which will be used
* directly by the decoder */
p_pic->p->p_pixels = p_b[ 0 ]->write;
p_pic->p->i_pixel_bytes = p_b[ 0 ]->buffer.plb.pixelformat->size / 8;
p_pic->p->i_lines = p_vout->p_sys->mode.visible.y;
if( p_b[ 0 ]->buffer.plb.pixelformat->size / 8
* p_vout->p_sys->mode.visible.x
!= p_b[ 0 ]->buffer.plb.stride )
{
p_pic->p->b_margin = 1;
p_pic->p->b_hidden = 1;
p_pic->p->i_pitch = p_b[ 0 ]->buffer.plb.stride;
p_pic->p->i_visible_bytes = p_b[ 0 ]->buffer.plb.pixelformat->size / 8
* p_vout->p_sys->mode.visible.x;
}
else
{
p_pic->p->b_margin = 0;
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;
return 0;
#undef p_b
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method * vout_sdl.c: SDL video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: vout_sdl.c,v 1.79 2002/01/07 02:12:29 sam Exp $ * $Id: vout_sdl.c,v 1.80 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org> * Pierre Baillet <oct@zoy.org>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include "stream_control.h" /* needed by input_ext-intf.h... */ #include "stream_control.h" /* needed by input_ext-intf.h... */
#include "input_ext-intf.h" #include "input_ext-intf.h"
#define SDL_MAX_DIRECTBUFFERS 5 #define SDL_MAX_DIRECTBUFFERS 10
#define SDL_DEFAULT_BPP 16 #define SDL_DEFAULT_BPP 16
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins * xcommon.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.10 2002/01/10 04:11:25 sam Exp $ * $Id: xcommon.c,v 1.11 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -212,7 +212,7 @@ typedef struct mwmhints_s ...@@ -212,7 +212,7 @@ typedef struct mwmhints_s
* Chroma defines * Chroma defines
*****************************************************************************/ *****************************************************************************/
#ifdef MODULE_NAME_IS_xvideo #ifdef MODULE_NAME_IS_xvideo
# define MAX_DIRECTBUFFERS 5 # define MAX_DIRECTBUFFERS 10
#else #else
# define MAX_DIRECTBUFFERS 2 # define MAX_DIRECTBUFFERS 2
#endif #endif
...@@ -611,9 +611,10 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -611,9 +611,10 @@ static int vout_Manage( vout_thread_t *p_vout )
== True ) == True )
{ {
/* ConfigureNotify event: prepare */ /* ConfigureNotify event: prepare */
if( (xevent.type == ConfigureNotify) if( xevent.type == ConfigureNotify )
&& ((xevent.xconfigure.width != p_vout->p_sys->i_width) {
|| (xevent.xconfigure.height != p_vout->p_sys->i_height)) ) if( (xevent.xconfigure.width != p_vout->p_sys->i_width)
|| (xevent.xconfigure.height != p_vout->p_sys->i_height) )
{ {
/* Update dimensions */ /* Update dimensions */
b_resized = 1; b_resized = 1;
...@@ -621,6 +622,7 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -621,6 +622,7 @@ static int vout_Manage( vout_thread_t *p_vout )
p_vout->p_sys->i_width = xevent.xconfigure.width; p_vout->p_sys->i_width = xevent.xconfigure.width;
p_vout->p_sys->i_height = xevent.xconfigure.height; p_vout->p_sys->i_height = xevent.xconfigure.height;
} }
}
/* MapNotify event: change window status and disable screen saver */ /* MapNotify event: change window status and disable screen saver */
else if( xevent.type == MapNotify) else if( xevent.type == MapNotify)
{ {
...@@ -766,6 +768,11 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -766,6 +768,11 @@ static int vout_Manage( vout_thread_t *p_vout )
ToggleCursor( p_vout ); ToggleCursor( p_vout );
} }
} }
/* Reparent move -- XXX: why are we getting this ? */
else if( xevent.type == ReparentNotify )
{
;
}
/* Other event */ /* Other event */
else else
{ {
...@@ -1352,6 +1359,33 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1352,6 +1359,33 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
p_pic->i_planes = 1; p_pic->i_planes = 1;
break;
case FOURCC_BI_BITFIELDS:
p_pic->p->p_pixels = p_pic->p_sys->p_image->data
+ p_pic->p_sys->p_image->xoffset;
p_pic->p->i_lines = p_pic->p_sys->p_image->height;
p_pic->p->i_pitch = p_pic->p_sys->p_image->bytes_per_line;
p_pic->p->i_pixel_bytes = p_pic->p_sys->p_image->depth;
if( p_pic->p->i_pitch == 4 * p_pic->p_sys->p_image->width )
{
p_pic->p->b_margin = 0;
}
else
{
p_pic->p->b_margin = 1;
p_pic->p->b_hidden = 1;
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; break;
#endif #endif
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.155 2002/01/07 02:12:30 sam Exp $ * $Id: video_output.c,v 1.156 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -332,7 +332,8 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -332,7 +332,8 @@ static int InitThread( vout_thread_t *p_vout )
if( p_vout->chroma.p_module == NULL ) if( p_vout->chroma.p_module == NULL )
{ {
intf_ErrMsg( "vout error: no suitable chroma module" ); intf_ErrMsg( "vout error: no chroma module for %4.4s to %4.4s",
&p_vout->render.i_chroma, &p_vout->output.i_chroma );
p_vout->pf_end( p_vout ); p_vout->pf_end( p_vout );
vlc_mutex_unlock( &p_vout->change_lock ); vlc_mutex_unlock( &p_vout->change_lock );
return( 1 ); return( 1 );
...@@ -352,10 +353,19 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -352,10 +353,19 @@ static int InitThread( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
if( I_OUTPUTPICTURES < VOUT_MAX_PICTURES )
{
intf_WarnMsg( 2, "vout info: indirect render, mapping " intf_WarnMsg( 2, "vout info: indirect render, mapping "
"render pictures %i-%i to system pictures %i-%i", "render pictures %i-%i to system pictures %i-%i",
I_OUTPUTPICTURES - 1, VOUT_MAX_PICTURES - 2, I_OUTPUTPICTURES - 1, VOUT_MAX_PICTURES - 2,
I_OUTPUTPICTURES, VOUT_MAX_PICTURES - 1 ); I_OUTPUTPICTURES, VOUT_MAX_PICTURES - 1 );
}
else
{
intf_WarnMsg( 2, "vout info: indirect render, no system "
"pictures needed, we have %i directbuffers",
I_OUTPUTPICTURES );
}
/* Append render buffers after the direct buffers */ /* Append render buffers after the direct buffers */
for( i = I_OUTPUTPICTURES; i < VOUT_MAX_PICTURES; i++ ) for( i = I_OUTPUTPICTURES; i < VOUT_MAX_PICTURES; i++ )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions * vout_pictures.c : picture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: vout_pictures.c,v 1.9 2002/01/05 02:22:03 sam Exp $ * $Id: vout_pictures.c,v 1.10 2002/01/12 01:25:57 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -134,10 +134,11 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, ...@@ -134,10 +134,11 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
{ {
p_pic = PP_RENDERPICTURE[ i_pic ]; p_pic = PP_RENDERPICTURE[ i_pic ];
/* If the picture we found is a memory buffer, and we might have /* If the picture we found is a memory buffer, and we have enough
* enough room later for a direct buffer, skip it. If no other * pictures in the stack, and we might have enough room later for
* pictures are found, the video decoder will try again later. */ * a direct buffer, skip it. If no other pictures are found, the
if( p_vout->b_direct && ( p_vout->output.i_pictures > 3 ) * video decoder will try again later. */
if( p_vout->b_direct && ( p_vout->output.i_pictures > 5 )
&& ( p_pic->i_type != DIRECT_PICTURE ) ) && ( p_pic->i_type != DIRECT_PICTURE ) )
{ {
break; 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