Commit 4f553677 authored by Vincent Seguin's avatar Vincent Seguin

IMPORTANT:

	p_vout->i_depth est maintenant la profondeur SIGNIFICATIVE de
		l'�cran (8, 15, 16 ou 24)
	p_vout->i_bytes_per_pixel est la profondeur r�elle (1, 2, 3 ou 4)

Ajout du calcul des d�calages � video_output.
Refonte de l'initialisation des tables.
D�tection correcte des profondeurs 24/24 et 24/32 en X11
Correction de bugs dans le scaling en 1, 3 et 4 Bpp.
R�cup�ration des masques depuis le materiel en X11 et GGI.

FrameBuffer cass� pour le moment: il faut rajouter les masques de couleur
(des valeurs par d�faut sont au d�but de video_yuv.c) et le calcul des
nouvelles profondeurs d'�cran.
parent fb0eb672
...@@ -103,10 +103,27 @@ typedef struct vout_thread_s ...@@ -103,10 +103,27 @@ typedef struct vout_thread_s
int i_width; /* current output method width */ int i_width; /* current output method width */
int i_height; /* current output method height */ int i_height; /* current output method height */
int i_bytes_per_line; /* bytes per line (incl. virtual) */ int i_bytes_per_line; /* bytes per line (incl. virtual) */
int i_screen_depth; /* bits per pixel */ int i_screen_depth; /* significant bpp: 8, 15, 16 or 24 */
int i_bytes_per_pixel; /* real screen depth */ int i_bytes_per_pixel; /* real screen depth: 1, 2, 3 or 4 */
float f_gamma; /* gamma */ float f_gamma; /* gamma */
/* Color masks and shifts in RGB mode - masks are set by system
* initialization, shifts are calculated. A pixel color value can be
* obtained using the formula ((value >> rshift) << lshift) */
u32 i_red_mask; /* red mask */
u32 i_green_mask; /* green mask */
u32 i_blue_mask; /* blue mask */
int i_red_lshift, i_red_rshift; /* red shifts */
int i_green_lshift, i_green_rshift; /* green shifts */
int i_blue_lshift, i_blue_rshift; /* blue shifts */
/* Usefull pre-calculated pixel values - these are not supposed to be
* accurate values, but rather values looking nice, given their usage. */
u32 i_white_pixel; /* white */
u32 i_black_pixel; /* black */
u32 i_gray_pixel; /* gray */
u32 i_blue_pixel; /* blue */
/* Pictures and rendering properties */ /* Pictures and rendering properties */
boolean_t b_grayscale; /* color or grayscale display */ boolean_t b_grayscale; /* color or grayscale display */
boolean_t b_info; /* print additionnal informations */ boolean_t b_info; /* print additionnal informations */
...@@ -151,6 +168,17 @@ typedef struct vout_thread_s ...@@ -151,6 +168,17 @@ typedef struct vout_thread_s
#define VOUT_YUV_CHANGE 0x0800 /* change yuv tables */ #define VOUT_YUV_CHANGE 0x0800 /* change yuv tables */
#define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */ #define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */
/*******************************************************************************
* Macros
*******************************************************************************/
/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */
#define RGB2PIXEL( p_vout, i_red, i_green, i_blue ) \
(((((u32)i_red) >> p_vout->i_red_rshift) << p_vout->i_red_lshift) | \
((((u32)i_green) >> p_vout->i_green_rshift) << p_vout->i_green_lshift) | \
((((u32)i_blue) >> p_vout->i_blue_rshift) << p_vout->i_blue_lshift))
/******************************************************************************* /*******************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *******************************************************************************/
...@@ -169,3 +197,4 @@ void vout_DestroySubPicture ( vout_thread_t *p_vout, subpicture_t *p ...@@ -169,3 +197,4 @@ void vout_DestroySubPicture ( vout_thread_t *p_vout, subpicture_t *p
void vout_DisplaySubPicture ( vout_thread_t *p_vout, subpicture_t *p_subpic ); void vout_DisplaySubPicture ( vout_thread_t *p_vout, subpicture_t *p_subpic );
void vout_SetBuffers ( vout_thread_t *p_vout, void *p_buf1, void *p_buf2 ); void vout_SetBuffers ( vout_thread_t *p_vout, void *p_buf1, void *p_buf2 );
...@@ -119,6 +119,7 @@ void vout_SysDestroy( vout_thread_t *p_vout ) ...@@ -119,6 +119,7 @@ void vout_SysDestroy( vout_thread_t *p_vout )
*******************************************************************************/ *******************************************************************************/
int vout_SysManage( vout_thread_t *p_vout ) int vout_SysManage( vout_thread_t *p_vout )
{ {
//?? 8bpp: change palette
return( 0 ); return( 0 );
} }
...@@ -286,32 +287,13 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display ) ...@@ -286,32 +287,13 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display )
p_vout->i_width = mode.visible.x; p_vout->i_width = mode.visible.x;
p_vout->i_height = mode.visible.y; p_vout->i_height = mode.visible.y;
p_vout->i_bytes_per_line = p_vout->p_sys->p_buffer[ 0 ]->buffer.plb.stride; p_vout->i_bytes_per_line = p_vout->p_sys->p_buffer[ 0 ]->buffer.plb.stride;
switch( mode.graphtype ) p_vout->i_screen_depth = p_vout->p_sys->p_buffer[ 0 ]->buffer.plb->pixelformat.depth;
{ p_vout->i_bytes_per_pixel = p_vout->p_sys->p_buffer[ 0 ]->buffer.plb->pixelformat.size / 8;
case GT_15BIT: p_vout->i_red_mask = p_vout->p_sys->p_buffer[ 0 ]->buffer.plb->pixelformat.red_mask;
p_vout->i_screen_depth = 15; p_vout->i_green_mask = p_vout->p_sys->p_buffer[ 0 ]->buffer.plb->pixelformat.green_mask;
p_vout->i_bytes_per_pixel = 2; p_vout->i_blue_mask = p_vout->p_sys->p_buffer[ 0 ]->buffer.plb->pixelformat.blue_mask;
break; //?? palette in 8bpp
case GT_16BIT:
p_vout->i_screen_depth = 16;
p_vout->i_bytes_per_pixel = 2;
break;
case GT_24BIT:
p_vout->i_screen_depth = 24;
p_vout->i_bytes_per_pixel = 3;
break;
case GT_32BIT:
p_vout->i_screen_depth = 32;
p_vout->i_bytes_per_pixel = 4;
break;
default:
intf_ErrMsg("error: unsupported screen depth\n");
ggiClose( p_vout->p_sys->p_display );
ggiExit();
return( 1 );
break;
}
/* Set and initialize buffers */ /* Set and initialize buffers */
vout_SetBuffers( p_vout, p_vout->p_sys->p_buffer[ 0 ]->write, p_vout->p_sys->p_buffer[ 1 ]->write ); vout_SetBuffers( p_vout, p_vout->p_sys->p_buffer[ 0 ]->write, p_vout->p_sys->p_buffer[ 1 ]->write );
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
/****************************************************************************** /******************************************************************************
* Local prototypes * Local prototypes
******************************************************************************/ ******************************************************************************/
static int BinaryLog ( u32 i );
static void MaskToShift ( int *pi_left, int *pi_right, u32 i_mask );
static int InitThread ( vout_thread_t *p_vout ); static int InitThread ( vout_thread_t *p_vout );
static void RunThread ( vout_thread_t *p_vout ); static void RunThread ( vout_thread_t *p_vout );
static void ErrorThread ( vout_thread_t *p_vout ); static void ErrorThread ( vout_thread_t *p_vout );
...@@ -95,15 +97,14 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_ ...@@ -95,15 +97,14 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_
p_vout->i_bytes_per_pixel = 2; p_vout->i_bytes_per_pixel = 2;
p_vout->f_gamma = VOUT_GAMMA; p_vout->f_gamma = VOUT_GAMMA;
p_vout->b_grayscale = main_GetIntVariable( VOUT_GRAYSCALE_VAR, p_vout->b_grayscale = main_GetIntVariable( VOUT_GRAYSCALE_VAR, VOUT_GRAYSCALE_DEFAULT );
VOUT_GRAYSCALE_DEFAULT );
p_vout->b_info = 0; p_vout->b_info = 0;
p_vout->b_interface = 0; p_vout->b_interface = 0;
p_vout->b_scale = 0; p_vout->b_scale = 0;
intf_DbgMsg("wished configuration: %dx%d,%d (%d bytes/pixel, %d bytes/line)\n", intf_DbgMsg("wished configuration: %dx%d, %d/%d bpp (%d Bpl)\n",
p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth, p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line ); p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line );
/* Initialize idle screen */ /* Initialize idle screen */
p_vout->last_display_date = mdate(); p_vout->last_display_date = mdate();
...@@ -135,9 +136,21 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_ ...@@ -135,9 +136,21 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_
free( p_vout ); free( p_vout );
return( NULL ); return( NULL );
} }
intf_DbgMsg("actual configuration: %dx%d,%d (%d bytes/pixel, %d bytes/line)\n", intf_DbgMsg("actual configuration: %dx%d, %d/%d bpp (%d Bpl), masks: 0x%x/0x%x/0x%x\n",
p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth, p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line ); p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line,
p_vout->i_red_mask, p_vout->i_green_mask, p_vout->i_blue_mask );
/* Calculate shifts from system-updated masks */
MaskToShift( &p_vout->i_red_lshift, &p_vout->i_red_rshift, p_vout->i_red_mask );
MaskToShift( &p_vout->i_green_lshift, &p_vout->i_green_rshift, p_vout->i_green_mask );
MaskToShift( &p_vout->i_blue_lshift, &p_vout->i_blue_rshift, p_vout->i_blue_mask );
/* Set some usefull colors */
p_vout->i_white_pixel = RGB2PIXEL( p_vout, 255, 255, 255 );
p_vout->i_black_pixel = RGB2PIXEL( p_vout, 0, 0, 0 );
p_vout->i_gray_pixel = RGB2PIXEL( p_vout, 128, 128, 128 );
p_vout->i_blue_pixel = RGB2PIXEL( p_vout, 0, 0, 50 );
/* Load fonts - fonts must be initialized after the systme method since /* Load fonts - fonts must be initialized after the systme method since
* they may be dependant of screen depth and other thread properties */ * they may be dependant of screen depth and other thread properties */
...@@ -172,8 +185,8 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_ ...@@ -172,8 +185,8 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_
return( NULL ); return( NULL );
} }
intf_Msg("Video display initialized (%dx%d, %d bpp)\n", intf_Msg("Video display initialized (%dx%d, %d/%d bpp)\n", p_vout->i_width,
p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth ); p_vout->i_height, p_vout->i_screen_depth, p_vout->i_bytes_per_pixel * 8 );
/* If status is NULL, wait until the thread is created */ /* If status is NULL, wait until the thread is created */
if( pi_status == NULL ) if( pi_status == NULL )
...@@ -717,8 +730,82 @@ void vout_SetBuffers( vout_thread_t *p_vout, void *p_buf1, void *p_buf2 ) ...@@ -717,8 +730,82 @@ void vout_SetBuffers( vout_thread_t *p_vout, void *p_buf1, void *p_buf2 )
p_vout->p_buffer[1].p_data = p_buf2; p_vout->p_buffer[1].p_data = p_buf2;
} }
/*****************************************************************************
* vout_Pixel2RGB: return red, green and blue from pixel value
*****************************************************************************
* Return color values, in 0-255 range, of the decomposition of a pixel. This
* is a slow routine and should only be used for initialization phase.
*****************************************************************************/
void vout_Pixel2RGB( vout_thread_t *p_vout, u32 i_pixel, int *pi_red, int *pi_green, int *pi_blue )
{
*pi_red = i_pixel & p_vout->i_red_mask;
*pi_green = i_pixel & p_vout->i_green_mask;
*pi_blue = i_pixel & p_vout->i_blue_mask;
}
/* following functions are local */ /* following functions are local */
/*****************************************************************************
* 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;
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++;
}
if (i != ((u32)1 << i_log))
{
intf_ErrMsg("internal error: binary log overflow\n");
}
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 */
/* 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);
}
/****************************************************************************** /******************************************************************************
* InitThread: initialize video output thread * InitThread: initialize video output thread
****************************************************************************** ******************************************************************************
...@@ -1093,7 +1180,8 @@ void Print( vout_thread_t *p_vout, int i_x, int i_y, int i_h_align, int i_v_alig ...@@ -1093,7 +1180,8 @@ void Print( vout_thread_t *p_vout, int i_x, int i_y, int i_h_align, int i_v_alig
vout_Print( p_vout->p_default_font, p_vout->p_buffer[ p_vout->i_buffer_index ].p_data + vout_Print( p_vout->p_default_font, p_vout->p_buffer[ p_vout->i_buffer_index ].p_data +
i_y * p_vout->i_bytes_per_line + i_x * p_vout->i_bytes_per_pixel, i_y * p_vout->i_bytes_per_line + i_x * p_vout->i_bytes_per_pixel,
p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line, p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line,
0xffffffff, 0x00000000, 0x00000000, 0, psz_text ); p_vout->i_white_pixel, 0, 0,
0, psz_text );
} }
} }
...@@ -1397,34 +1485,6 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1397,34 +1485,6 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic )
* Clear areas array * Clear areas array
*/ */
p_buffer->i_areas = 0; p_buffer->i_areas = 0;
#ifdef DEBUG_VIDEO
/*
* In DEBUG_VIDEO mode, draw white pixels at the beginning and the end of
* the picture area. These pixels should not be erased by rendering functions,
* otherwise segmentation fault is menacing !
*/
if( i_pic_x > 0 )
{
*(u16*)(p_buffer->p_data + p_vout->i_bytes_per_line * i_pic_y +
p_vout->i_bytes_per_pixel * (i_pic_x - 1)) = 0xffff;
}
if( i_pic_y > 0 )
{
*(u16*)(p_buffer->p_data + p_vout->i_bytes_per_line * (i_pic_y - 1) +
p_vout->i_bytes_per_pixel * i_pic_x ) = 0xffff;
}
if( i_pic_x + i_pic_width < p_vout->i_width )
{
*(u16*)(p_buffer->p_data + p_vout->i_bytes_per_line * (i_pic_y + i_pic_height - 1) +
p_vout->i_bytes_per_pixel * (i_pic_x + i_pic_width) ) = 0xffff;
}
if( i_pic_y + i_pic_height < p_vout->i_height )
{
*(u16*)(p_buffer->p_data + p_vout->i_bytes_per_line * (i_pic_y + i_pic_height) +
p_vout->i_bytes_per_pixel * (i_pic_x + i_pic_width - 1) ) = 0xffff;
}
#endif
} }
/****************************************************************************** /******************************************************************************
...@@ -1583,7 +1643,7 @@ static int RenderIdle( vout_thread_t *p_vout ) ...@@ -1583,7 +1643,7 @@ static int RenderIdle( vout_thread_t *p_vout )
p_vout->p_buffer[ p_vout->i_buffer_index ].p_data + p_vout->p_buffer[ p_vout->i_buffer_index ].p_data +
i_x * p_vout->i_bytes_per_pixel + i_y * p_vout->i_bytes_per_line, i_x * p_vout->i_bytes_per_pixel + i_y * p_vout->i_bytes_per_line,
p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line, p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line,
0xffffffff, 0x33333333, 0, p_vout->i_white_pixel, p_vout->i_gray_pixel, 0,
WIDE_TEXT | OUTLINED_TEXT, psz_text ); WIDE_TEXT | OUTLINED_TEXT, psz_text );
SetBufferArea( p_vout, i_x, i_y, i_width, i_height ); SetBufferArea( p_vout, i_x, i_y, i_width, i_height );
} }
...@@ -1683,7 +1743,7 @@ static void RenderInterface( vout_thread_t *p_vout ) ...@@ -1683,7 +1743,7 @@ static void RenderInterface( vout_thread_t *p_vout )
{ {
int i_height, i_text_height; /* total and text height */ int i_height, i_text_height; /* total and text height */
int i_width_1, i_width_2; /* text width */ int i_width_1, i_width_2; /* text width */
int i_byte; /* byte index */ int i_byte; /* byte index */
const char *psz_text_1 = "[1-9] Channel [i]nfo [c]olor [g/G]amma"; const char *psz_text_1 = "[1-9] Channel [i]nfo [c]olor [g/G]amma";
const char *psz_text_2 = "[+/-] Volume [m]ute [s]caling [Q]uit"; const char *psz_text_2 = "[+/-] Volume [m]ute [s]caling [Q]uit";
...@@ -1692,13 +1752,13 @@ static void RenderInterface( vout_thread_t *p_vout ) ...@@ -1692,13 +1752,13 @@ static void RenderInterface( vout_thread_t *p_vout )
vout_TextSize( p_vout->p_large_font, OUTLINED_TEXT, psz_text_2, &i_width_2, &i_text_height ); vout_TextSize( p_vout->p_large_font, OUTLINED_TEXT, psz_text_2, &i_width_2, &i_text_height );
i_height += i_text_height; i_height += i_text_height;
/* Render background - effective background color will depend of the screen /* Render background */
* depth */
for( i_byte = (p_vout->i_height - i_height) * p_vout->i_bytes_per_line; for( i_byte = (p_vout->i_height - i_height) * p_vout->i_bytes_per_line;
i_byte < p_vout->i_height * p_vout->i_bytes_per_line; i_byte < p_vout->i_height * p_vout->i_bytes_per_line;
i_byte++ ) i_byte++ )
{ {
p_vout->p_buffer[ p_vout->i_buffer_index ].p_data[ i_byte ] = 0x33; //?? noooo !
p_vout->p_buffer[ p_vout->i_buffer_index ].p_data[ i_byte ] = p_vout->i_blue_pixel;
} }
/* Render text, if not larger than screen */ /* Render text, if not larger than screen */
...@@ -1707,7 +1767,7 @@ static void RenderInterface( vout_thread_t *p_vout ) ...@@ -1707,7 +1767,7 @@ static void RenderInterface( vout_thread_t *p_vout )
vout_Print( p_vout->p_large_font, p_vout->p_buffer[ p_vout->i_buffer_index ].p_data + vout_Print( p_vout->p_large_font, p_vout->p_buffer[ p_vout->i_buffer_index ].p_data +
(p_vout->i_height - i_height) * p_vout->i_bytes_per_line, (p_vout->i_height - i_height) * p_vout->i_bytes_per_line,
p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line, p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line,
0xffffffff, 0x00000000, 0x00000000, p_vout->i_white_pixel, p_vout->i_black_pixel, 0,
OUTLINED_TEXT, psz_text_1 ); OUTLINED_TEXT, psz_text_1 );
} }
if( i_width_2 < p_vout->i_width ) if( i_width_2 < p_vout->i_width )
...@@ -1715,7 +1775,7 @@ static void RenderInterface( vout_thread_t *p_vout ) ...@@ -1715,7 +1775,7 @@ static void RenderInterface( vout_thread_t *p_vout )
vout_Print( p_vout->p_large_font, p_vout->p_buffer[ p_vout->i_buffer_index ].p_data + vout_Print( p_vout->p_large_font, p_vout->p_buffer[ p_vout->i_buffer_index ].p_data +
(p_vout->i_height - i_height + i_text_height) * p_vout->i_bytes_per_line, (p_vout->i_height - i_height + i_text_height) * p_vout->i_bytes_per_line,
p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line, p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line,
0xffffffff, 0x00000000, 0x00000000, p_vout->i_white_pixel, p_vout->i_black_pixel, 0,
OUTLINED_TEXT, psz_text_2 ); OUTLINED_TEXT, psz_text_2 );
} }
......
...@@ -60,8 +60,9 @@ typedef void (vout_put_byte_t)( void *p_pic, int i_byte, int i_char, int i_borde ...@@ -60,8 +60,9 @@ typedef void (vout_put_byte_t)( void *p_pic, int i_byte, int i_char, int i_borde
*******************************************************************************/ *******************************************************************************/
/* PUT_BYTE_MASK: put pixels from a byte-wide mask. It uses a branching tree /* PUT_BYTE_MASK: put pixels from a byte-wide mask. It uses a branching tree
* to optimize the number of tests. It is used in the PutByte functions. */ * to optimize the number of tests. It is used in the PutByte functions.
#define TREE( i_mask, i_mask_color ) \ * This macro works for 1, 2 and 4 Bpp. */
#define PUT_BYTE_MASK( i_mask, i_mask_color ) \
if( i_mask & 0xf0 ) /* one from 1111 */ \ if( i_mask & 0xf0 ) /* one from 1111 */ \
{ \ { \
if( i_mask & 0xc0 ) /* one from 1100 */ \ if( i_mask & 0xc0 ) /* one from 1100 */ \
...@@ -364,17 +365,9 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int ...@@ -364,17 +365,9 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int
p_PutByte = (vout_put_byte_t *) PutByte24; p_PutByte = (vout_put_byte_t *) PutByte24;
break; break;
case 4: case 4:
#ifndef DEBUG
default: default:
#endif
p_PutByte = (vout_put_byte_t *) PutByte32; p_PutByte = (vout_put_byte_t *) PutByte32;
break; break;
#ifdef DEBUG
default:
intf_DbgMsg("error: invalid bytes per pixel %d\n", i_bytes_per_pixel );
p_PutByte = NULL;
break;
#endif
} }
/* Choose masks and copy font data to local variables */ /* Choose masks and copy font data to local variables */
...@@ -447,7 +440,7 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int ...@@ -447,7 +440,7 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int
/* following functions are local */ /* following functions are local */
/***************************************************************************** /*****************************************************************************
* PutByte8: print a fixed width font character byte in 15 or 16 bpp * PutByte8: print a fixed width font character byte in 1 Bpp
*****************************************************************************/ *****************************************************************************/
static void PutByte8( u8 *p_pic, int i_byte, int i_char, int i_border, static void PutByte8( u8 *p_pic, int i_byte, int i_char, int i_border,
int i_bg, u32 i_char_color, u32 i_border_color, int i_bg, u32 i_char_color, u32 i_border_color,
...@@ -458,13 +451,13 @@ static void PutByte8( u8 *p_pic, int i_byte, int i_char, int i_border, ...@@ -458,13 +451,13 @@ static void PutByte8( u8 *p_pic, int i_byte, int i_char, int i_border,
i_bg &= ~(i_char | i_border); i_bg &= ~(i_char | i_border);
/* Put character bits */ /* Put character bits */
TREE(i_char, i_char_color); PUT_BYTE_MASK(i_char, i_char_color);
TREE(i_border, i_border_color); PUT_BYTE_MASK(i_border, i_border_color);
TREE(i_bg, i_bg_color); PUT_BYTE_MASK(i_bg, i_bg_color);
} }
/***************************************************************************** /*****************************************************************************
* PutByte16: print a fixed width font character byte in 15 or 16 bpp * PutByte16: print a fixed width font character byte in 2 Bpp
*****************************************************************************/ *****************************************************************************/
static void PutByte16( u16 *p_pic, int i_byte, int i_char, int i_border, static void PutByte16( u16 *p_pic, int i_byte, int i_char, int i_border,
int i_bg, u32 i_char_color, u32 i_border_color, int i_bg, u32 i_char_color, u32 i_border_color,
...@@ -475,13 +468,13 @@ static void PutByte16( u16 *p_pic, int i_byte, int i_char, int i_border, ...@@ -475,13 +468,13 @@ static void PutByte16( u16 *p_pic, int i_byte, int i_char, int i_border,
i_bg &= ~(i_char | i_border); i_bg &= ~(i_char | i_border);
/* Put character bits */ /* Put character bits */
TREE(i_char, i_char_color); PUT_BYTE_MASK(i_char, i_char_color);
TREE(i_border, i_border_color); PUT_BYTE_MASK(i_border, i_border_color);
TREE(i_bg, i_bg_color); PUT_BYTE_MASK(i_bg, i_bg_color);
} }
/***************************************************************************** /*****************************************************************************
* PutByte24: print a fixed width font character byte in 24 bpp * PutByte24: print a fixed width font character byte in 3 Bpp
*****************************************************************************/ *****************************************************************************/
static void PutByte24( void *p_pic, int i_byte, byte_t i_char, byte_t i_border, byte_t i_bg, static void PutByte24( void *p_pic, int i_byte, byte_t i_char, byte_t i_border, byte_t i_bg,
u32 i_char_color, u32 i_border_color, u32 i_bg_color ) u32 i_char_color, u32 i_border_color, u32 i_bg_color )
...@@ -490,7 +483,7 @@ static void PutByte24( void *p_pic, int i_byte, byte_t i_char, byte_t i_border, ...@@ -490,7 +483,7 @@ static void PutByte24( void *p_pic, int i_byte, byte_t i_char, byte_t i_border,
} }
/***************************************************************************** /*****************************************************************************
* PutByte32: print a fixed width font character byte in 32 bpp * PutByte32: print a fixed width font character byte in 4 Bpp
*****************************************************************************/ *****************************************************************************/
static void PutByte32( u32 *p_pic, int i_byte, byte_t i_char, byte_t i_border, byte_t i_bg, static void PutByte32( u32 *p_pic, int i_byte, byte_t i_char, byte_t i_border, byte_t i_bg,
u32 i_char_color, u32 i_border_color, u32 i_bg_color ) u32 i_char_color, u32 i_border_color, u32 i_bg_color )
...@@ -500,8 +493,8 @@ static void PutByte32( u32 *p_pic, int i_byte, byte_t i_char, byte_t i_border, b ...@@ -500,8 +493,8 @@ static void PutByte32( u32 *p_pic, int i_byte, byte_t i_char, byte_t i_border, b
i_bg &= ~(i_char | i_border); i_bg &= ~(i_char | i_border);
/* Put character bits */ /* Put character bits */
TREE(i_char, i_char_color); PUT_BYTE_MASK(i_char, i_char_color);
TREE(i_border, i_border_color); PUT_BYTE_MASK(i_border, i_border_color);
TREE(i_bg, i_bg_color); PUT_BYTE_MASK(i_bg, i_bg_color);
} }
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#include "video_sys.h" #include "video_sys.h"
#include "video_yuv.h"
#include "intf_msg.h" #include "intf_msg.h"
/******************************************************************************* /*******************************************************************************
...@@ -38,23 +39,25 @@ ...@@ -38,23 +39,25 @@
typedef struct vout_sys_s typedef struct vout_sys_s
{ {
/* User settings */ /* User settings */
boolean_t b_shm; /* shared memory extension flag */ boolean_t b_shm; /* shared memory extension flag */
/* Internal settings and properties */ /* Internal settings and properties */
Display * p_display; /* display pointer */ Display * p_display; /* display pointer */
int i_screen; /* screen number */ Visual * p_visual; /* visual pointer */
Window root_window; /* root window */ int i_screen; /* screen number */
Window window; /* window instance handler */ Window root_window; /* root window */
GC gc; /* graphic context instance handler */ Window window; /* window instance handler */
GC gc; /* graphic context instance handler */
Colormap colormap; /* colormap used (8bpp only) */
/* Display buffers and shared memory information */ /* Display buffers and shared memory information */
XImage * p_ximage[2]; /* XImage pointer */ XImage * p_ximage[2]; /* XImage pointer */
XShmSegmentInfo shm_info[2]; /* shared memory zone information */ XShmSegmentInfo shm_info[2]; /* shared memory zone information */
} vout_sys_t; } vout_sys_t;
/******************************************************************************* /*****************************************************************************
* Local prototypes * Local prototypes
*******************************************************************************/ <