[Mplayerxp-cvslog] CVS: mplayerxp/mplayerxp/libvo video_out.c,1.46,1.47
Brought to you by:
olov
From: Nick K. <nic...@us...> - 2004-10-29 16:02:29
|
Update of /cvsroot/mplayerxp/mplayerxp/mplayerxp/libvo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14944/mplayerxp/libvo Modified Files: video_out.c Log Message: cleanup Index: video_out.c =================================================================== RCS file: /cvsroot/mplayerxp/mplayerxp/mplayerxp/libvo/video_out.c,v retrieving revision 1.46 retrieving revision 1.47 diff -p -u -d -r1.46 -r1.47 --- video_out.c 29 Oct 2004 15:31:08 -0000 1.46 +++ video_out.c 29 Oct 2004 16:02:17 -0000 1.47 @@ -73,8 +73,6 @@ int vaa_use_dr=1; unsigned vo_da_buffs=64; /* keep old value here */ unsigned vo_use_bm=0; /* indicates user's agreement for using busmastering */ -char *vo_chop = NULL; -static u_int chop_top = 0, chop_bottom = 0; static vo_format_desc vod; /**************************************** @@ -178,9 +176,6 @@ typedef struct fourcc_alias_s uint32_t to; }fourcc_alias_t; -static fourcc_alias_t fourcc_alias[100]; -static unsigned fourcc_alias_idx; - void vo_print_help( void ) { unsigned i; @@ -216,7 +211,6 @@ const vo_info_t* vo_get_info( void ) int vo_init(const char *subdevice) { MSG_DBG3("dri_vo_dbg: vo_init(%s)\n",subdevice); - fourcc_alias_idx=0; return video_out->preinit(subdevice); } @@ -422,7 +416,7 @@ uint32_t vo_config(uint32_t width, uint3 uint32_t format,const vo_tune_info_t *vti) { uint32_t retval; - unsigned i,dest_fourcc,w,d_w,h,d_h; + unsigned dest_fourcc,w,d_w,h,d_h; MSG_DBG3("dri_vo_dbg: vo_config\n"); if(vo_inited) { @@ -451,32 +445,6 @@ uint32_t vo_config(uint32_t width, uint3 h = height; d_h = d_height; - if(vo_chop){ - char *ct; - if(strchr(vo_chop, ':')){ /* aspect ratio specified */ - double aw, ah; - aw = strtod(vo_chop, &ct); - ct++; - ah = strtod(ct, NULL); - if(aw > 0 && ah > 0){ - int nh = d_width * (ah / aw); - if(nh < height){ - chop_top = chop_bottom = (height - nh) / 2; - } - } - } else { - chop_top = strtol(vo_chop, &ct, 0); - if(*ct == ','){ - ct++; - chop_bottom = strtol(ct, NULL, 0); - } else { - chop_bottom = chop_top; - } - } - d_h -= (chop_bottom + chop_bottom) * d_h / h; - h -= chop_top + chop_bottom; - } - dri_d_width = d_w; dri_d_height = d_h; MSG_V("video_out->config(%u,%u,%u,%u,%u,'%s',%s)\n" @@ -522,38 +490,6 @@ uint32_t vo_query_vaa( vo_vaa_t* vaa ) return video_out->control(VOCTRL_QUERY_VAA,vaa); } -typedef struct img_cvs_s -{ - uint32_t base_fourcc; - uint32_t cvt_fourcc[10]; -}img_cvt_t; - - -/* - Note: with '!' are marked slow convertors which use SW scaler - to perform convertion. -*/ -img_cvt_t cvt_list[] = -{ - { IMGFMT_Y800/*!*/, { IMGFMT_YV12, IMGFMT_I420, IMGFMT_BGR32, IMGFMT_BGR24, IMGFMT_BGR16, IMGFMT_BGR15, 0 } }, - { IMGFMT_411P, { IMGFMT_YUY2, 0 } }, - { IMGFMT_YVU9, { IMGFMT_YV12, IMGFMT_I420, IMGFMT_YUY2, 0 } }, - { IMGFMT_YV12, { IMGFMT_NV12, IMGFMT_I420, IMGFMT_YUY2, IMGFMT_BGR32, IMGFMT_BGR24, IMGFMT_BGR16, IMGFMT_BGR15, 0 } }, - { IMGFMT_I420, { IMGFMT_NV12, IMGFMT_YV12, IMGFMT_YUY2, IMGFMT_BGR32, IMGFMT_BGR24, IMGFMT_BGR16, IMGFMT_BGR15, 0 } }, - { IMGFMT_YUY2, { IMGFMT_YV12/*!*/, IMGFMT_I420/*!*/, IMGFMT_BGR32, IMGFMT_BGR24, IMGFMT_BGR16, IMGFMT_BGR15, 0 } }, - { IMGFMT_BGR32, { IMGFMT_RGB32, IMGFMT_BGR24, IMGFMT_RGB24, IMGFMT_BGR16, IMGFMT_RGB16, IMGFMT_BGR15, IMGFMT_RGB15, IMGFMT_YV12/*!*/, IMGFMT_I420/*!*/, 0 } }, - { IMGFMT_BGR24, { IMGFMT_RGB24, IMGFMT_BGR32, IMGFMT_RGB32, IMGFMT_BGR16, IMGFMT_RGB16, IMGFMT_BGR15, IMGFMT_RGB15, IMGFMT_YV12, IMGFMT_I420, 0 } }, - { IMGFMT_BGR16, { IMGFMT_RGB16, IMGFMT_BGR15, IMGFMT_RGB15, IMGFMT_BGR24, IMGFMT_RGB24, IMGFMT_BGR32, IMGFMT_RGB32, IMGFMT_YV12/*!*/, IMGFMT_I420/*!*/, 0 } }, - { IMGFMT_BGR15, { IMGFMT_RGB15, IMGFMT_BGR16, IMGFMT_RGB16, IMGFMT_BGR24, IMGFMT_RGB24, IMGFMT_BGR32, IMGFMT_RGB32, IMGFMT_YV12/*!*/, IMGFMT_I420/*!*/, 0 } }, - { IMGFMT_RGB32, { IMGFMT_BGR32, IMGFMT_BGR24, IMGFMT_RGB24, IMGFMT_BGR16, IMGFMT_RGB16, IMGFMT_BGR15, IMGFMT_RGB15, IMGFMT_YV12/*!*/, IMGFMT_I420/*!*/, 0 } }, - { IMGFMT_RGB24, { IMGFMT_BGR24, IMGFMT_BGR32, IMGFMT_RGB32, IMGFMT_BGR16, IMGFMT_RGB16, IMGFMT_BGR15, IMGFMT_RGB15, IMGFMT_YV12/*!*/, IMGFMT_I420/*!*/, 0 } }, - { IMGFMT_RGB16, { IMGFMT_BGR16, IMGFMT_BGR15, IMGFMT_RGB15, IMGFMT_BGR24, IMGFMT_RGB24, IMGFMT_BGR32, IMGFMT_RGB32, 0 } }, - { IMGFMT_RGB15, { IMGFMT_BGR15, IMGFMT_BGR16, IMGFMT_RGB16, IMGFMT_BGR24, IMGFMT_RGB24, IMGFMT_BGR32, IMGFMT_RGB32, 0 } }, - { IMGFMT_RGB8, { IMGFMT_BGR8, 0 } }, - { IMGFMT_BGR8, { IMGFMT_RGB8, 0 } }, - { 0, { 0 }} -}; - /* if vo_driver doesn't support dri then it won't work with this logic */ uint32_t vo_query_format( uint32_t* fourcc, unsigned src_w, unsigned src_h) { @@ -566,38 +502,7 @@ uint32_t vo_query_format( uint32_t* four retval = video_out->control(VOCTRL_QUERY_FORMAT,&qfourcc); MSG_V("dri_vo: request for %s fourcc: %s\n",vo_format_name(*fourcc),retval?"OK":"False"); dri_forced_fourcc = *fourcc; - if(!retval) - { -#if 0 - unsigned i,j; - for(i=0;i<sizeof(cvt_list)/sizeof(img_cvt_t);i++) - if(*fourcc == cvt_list[i].base_fourcc) - { - for(j=0;j<10;j++) - { - if(!cvt_list[i].cvt_fourcc[j]) break; - dri_forced_fourcc = cvt_list[i].cvt_fourcc[j]; - qfourcc.fourcc=dri_forced_fourcc; - retval = video_out->control(VOCTRL_QUERY_FORMAT,&qfourcc); - MSG_V("dri_vo: try to apply %s to %s conversion: %s\n" - ,vo_format_name(*fourcc) - ,vo_format_name(dri_forced_fourcc) - ,retval?"OK":"False"); - if(retval) break; - } - } - if(retval) retval = 0x01; /* supported with convertion */ -#endif - } - else retval = 0x3; /* supported without convertion */ -#if 0 - if(retval) - { - fourcc_alias[fourcc_alias_idx].from = *fourcc; - fourcc_alias[fourcc_alias_idx].to = dri_forced_fourcc; - fourcc_alias_idx++; - } -#endif + if(retval) retval = 0x3; /* supported without convertion */ return retval; } @@ -850,7 +755,6 @@ uint32_t vo_draw_slice(uint8_t *src[], u uint8_t *dst[4]; uint8_t *ps_src[4]; int dstStride[4]; - int cy = y, ch = h; for(i=0;i<4;i++) { dst[i]=dri_surf[xp_frame].planes[i]+dri_off[i]; @@ -861,24 +765,6 @@ uint32_t vo_draw_slice(uint8_t *src[], u _h[i]=(h*vod.y_mul[i])/vod.y_div[i]; ps_src[i] = src[i] + ps_off[i]; } -#if 0 // should be redesigned as vf_chop and vf_panscan - cy -= chop_top; - if(cy < 0){ - if((ch += cy) <= 0){ - return 0; - } - ps_src[0] += -cy * stride[0]; - ps_src[1] += -cy * stride[1]/2; - ps_src[2] += -cy * stride[2]/2; - cy = 0; - } - if(cy + ch > image_height){ - ch = image_height - cy; - if(ch <= 0){ - return 0; - } - } -#endif for(i=0;i<4;i++) if(stride[i]) memcpy_pic(dst[i],ps_src[i],_w[i],_h[i],dstStride[i],stride[i]); |