* ./plugins/ggi/ggi.c: activated double buffering.
* ./src/video_output/vout_pictures.c: we create more Xv pictures to
get smoother rendering.
Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>=2.2.0),
- xlibs-dev,
+ xlibs-dev, xlibs-pic
libgnome-dev,
libggi2-dev,
libglide2-dev [i386],
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* 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>
*
break;
case FOURCC_BI_BITFIELDS:
- //p_vout->chroma.pf_convert = _M( I420_RGB24 );
p_vout->chroma.pf_convert = _M( I420_RGB32 );
break;
* i420_rgb.h : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* 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>
*
void _M( I420_RGB8 ) ( vout_thread_t *, picture_t *, picture_t * );
#endif
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 * );
/*****************************************************************************
* i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* 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>
*
}
}
-/*****************************************************************************
- * 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
+ *****************************************************************************
+ * 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,
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, "
"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 */
* i420_rgb8.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* 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>
*
&b_hscale, &i_vscale, p_offset_start );
/* FIXME */
+#warning "Please ignore the following warnings, I already know about them"
intf_ErrMsg( "vout error: I420_RGB8 unimplemented, "
"please harass sam@zoy.org" );
}
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* 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>
*
#define DUMMY_WIDTH 16
#define DUMMY_HEIGHT 16
-#define DUMMY_MAX_DIRECTBUFFERS 5
+#define DUMMY_MAX_DIRECTBUFFERS 10
/*****************************************************************************
* vout_sys_t: dummy video output method descriptor
* fb.c : framebuffer plugin for vlc
*****************************************************************************
* 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>
*
static int OpenDisplay ( 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 TextMode ( int i_tty );
static void GfxMode ( int i_tty );
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
default:
intf_ErrMsg( "vout error: unknown screen depth" );
- return( 0 );
+ return 0;
}
p_vout->output.i_width = p_vout->p_sys->i_width;
/* Clear the screen */
memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
- /* Try to initialize up to 1 direct buffers */
- while( I_OUTPUTPICTURES < 1 )
- {
- p_pic = NULL;
+ /* Try to initialize 1 direct buffer */
+ p_pic = NULL;
- /* Find an empty picture slot */
- for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
- {
- if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
- {
- p_pic = p_vout->p_picture + i_index;
- break;
- }
- }
-
- /* Allocate the picture */
- if( p_pic == NULL || NewPicture( p_vout, p_pic ) )
+ /* Find an empty picture slot */
+ for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
+ {
+ if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
{
+ p_pic = p_vout->p_picture + i_index;
break;
}
+ }
- p_pic->i_status = DESTROYED_PICTURE;
- p_pic->i_type = DIRECT_PICTURE;
+ /* Allocate the picture */
+ if( p_pic == NULL )
+ {
+ return 0;
+ }
- PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = 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;
- I_OUTPUTPICTURES++;
+ 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_type = DIRECT_PICTURE;
+
+ PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
+
+ I_OUTPUTPICTURES++;
+
return( 0 );
}
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
*****************************************************************************
* ggi.c : GGI plugin for vlc
*****************************************************************************
* 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>
* Samuel Hocevar <sam@zoy.org>
static int OpenDisplay ( vout_thread_t * );
static void CloseDisplay ( vout_thread_t * );
-static int NewPicture ( vout_thread_t *, picture_t * );
/*****************************************************************************
* Building configuration tree
int i_bits_per_pixel;
/* Buffer information */
- ggi_directbuffer * p_buffer[2]; /* buffers */
+ ggi_directbuffer * pp_buffer[2]; /* buffers */
int i_index;
boolean_t b_must_acquire; /* must be acquired before writing */
int i_index;
picture_t *p_pic;
+ I_OUTPUTPICTURES = 0;
+
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_aspect = p_vout->p_sys->mode.visible.x
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
default:
intf_ErrMsg( "vout error: unknown screen depth" );
- return( 0 );
+ return 0;
}
- I_OUTPUTPICTURES = 0;
+ p_pic = NULL;
- /* Try to initialize up to 1 direct buffers */
- while( I_OUTPUTPICTURES < 1 )
+ /* Find an empty picture slot */
+ for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
{
- p_pic = NULL;
-
- /* Find an empty picture slot */
- for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
- {
- if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
- {
- p_pic = p_vout->p_picture + i_index;
- break;
- }
- }
-
- /* Allocate the picture */
- if( p_pic == NULL || NewPicture( p_vout, p_pic ) )
+ if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
{
+ p_pic = p_vout->p_picture + i_index;
break;
}
+ }
- p_pic->i_status = DESTROYED_PICTURE;
- p_pic->i_type = DIRECT_PICTURE;
+ if( p_pic == NULL )
+ {
+ return 0;
+ }
- PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
+#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;
- I_OUTPUTPICTURES++;
+ 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;
}
- return( 0 );
-#if 0
-#define p_b p_vout->p_sys->p_buffer
+ /* 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_type = DIRECT_PICTURE;
+
+ PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
+
+ I_OUTPUTPICTURES++;
+
/* Acquire first buffer */
if( p_vout->p_sys->b_must_acquire )
{
return( 0 );
#undef p_b
-#endif
}
/*****************************************************************************
*****************************************************************************/
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 */
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
}
*****************************************************************************/
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 */
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,
- p_b[ 0 ]->frame );
+ p_b[ p_vout->p_sys->i_index ]->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 )
{
- ggiResourceAcquire( p_b[ 0 ]->resource,
+ ggiResourceAcquire( p_b[ p_vout->p_sys->i_index ]->resource,
GGI_ACTYPE_WRITE );
}
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 */
ggiFlush( p_vout->p_sys->p_display );
*****************************************************************************/
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_bg; /* background color */
int i_index; /* all purposes index */
for( i_index = 0; i_index < 2; i_index++ )
{
/* 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,
i_index );
if( p_b[ i_index ] == NULL )
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
-}
-
* vout_sdl.c: SDL video output display method
*****************************************************************************
* 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>
* Pierre Baillet <oct@zoy.org>
#include "stream_control.h" /* needed by input_ext-intf.h... */
#include "input_ext-intf.h"
-#define SDL_MAX_DIRECTBUFFERS 5
+#define SDL_MAX_DIRECTBUFFERS 10
#define SDL_DEFAULT_BPP 16
/*****************************************************************************
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* 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>
* Samuel Hocevar <sam@zoy.org>
* Chroma defines
*****************************************************************************/
#ifdef MODULE_NAME_IS_xvideo
-# define MAX_DIRECTBUFFERS 5
+# define MAX_DIRECTBUFFERS 10
#else
# define MAX_DIRECTBUFFERS 2
#endif
== True )
{
/* ConfigureNotify event: prepare */
- if( (xevent.type == ConfigureNotify)
- && ((xevent.xconfigure.width != p_vout->p_sys->i_width)
- || (xevent.xconfigure.height != p_vout->p_sys->i_height)) )
+ if( xevent.type == ConfigureNotify )
{
- /* Update dimensions */
- b_resized = 1;
- p_vout->i_changes |= VOUT_SIZE_CHANGE;
- p_vout->p_sys->i_width = xevent.xconfigure.width;
- p_vout->p_sys->i_height = xevent.xconfigure.height;
+ if( (xevent.xconfigure.width != p_vout->p_sys->i_width)
+ || (xevent.xconfigure.height != p_vout->p_sys->i_height) )
+ {
+ /* Update dimensions */
+ b_resized = 1;
+ p_vout->i_changes |= VOUT_SIZE_CHANGE;
+ p_vout->p_sys->i_width = xevent.xconfigure.width;
+ p_vout->p_sys->i_height = xevent.xconfigure.height;
+ }
}
/* MapNotify event: change window status and disable screen saver */
else if( xevent.type == MapNotify)
ToggleCursor( p_vout );
}
}
+ /* Reparent move -- XXX: why are we getting this ? */
+ else if( xevent.type == ReparentNotify )
+ {
+ ;
+ }
/* Other event */
else
{
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;
#endif
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* 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>
*
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 );
vlc_mutex_unlock( &p_vout->change_lock );
return( 1 );
return( 1 );
}
- intf_WarnMsg( 2, "vout info: indirect render, mapping "
- "render pictures %i-%i to system pictures %i-%i",
- I_OUTPUTPICTURES - 1, VOUT_MAX_PICTURES - 2,
- I_OUTPUTPICTURES, VOUT_MAX_PICTURES - 1 );
+ if( I_OUTPUTPICTURES < VOUT_MAX_PICTURES )
+ {
+ intf_WarnMsg( 2, "vout info: indirect render, mapping "
+ "render pictures %i-%i to system pictures %i-%i",
+ I_OUTPUTPICTURES - 1, VOUT_MAX_PICTURES - 2,
+ 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 */
for( i = I_OUTPUTPICTURES; i < VOUT_MAX_PICTURES; i++ )
* vout_pictures.c : picture management functions
*****************************************************************************
* 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>
* Samuel Hocevar <sam@zoy.org>
{
p_pic = PP_RENDERPICTURE[ i_pic ];
- /* If the picture we found is a memory buffer, and we might have
- * enough room later for a direct buffer, skip it. If no other
- * pictures are found, the video decoder will try again later. */
- if( p_vout->b_direct && ( p_vout->output.i_pictures > 3 )
+ /* If the picture we found is a memory buffer, and we have enough
+ * pictures in the stack, and we might have enough room later for
+ * a direct buffer, skip it. If no other pictures are found, the
+ * video decoder will try again later. */
+ if( p_vout->b_direct && ( p_vout->output.i_pictures > 5 )
&& ( p_pic->i_type != DIRECT_PICTURE ) )
{
break;