# HG changeset patch # User nick # Date 1012471033 0 # Node ID df8e0f71cc3c20b19a5b71045332083bb3f642e4 # Parent 5105f5da01d6cf039b0827b02ee30abd9e6c45b7 new info for tuning diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/video_out.h --- a/libvo/video_out.h Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/video_out.h Thu Jan 31 09:57:13 2002 +0000 @@ -65,6 +65,12 @@ int (*set_deint)(const vidix_deinterlace_t *info); }vo_vaa_t; +/* Misc info to tuneup vo driver */ +typedef struct vo_tune_info_s +{ + int pitch[3]; /* Should be 0 if unknown else power of 2 */ +}vo_tune_info_t; + typedef struct vo_functions_s { /* @@ -83,7 +89,9 @@ * format: fourcc of pixel format * returns : zero on successful initialization, non-zero on error. */ - uint32_t (*init)(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format); + uint32_t (*config)(uint32_t width, uint32_t height, uint32_t d_width, + uint32_t d_height, uint32_t fullscreen, char *title, + uint32_t format,const vo_tune_info_t *); /* * Query that given pixel format is supported or not. diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/video_out_internal.h --- a/libvo/video_out_internal.h Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/video_out_internal.h Thu Jan 31 09:57:13 2002 +0000 @@ -21,7 +21,9 @@ * */ -static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format); +static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, + uint32_t d_height, uint32_t fullscreen, char *title, + uint32_t format,const vo_tune_info_t *); static const vo_info_t* get_info(void); static uint32_t draw_frame(uint8_t *src[]); static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y); @@ -36,7 +38,7 @@ #define LIBVO_EXTERN(x) vo_functions_t video_out_##x =\ {\ preinit,\ - init,\ + config,\ query_format,\ get_info,\ draw_frame,\ diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_3dfx.c --- a/libvo/vo_3dfx.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_3dfx.c Thu Jan 31 09:57:13 2002 +0000 @@ -312,7 +312,7 @@ } static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { int fd; char *name = ":0.0"; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_aa.c --- a/libvo/vo_aa.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_aa.c Thu Jan 31 09:57:13 2002 +0000 @@ -205,9 +205,9 @@ } } static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, - uint32_t format) { + uint32_t format,const vo_tune_info_t *info) { /* * main init * called by mplayer diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_dga.c --- a/libvo/vo_dga.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_dga.c Thu Jan 31 09:57:13 2002 +0000 @@ -23,8 +23,8 @@ * - works only on x86 architectures * * $Log$ - * Revision 1.37 2002/01/26 16:01:26 nick - * Extensions for video accelerated architecture + * Revision 1.38 2002/01/31 09:52:45 nick + * new info for tuning * * Revision 1.35 2001/12/28 20:52:54 alex * use XF86VidMode later in init (at line 1031) only if we've got support (if have_vm==1) @@ -803,9 +803,9 @@ //--------------------------------------------------------- -static uint32_t init( uint32_t width, uint32_t height, +static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, - uint32_t flags,char *title,uint32_t format ) + uint32_t flags,char *title,uint32_t format,const vo_tune_info_t *info ) { int x_off, y_off; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_directfb.c --- a/libvo/vo_directfb.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_directfb.c Thu Jan 31 09:57:13 2002 +0000 @@ -326,9 +326,9 @@ } -static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, +static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, - uint32_t format) + uint32_t format,const vo_tune_info_t *info) { /* * (Locals) diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_dxr3.c --- a/libvo/vo_dxr3.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_dxr3.c Thu Jan 31 09:57:13 2002 +0000 @@ -96,7 +96,7 @@ } #endif -static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format) +static uint32_t config(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { int tmp1, tmp2; em8300_register_t reg; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_fbdev.c --- a/libvo/vo_fbdev.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_fbdev.c Thu Jan 31 09:57:13 2002 +0000 @@ -896,9 +896,9 @@ fflush(vt_fp); } -static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, +static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, - uint32_t format) + uint32_t format,const vo_tune_info_t *info) { struct fb_cmap *cmap; int vm = fullscreen & 0x02; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_fsdga.c --- a/libvo/vo_fsdga.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_fsdga.c Thu Jan 31 09:57:13 2002 +0000 @@ -307,9 +307,9 @@ -static uint32_t init( uint32_t width, uint32_t height, +static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, - uint32_t fullscreen,char *title,uint32_t format ) + uint32_t fullscreen,char *title,uint32_t format,const vo_tune_info_t *info ) { int bank, ram; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_ggi.c --- a/libvo/vo_ggi.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_ggi.c Thu Jan 31 09:57:13 2002 +0000 @@ -235,8 +235,8 @@ return(ret); } -static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, - uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, + uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { vo_depthonscreen = 32; printf("ggi-init: This driver has got bugs, if you can, fix them.\n"); diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_gl.c --- a/libvo/vo_gl.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_gl.c Thu Jan 31 09:57:13 2002 +0000 @@ -96,7 +96,7 @@ * allocate colors and (shared) memory */ static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) +init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format,const vo_tune_info_t *info) { // int screen; unsigned int fg, bg; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_gl2.c --- a/libvo/vo_gl2.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_gl2.c Thu Jan 31 09:57:13 2002 +0000 @@ -602,7 +602,7 @@ * allocate colors and (shared) memory */ static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format,const vo_tune_info_t *info) { // int screen; unsigned int fg, bg; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_md5.c --- a/libvo/vo_md5.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_md5.c Thu Jan 31 09:57:13 2002 +0000 @@ -37,10 +37,10 @@ static FILE * md5_file; static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { md5_file = fopen ("md5", "w"); - return video_out_pgm.init (width, height, d_width,d_height,fullscreen, title, format); + return video_out_pgm.config (width, height, d_width,d_height,fullscreen, title, format,info); } static const vo_info_t* diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_mga.c --- a/libvo/vo_mga.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_mga.c Thu Jan 31 09:57:13 2002 +0000 @@ -55,7 +55,7 @@ #include "mga_common.c" static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid"; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_mpegpes.c --- a/libvo/vo_mpegpes.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_mpegpes.c Thu Jan 31 09:57:13 2002 +0000 @@ -85,7 +85,7 @@ }; static uint32_t -init(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format) +config(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { #ifdef HAVE_DVB //|O_NONBLOCK diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_null.c --- a/libvo/vo_null.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_null.c Thu Jan 31 09:57:13 2002 +0000 @@ -67,7 +67,7 @@ } static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { image_width = width; image_height = height; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_odivx.c --- a/libvo/vo_odivx.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_odivx.c Thu Jan 31 09:57:13 2002 +0000 @@ -199,7 +199,7 @@ extern int encode_bitrate; static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { uint32_t frame_size; ENC_PARAM enc_param; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_pgm.c --- a/libvo/vo_pgm.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_pgm.c Thu Jan 31 09:57:13 2002 +0000 @@ -41,7 +41,7 @@ char vo_pgm_filename[24]; static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { image_height = height; image_width = width; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_png.c --- a/libvo/vo_png.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_png.c Thu Jan 31 09:57:13 2002 +0000 @@ -63,7 +63,7 @@ } static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { if (fullscreen&0x04 && (width != d_width || height != d_height) && ((format==IMGFMT_YV12) /*|| (format == IMGFMT_I420) || (format == IMGFMT_IYUV)*/)) { diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_sdl.c --- a/libvo/vo_sdl.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_sdl.c Thu Jan 31 09:57:13 2002 +0000 @@ -609,7 +609,7 @@ **/ static uint32_t -init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) +config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format,const vo_tune_info_t *info) //static int sdl_setup (int width, int height) { struct sdl_priv_s *priv = &sdl_priv; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_svga.c --- a/libvo/vo_svga.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_svga.c Thu Jan 31 09:57:13 2002 +0000 @@ -121,9 +121,9 @@ return(0); } -static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, +static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, - uint32_t format) { + uint32_t format,const vo_tune_info_t *info) { uint32_t req_w = (d_width > 0 ? d_width : width); uint32_t req_h = (d_height > 0 ? d_height : height); uint16_t vid_mode = 0; diff -r 5105f5da01d6 -r df8e0f71cc3c libvo/vo_syncfb.c --- a/libvo/vo_syncfb.c Thu Jan 31 09:39:11 2002 +0000 +++ b/libvo/vo_syncfb.c Thu Jan 31 09:57:13 2002 +0000 @@ -60,7 +60,7 @@ static int vo_conf_cinemode = 0; -static syncfb_config_t config; +static syncfb_config_t _config; static syncfb_capability_t sfb_caps; static syncfb_buffer_info_t bufinfo; @@ -90,26 +90,26 @@ uint_32 bespitch,h,w; - bespitch = config.src_pitch; + bespitch = _config.src_pitch; dest32 = (uint_32 *)vid_data; - for(h=0; h < config.src_height/2; h++) + for(h=0; h < _config.src_height/2; h++) { cbp = cb; crp = cr; - for(w=0; w < config.src_width/2; w++) + for(w=0; w < _config.src_width/2; w++) { *dest32++ = (*y) + ((*cr)<<8) + ((*(y+1))<<16) + ((*cb)<<24); y++; y++; cb++; cr++; } - dest32 += (bespitch - config.src_width) / 2; + dest32 += (bespitch - _config.src_width) / 2; - for(w=0; w < config.src_width/2; w++) + for(w=0; w < _config.src_width/2; w++) { *dest32++ = (*y) + ((*crp)<<8) + ((*(y+1))<<16) + ((*cbp)<<24); y++; y++; cbp++; crp++; } - dest32 += (bespitch - config.src_width) / 2; + dest32 += (bespitch - _config.src_width) / 2; } } @@ -120,21 +120,21 @@ uint_8 *dest, *tmp; uint_32 bespitch,h,w; - bespitch = config.src_pitch; + bespitch = _config.src_pitch; dest = frame_mem + bufinfo.offset; - for(h=0; h < config.src_height; h++) + for(h=0; h < _config.src_height; h++) { - memcpy(dest, y, config.src_width); - y += config.src_width; + memcpy(dest, y, _config.src_width); + y += _config.src_width; dest += bespitch; } dest = frame_mem + bufinfo.offset_p2; - for(h=0; h < config.src_height/2; h++) + for(h=0; h < _config.src_height/2; h++) { tmp = dest; - for(w=0; w < config.src_width/2; w++) + for(w=0; w < _config.src_width/2; w++) { *tmp++ = *cr++; *tmp++ = *cb++; @@ -154,13 +154,13 @@ uint_8 *dest, *tmp; uint_32 bespitch,h,w; - bespitch = config.src_pitch; + bespitch = _config.src_pitch; dest = frame_mem + bufinfo.offset + (bespitch * 16 * slice_num); for(h=0; h < 16; h++) { - memcpy(dest, y, config.src_width); - y += config.src_width; + memcpy(dest, y, _config.src_width); + y += _config.src_width; dest += bespitch; } @@ -168,7 +168,7 @@ for(h=0; h < 8; h++) { tmp = dest; - for(w=0; w < config.src_width/2; w++) + for(w=0; w < _config.src_width/2; w++) { *tmp++ = *cr++; *tmp++ = *cb++; @@ -183,7 +183,7 @@ uint_8 *dest; uint_32 bespitch,h; - bespitch = config.src_pitch; + bespitch = _config.src_pitch; dest = frame_mem + bufinfo.offset + (bespitch * ypos); for(h=0; h < ysize; h++) @@ -224,26 +224,26 @@ uint_32 bespitch,h,w; - bespitch = config.src_pitch; + bespitch = _config.src_pitch; dest32 = (uint_32 *)(vid_data + (bespitch * 16 * slice_num) * 2); for(h=0; h < 8; h++) { cbp = cb; crp = cr; - for(w=0; w < config.src_width/2; w++) + for(w=0; w < _config.src_width/2; w++) { *dest32++ = (*y) + ((*cr)<<8) + ((*(y+1))<<16) + ((*cb)<<24); y++; y++; cb++; cr++; } - dest32 += (bespitch - config.src_width) / 2; + dest32 += (bespitch - _config.src_width) / 2; - for(w=0; w < config.src_width/2; w++) + for(w=0; w < _config.src_width/2; w++) { *dest32++ = (*y) + ((*crp)<<8) + ((*(y+1))<<16) + ((*cbp)<<24); y++; y++; cbp++; crp++; } - dest32 += (bespitch - config.src_width) / 2; + dest32 += (bespitch - _config.src_width) / 2; } } @@ -280,7 +280,7 @@ flip_page(void) { -// memset(frame_mem + bufinfo.offset_p2, 0x80, config.src_width*config.src_height); +// memset(frame_mem + bufinfo.offset_p2, 0x80, _config.src_width*config.src_height); ioctl(f,SYNCFB_COMMIT_BUFFER,&bufinfo); if ( dbg_singleframe ) { @@ -346,7 +346,7 @@ return 0; } -static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) +static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { uint_32 frame_size; @@ -366,54 +366,54 @@ if (ioctl(f,SYNCFB_GET_CONFIG,&config)) perror("Error in mga_vid_config ioctl"); if (sfb_caps.palettes & (1<disp_w,sh_video->disp_h,out_fmt,0, fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3) )){ #else - if(video_out->init(sh_video->disp_w,sh_video->disp_h, + if(video_out->config(sh_video->disp_w,sh_video->disp_h, screen_size_x,screen_size_y, fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), - title,out_fmt)){ + title,out_fmt,NULL)){ #endif mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CannotInitVO); goto goto_next_file; // exit_player(MSGTR_Exit_error); diff -r 5105f5da01d6 -r df8e0f71cc3c tvision.c --- a/tvision.c Thu Jan 31 09:39:11 2002 +0000 +++ b/tvision.c Thu Jan 31 09:57:13 2002 +0000 @@ -109,10 +109,12 @@ gb2.width = gb1.width; gb2.height = gb1.height; - video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_YV12); -// video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_UYVY); -// video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_YUY2); -// video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_RGB|24); + // video_out->preinit() LOST here ? + + video_out->config(gb1.width,gb1.height,1024,768,0,0,IMGFMT_YV12,NULL); +// video_out->config(gb1.width,gb1.height,1024,768,0,0,IMGFMT_UYVY,NULL); +// video_out->config(gb1.width,gb1.height,1024,768,0,0,IMGFMT_YUY2,NULL); +// video_out->config(gb1.width,gb1.height,1024,768,0,0,IMGFMT_RGB|24,NULL); tmpframe=malloc(gb1.width*gb1.height*3/2); stride[0]=(gb1.width+15)&(~15); @@ -178,7 +180,7 @@ fwrite(map,320*240*2,1,f); fclose(f); } - video_out->init(320,240,800,600,0,0,IMGFMT_YUY2); + video_out->config(320,240,800,600,0,0,IMGFMT_YUY2,NULL); video_out->draw_frame(count?map1:map2); video_out->flip_page();