# HG changeset patch # User arpi # Date 1015520260 0 # Node ID 0e6e50c02f7b9d4793b268af82c7d4643413d9ea # Parent 27980a84496189aa8f2bb73bf54c8733817bf336 direct rendering support diff -r 27980a844961 -r 0e6e50c02f7b libvo/vo_xv.c --- a/libvo/vo_xv.c Thu Mar 07 15:06:02 2002 +0000 +++ b/libvo/vo_xv.c Thu Mar 07 16:57:40 2002 +0000 @@ -39,6 +39,7 @@ #include "aspect.h" #include "../postproc/rgb2rgb.h" +#include "../mp_image.h" static vo_info_t vo_info = { @@ -741,6 +742,28 @@ return 0; } +static uint32_t get_image(mp_image_t *mpi){ + if(mpi->type==MP_IMGTYPE_STATIC && num_buffers>1) return VO_FALSE; // it is not static +// if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // slow video ram + if(mpi->width==image_width){ + if(mpi->flags&MP_IMGFLAG_PLANAR){ + mpi->planes[0]=xvimage[current_buf]->data; + mpi->planes[1]=xvimage[current_buf]->data+image_width*image_height; + mpi->planes[2]=xvimage[current_buf]->data+image_width*image_height*5/4; + mpi->stride[0]=image_width; + mpi->stride[1]=mpi->stride[2]=image_width/2; + } else { + mpi->planes[0]=xvimage[current_buf]->data; + mpi->stride[0]=image_width; + } + mpi->flags|=MP_IMGFLAG_DIRECT; +// printf("mga: get_image() SUCCESS -> Direct Rendering ENABLED\n"); + return VO_TRUE; + } + return VO_FALSE; +} + + static uint32_t query_format(uint32_t format) { @@ -799,6 +822,8 @@ return VO_TRUE; case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); + case VOCTRL_GET_IMAGE: + return get_image(data); } return VO_NOTIMPL; }