Mercurial > mplayer.hg
changeset 4210:d43f0e4ac781
fbdev nocopy option - Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com>
author | arpi |
---|---|
date | Thu, 17 Jan 2002 01:15:31 +0000 |
parents | b47f7697541d |
children | 2c1ca684ff04 |
files | libvo/vo_fbdev.c |
diffstat | 1 files changed, 41 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_fbdev.c Thu Jan 17 01:12:01 2002 +0000 +++ b/libvo/vo_fbdev.c Thu Jan 17 01:15:31 2002 +0000 @@ -1196,8 +1196,20 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) { - unsigned char *dst = next_frame + (in_width * y0 + x0) * fb_pixel_size; - int dstride = in_width * fb_pixel_size; + unsigned char *dst; + int dstride; + +#ifdef USE_CONVERT2FB + if (pixel_format == IMGFMT_YV12) { + dst = L123123875 + (fb_xres * y0 + x0) * fb_pixel_size; + dstride = fb_xres * fb_pixel_size; + } + else +#endif + { + dst = next_frame + (in_width * y0 + x0) * fb_pixel_size; + dstride = in_width * fb_pixel_size; + } (*draw_alpha_p)(w, h, src, srca, stride, dst, dstride); } @@ -1205,9 +1217,16 @@ static uint32_t draw_frame(uint8_t *src[]) { if (pixel_format == IMGFMT_YV12) { +#ifdef USE_CONVERT2FB + yuv2rgb(L123123875, src[0], src[1], src[2], fb_xres, + fb_yres, fb_xres * fb_pixel_size, + in_width, in_width / 2); +#else yuv2rgb(next_frame, src[0], src[1], src[2], in_width, in_height, in_width * fb_pixel_size, in_width, in_width / 2); +#endif + } else if (flip) { int h = in_height; int len = in_width * fb_pixel_size; @@ -1237,6 +1256,21 @@ { uint8_t *dest; +#ifdef USE_CONVERT2FB + if (pixel_format == IMGFMT_YV12) { + if(x < fb_xres && y < fb_yres) { + if(x+w > fb_xres) w= fb_xres-x; + if(y+h > fb_yres) h= fb_yres-y; + + dest = L123123875 + (fb_xres * y + x) * fb_pixel_size; + yuv2rgb(dest, src[0], src[1], src[2], w, h, fb_xres * fb_pixel_size, + stride[0], stride[1]); + } + + return 0; + } +#endif + dest = next_frame + (in_width * y + x) * fb_pixel_size; yuv2rgb(dest, src[0], src[1], src[2], w, h, in_width * fb_pixel_size, stride[0], stride[1]); @@ -1251,6 +1285,11 @@ { int i, out_offset = 0, in_offset = 0; +#ifdef USE_CONVERT2FB + if(pixel_format == IMGFMT_YV12) + return; +#endif + for (i = 0; i < in_height; i++) { memcpy(L123123875 + out_offset, next_frame + in_offset, in_width * fb_pixel_size);