Commit 6ed1e2d8 authored by Vincent Seguin's avatar Vincent Seguin

YUV 15,16 et 32 bits integr�e au vout (sans le MMX pour le moment).

En 24bpp, � vos risques et perils...
parent e4263587
......@@ -26,10 +26,18 @@
/* Program options */
#if defined(VIDEO_X11)
#define PROGRAM_OPTIONS "X11"
#define VIDEO_OPTIONS "X11"
#elif defined(VIDEO_FB)
#define PROGRAM_OPTIONS "Framebuffer"
#define VIDEO_OPTIONS "Framebuffer"
#else
#define VIDEO_OPTIONS ""
#endif
#if defined(HAVE_MMX)
#define ARCH_OPTIONS "MMX"
#else
#define ARCH_OPTIONS ""
#endif
#define PROGRAM_OPTIONS VIDEO_OPTIONS " " ARCH_OPTIONS
/* Program version and copyright message */
#define PROGRAM_VERSION "DR 2.1"
......
......@@ -29,6 +29,7 @@ typedef struct
/* Type and flags - should NOT be modified except by the vout thread */
int i_type; /* picture type */
int i_status; /* picture flags */
int i_matrix_coefficients; /* in YUV type, encoding type */
/* Picture properties - those properties are fixed at initialization and
* should NOT be modified. Note that for YUV pictures, i_bytes_per_line is
......
......@@ -7,14 +7,15 @@
* Prototypes
*******************************************************************************/
#if defined(VIDEO_X11)
int vout_SysCreate ( p_vout_thread_t p_vout, char *psz_display, Window root_window );
int vout_SysCreate ( p_vout_thread_t p_vout, char *psz_display, Window root_window );
#elif defined(VIDEO_FB)
int vout_SysCreate ( p_vout_thread_t p_vout );
int vout_SysCreate ( p_vout_thread_t p_vout );
#endif
int vout_SysInit ( p_vout_thread_t p_vout );
void vout_SysEnd ( p_vout_thread_t p_vout );
void vout_SysDestroy ( p_vout_thread_t p_vout );
int vout_SysManage ( p_vout_thread_t p_vout );
void vout_SysDisplay ( p_vout_thread_t p_vout );
int vout_SysInit ( p_vout_thread_t p_vout );
void vout_SysEnd ( p_vout_thread_t p_vout );
void vout_SysDestroy ( p_vout_thread_t p_vout );
int vout_SysManage ( p_vout_thread_t p_vout );
void vout_SysDisplay ( p_vout_thread_t p_vout );
byte_t * vout_SysGetPicture ( p_vout_thread_t p_vout, int *pi_eol_offset );
......@@ -155,6 +155,20 @@ void vout_SysDisplay( vout_thread_t *p_vout )
//?? p_vout->p_sys->i_buffer_index = ++p_vout->p_sys->i_buffer_index & 1;
}
/*******************************************************************************
* vout_SysGetPicture: get current display buffer informations
*******************************************************************************
* This function returns the address of the current display buffer, and the
* number of samples per line. For 15, 16 and 32 bits displays, this value is
* the number of pixels in a line.
*******************************************************************************/
byte_t * vout_SysGetPicture( vout_thread_t *p_vout, int *pi_eol_offset )
{
*pi_eol_offset = p_vout->i_width;
//????
// return( p_vout->p_sys->p_ximage[ p_vout->p_sys->i_buffer_index ].data );
}
/* following functions are local */
/*******************************************************************************
......@@ -219,10 +233,30 @@ static int FBOpenDisplay( vout_thread_t *p_vout )
p_vout->i_width = var_info.xres;
p_vout->i_height = var_info.yres;
p_vout->i_screen_depth = var_info.bits_per_pixel;
p_vout->p_sys->i_page_size = var_info.xres *
var_info.yres * var_info.bits_per_pixel / 8;
p_vout->i_screen_depth = 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) */
p_vout->i_bytes_per_pixel = 2;
break;
case 24: /* 24 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 3;
break;
case 32: /* 32 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 4;
break;
default: /* unsupported screen depth */
intf_ErrMsg("vout error: screen depth %i is not supported\n",
p_vout->i_screen_depth);
return( 1 );
break;
}
p_vout->p_sys->i_page_size = var_info.xres *
var_info.yres * p_vout->i_bytes_per_pixel;
/* Map two framebuffers a the very beginning of the fb */
p_vout->p_sys->p_video = mmap(0, p_vout->p_sys->i_page_size * 2,
......
This diff is collapsed.
......@@ -58,8 +58,6 @@ typedef struct vout_sys_s
int i_buffer_index; /* buffer index */
XImage * p_ximage[2]; /* XImage pointer */
XShmSegmentInfo shm_info[2]; /* shared memory zone information */
int i_completion_type; /* ?? */
} vout_sys_t;
/*******************************************************************************
......@@ -234,6 +232,20 @@ void vout_SysDisplay( vout_thread_t *p_vout )
p_vout->p_sys->i_buffer_index = ++p_vout->p_sys->i_buffer_index & 1;
}
/*******************************************************************************
* vout_SysGetPicture: get current display buffer informations
*******************************************************************************
* This function returns the address of the current display buffer, and the
* number of samples per line. For 15, 16 and 32 bits displays, this value is
* the number of pixels in a line.
*******************************************************************************/
byte_t * vout_SysGetPicture( vout_thread_t *p_vout, int *pi_eol_offset )
{
*pi_eol_offset = p_vout->i_width;
return( p_vout->p_sys->p_ximage[ p_vout->p_sys->i_buffer_index ]->data );
}
/* following functions are local */
/*******************************************************************************
......@@ -256,40 +268,16 @@ static int X11GetProperties( vout_thread_t *p_vout )
switch( p_vout->i_screen_depth )
{
case 15: /* 15 bpp (16bpp with a missing green bit) */
p_vout->i_bytes_per_pixel = 2;
/*
?? */
break;
case 16: /* 16 bpp (65536 colors) */
p_vout->i_bytes_per_pixel = 2;
/*
Process_Frame=Translate_Frame;
Process_Top_Field=Translate_Top_Field;
Process_Bottom_Field=Translate_Bottom_Field;
Process_Top_Field420=Translate_Top_Field420;
Process_Bottom_Field420=Translate_Bottom_Field420; ?? */
break;
case 24: /* 24 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 3;
/*
Process_Frame=Translate_Frame;
Process_Top_Field=Translate_Top_Field;
Process_Bottom_Field=Translate_Bottom_Field;
Process_Top_Field420=Translate_Top_Field420;
Process_Bottom_Field420=Translate_Bottom_Field420; ?? */
break;
case 32: /* 32 bpp (millions of colors) */
p_vout->i_bytes_per_pixel = 4;
/*
Process_Frame=Translate_Frame;
Process_Top_Field=Translate_Top_Field;
Process_Bottom_Field=Translate_Bottom_Field;
Process_Top_Field420=Translate_Top_Field420;
Process_Bottom_Field420=Translate_Bottom_Field420; ?? */
break;
default: /* unsupported screen depth */
......@@ -579,11 +567,6 @@ static int X11CreateShmImage( vout_thread_t *p_vout, XImage **pp_ximage,
XDestroyImage( *pp_ximage );
return( -1 );
}
/* ?? don't know what it is. Function XShmGetEventBase prototype is defined
* in mit-shm document, but does not appears in any header. */
p_vout->p_sys->i_completion_type = XShmGetEventBase(p_vout->p_sys->p_display) + ShmCompletion;
return( 0 );
}
......
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