Commit fb0eb672 authored by Sam Hocevar's avatar Sam Hocevar

. prototypes de fonctions pour le 8bpp

 . virage d'un bug dans le calcul de bytes_per_line (sauf fumage de ma part)
 . suppression de quelques #@@#@!!#@@#!@#@#! d'espaces en fin de ligne
 . quelques reformatages � 79 colonnes au lieu de @@#@!!#@@#!@#@#!# 81.
parent 5017b466
This diff is collapsed.
......@@ -199,24 +199,31 @@ static int FBOpenDisplay( vout_thread_t *p_vout )
p_vout->i_width = p_vout->p_sys->var_info.xres;
p_vout->i_height = p_vout->p_sys->var_info.yres;
p_vout->i_bytes_per_line = p_vout->i_width * 2;
p_vout->i_screen_depth = p_vout->p_sys->var_info.bits_per_pixel;
switch( p_vout->i_screen_depth )
{
case 15: /* 15 bpp (16bpp with a missing green bit) */
case 16: /* 16 bpp (65536 colors) */
case 8: /* 8 bpp */
p_vout->i_bytes_per_pixel = 1;
p_vout->i_bytes_per_line = p_vout->i_width;
break;
case 15: /* 15 bpp (16bpp with a missing green bit) */
case 16: /* 16 bpp (65536 colors) */
p_vout->i_bytes_per_pixel = 2;
p_vout->i_bytes_per_line = p_vout->i_width * 2;
break;
case 24: /* 24 bpp (millions of colors) */
case 24: /* 24 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 3;
p_vout->i_bytes_per_line = p_vout->i_width * 3;
break;
case 32: /* 32 bpp (millions of colors) */
case 32: /* 32 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 4;
p_vout->i_bytes_per_line = p_vout->i_width * 4;
break;
default: /* unsupported screen depth */
default: /* unsupported screen depth */
intf_ErrMsg("vout error: screen depth %d is not supported\n",
p_vout->i_screen_depth);
return( 1 );
......@@ -256,3 +263,4 @@ static void FBCloseDisplay( vout_thread_t *p_vout )
// Destroy window and close display
close( p_vout->p_sys->i_fb_dev );
}
......@@ -30,24 +30,28 @@
/******************************************************************************
* Local prototypes
******************************************************************************/
static int InitThread ( vout_thread_t *p_vout );
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 void Print ( vout_thread_t *p_vout, int i_x, int i_y,
int i_h_align, int i_v_align, unsigned char *psz_text );
static void SetBufferArea ( vout_thread_t *p_vout, int i_x, int i_y, int i_w, int i_h );
static void SetBufferPicture ( vout_thread_t *p_vout, picture_t *p_pic );
static void RenderPicture ( vout_thread_t *p_vout, picture_t *p_pic );
static void RenderPictureInfo ( vout_thread_t *p_vout, picture_t *p_pic );
static void RenderSubPicture ( vout_thread_t *p_vout, subpicture_t *p_subpic );
static void RenderInterface ( vout_thread_t *p_vout );
static int RenderIdle ( vout_thread_t *p_vout );
static void RenderInfo ( vout_thread_t *p_vout );
static int Manage ( vout_thread_t *p_vout );
static int Align ( vout_thread_t *p_vout, int *pi_x, int *pi_y,
int i_width, int i_height, int i_h_align, int i_v_align );
static int InitThread ( vout_thread_t *p_vout );
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 void Print ( vout_thread_t *p_vout, int i_x, int i_y,
int i_h_align, int i_v_align,
unsigned char *psz_text );
static void SetBufferArea ( vout_thread_t *p_vout, int i_x, int i_y,
int i_w, int i_h );
static void SetBufferPicture ( vout_thread_t *p_vout, picture_t *p_pic );
static void RenderPicture ( vout_thread_t *p_vout, picture_t *p_pic );
static void RenderPictureInfo ( vout_thread_t *p_vout, picture_t *p_pic );
static void RenderSubPicture ( vout_thread_t *p_vout,
subpicture_t *p_subpic );
static void RenderInterface ( vout_thread_t *p_vout );
static int RenderIdle ( vout_thread_t *p_vout );
static void RenderInfo ( vout_thread_t *p_vout );
static int Manage ( vout_thread_t *p_vout );
static int Align ( vout_thread_t *p_vout, int *pi_x,
int *pi_y, int i_width, int i_height,
int i_h_align, int i_v_align );
/******************************************************************************
* vout_CreateThread: creates a new video output thread
......@@ -62,7 +66,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_
{
vout_thread_t * p_vout; /* thread descriptor */
int i_status; /* thread status */
int i_index; /* index for array initialization */
int i_index; /* index for array initialization */
/* Allocate descriptor */
intf_DbgMsg("\n");
......
This diff is collapsed.
......@@ -295,17 +295,20 @@ static int X11OpenDisplay( vout_thread_t *p_vout, char *psz_display, Window root
p_vout->p_sys->i_screen );
switch( p_vout->i_screen_depth )
{
case 15: /* 15 bpp (16bpp with a missing green bit) */
case 16: /* 16 bpp (65536 colors) */
case 8: /* 24 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 1;
break;
case 15: /* 15 bpp (16bpp with a missing green bit) */
case 16: /* 16 bpp (65536 colors) */
p_vout->i_bytes_per_pixel = 2;
break;
case 24: /* 24 bpp (millions of colors) */
case 24: /* 24 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 3;
break;
case 32: /* 32 bpp (millions of colors) */
case 32: /* 32 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 4;
break;
default: /* unsupported screen depth */
default: /* unsupported screen depth */
intf_ErrMsg("error: screen depth %d is not supported\n",
p_vout->i_screen_depth);
XCloseDisplay( p_vout->p_sys->p_display );
......@@ -419,13 +422,13 @@ static void X11DestroyWindow( vout_thread_t *p_vout )
*******************************************************************************/
static int X11CreateImage( vout_thread_t *p_vout, XImage **pp_ximage )
{
byte_t * pb_data; /* image data storage zone */
int i_quantum; /* XImage quantum (see below) */
byte_t * pb_data; /* image data storage zone */
int i_quantum; /* XImage quantum (see below) */
/* Allocate memory for image */
p_vout->i_bytes_per_line = p_vout->i_width * p_vout->i_bytes_per_pixel;
pb_data = (byte_t *) malloc( p_vout->i_bytes_per_line * p_vout->i_height );
if( !pb_data ) /* error */
if( !pb_data ) /* error */
{
intf_ErrMsg("error: %s\n", strerror(ENOMEM));
return( 1 );
......
This diff is collapsed.
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