[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.59,1.60

Arpi of Ize arpi at mplayer.dev.hu
Thu Mar 7 17:57:42 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv3628

Modified Files:
	vo_xv.c 
Log Message:
direct rendering support

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- vo_xv.c	7 Mar 2002 14:16:43 -0000	1.59
+++ vo_xv.c	7 Mar 2002 16:57:40 -0000	1.60
@@ -39,6 +39,7 @@
 #include "aspect.h"
 
 #include "../postproc/rgb2rgb.h"
+#include "../mp_image.h"
 
 static vo_info_t vo_info =
 {
@@ -740,6 +741,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)
 {
 
@@ -798,6 +821,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;
 }




More information about the MPlayer-cvslog mailing list