[MPlayer-dev-eng] [PATCH] BGR32 video blitter support for nVidia

Samuel Liddicott sam at liddicott.com
Tue Jun 18 11:21:05 CEST 2002


Would this be with nVidias own drivers only (the dodgy binary ones) or the
with-source free "nv" ones?

Sam
----- Original Message -----
From: "Artur Zaprzala" <zybi at fanthom.math.put.poznan.pl>
To: <mplayer-dev-eng at mplayerhq.hu>
Sent: Monday, June 17, 2002 12:29 PM
Subject: [MPlayer-dev-eng] [PATCH] BGR32 video blitter support for nVidia


> nVidia drivers can handle IMGFMT_BGR32 on video blitter xvideo port.
> This patch adds BGR32 support to vo_xv.c.
>
>
> --
> Artur Zaprzala
>


----------------------------------------------------------------------------
----


> --- libvo/vo_xv.c-orig Fri Jun 14 12:20:33 2002
> +++ libvo/vo_xv.c Sun Jun 16 14:52:01 2002
> @@ -44,6 +44,9 @@
>  #include "../Gui/interface.h"
>  #endif
>
> +// NVIDIA video bliter supports IMGFMT_BGR32, but the id is 3
> +#define IMGFMT_BGR32_XV 3
> +
>  static vo_info_t vo_info =
>  {
>          "X11/Xv",
> @@ -123,6 +126,13 @@
>
xvimage[current_buf]->pitches[0]*y0+2*x0+1,xvimage[current_buf]->pitches[0])
;
>  }
>
> +static void draw_alpha_rgb32(int x0,int y0, int w,int h, unsigned char*
src, unsigned char *srca, int stride){
> +   x0+=(vo_panscan_x>>2);
> +   vo_draw_alpha_rgb32(w,h,src,srca,stride,
> +       xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+
> +
xvimage[current_buf]->pitches[0]*y0+4*x0,xvimage[current_buf]->pitches[0]);
> +}
> +
>  static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char*
src, unsigned char *srca, int stride){
>  }
>
> @@ -362,6 +372,7 @@
>       fo = XvListImageFormats(mDisplay, xv_port, (int*)&formats);
>       xv_format=0;
>       if(format==IMGFMT_BGR24) format=IMGFMT_YV12;
> +     else if(format==IMGFMT_BGR32) format=IMGFMT_BGR32_XV;
>       for(i = 0; i < formats; i++){
>         mp_msg(MSGT_VO,MSGL_V,"Xvideo image format: 0x%x (%4.4s) %s\n",
fo[i].id,(char*)&fo[i].id, (fo[i].format == XvPacked) ? "packed" :
"planar");
>         if (fo[i].id == format) xv_format = fo[i].id;
> @@ -480,6 +491,7 @@
>   case IMGFMT_YUY2:
>   case IMGFMT_YVYU: draw_alpha_fnc=draw_alpha_yuy2; break;
>   case IMGFMT_UYVY: draw_alpha_fnc=draw_alpha_uyvy; break;
> + case IMGFMT_BGR32_XV: draw_alpha_fnc=draw_alpha_rgb32; break;
>   default:     draw_alpha_fnc=draw_alpha_null;
>         }
>
> @@ -735,6 +747,10 @@
>   3*image_width);
>       break;
>
> + case IMGFMT_BGR32:
> +
memcpy(xvimage[current_buf]->data,src[0],xvimage[current_buf]->data_size);
> +     break;
> +
>   }
>
>    return 0;
> @@ -777,6 +793,7 @@
>      int flag=3|VFCAP_HWSCALE_UP|VFCAP_HWSCALE_DOWN|VFCAP_OSD; // FIXME!
check for DOWN
>     /* check image formats */
>       if(format==IMGFMT_BGR24){
format=IMGFMT_YV12;flag&=~2;flag|=VFCAP_FLIP;} // conversion!
> +     else if(format==IMGFMT_BGR32){ format=IMGFMT_BGR32_XV;}
>       for(i = 0; i < formats; i++){
>         if (fo[i].id == format) return flag; //xv_format = fo[i].id;
>       }
>




More information about the MPlayer-dev-eng mailing list