diff options
author | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-03-29 15:32:42 +0000 |
---|---|---|
committer | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-03-29 15:32:42 +0000 |
commit | b5908a4f9b252c1af722b63688c356c050dcf788 (patch) | |
tree | 65b36dd988003042053fcf2d39aec742f6796432 /libvo/vo_xv.c | |
parent | 4da400eca1caa9c33e1a0472a3aebb6864e9c818 (diff) | |
download | mpv-b5908a4f9b252c1af722b63688c356c050dcf788.tar.bz2 mpv-b5908a4f9b252c1af722b63688c356c050dcf788.tar.xz |
OSD/SUB support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@248 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_xv.c')
-rw-r--r-- | libvo/vo_xv.c | 37 |
1 files changed, 37 insertions, 0 deletions
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;y<h;y++){ + uint8_t *dst = xvimage[0]->data + image_width * (y+y0) + x0; + for(x=0;x<w;x++){ +// dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>8; + if(srca[x]) + dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8; + } + src+=stride; + srca+=stride; + } + + } else { + + for(y=0;y<h;y++){ + uint8_t *dst = xvimage[0]->data + 2*(image_width * (y+y0) + x0); + for(x=0;x<w;x++){ +// dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>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; |