From b5908a4f9b252c1af722b63688c356c050dcf788 Mon Sep 17 00:00:00 2001 From: arpi_esp Date: Thu, 29 Mar 2001 15:32:42 +0000 Subject: [PATCH] OSD/SUB support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@248 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_xv.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index 5524a7bfc8..3436f14e10 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -253,8 +253,43 @@ static void check_events(void) } } + +static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ + int x,y; + + if (xv_format==IMGFMT_YV12){ + + for(y=0;ydata + image_width * (y+y0) + x0; + for(x=0;x>8; + if(srca[x]) + dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8; + } + src+=stride; + srca+=stride; + } + + } else { + + for(y=0;ydata + 2*(image_width * (y+y0) + x0); + for(x=0;x>8; + if(srca[x]) + dst[2*x]=(dst[2*x]*(srca[x]^255)+src[x]*(srca[x]))>>8; + } + src+=stride; + srca+=stride; + } + + } + +} + static void flip_page(void) { + vo_draw_text(image_width,image_height,draw_alpha); check_events(); XvShmPutImage(mydisplay, xv_port, mywindow, mygc, xvimage[0], 0, 0, image_width, image_height, @@ -264,6 +299,8 @@ static void flip_page(void) return; } + + static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) { uint8_t *src;