[Mplayer-cvslog] CVS: main/libvo mga_common.c,1.18,1.19 video_out.h,1.24,1.25

Arpi of Ize arpi at mplayer.dev.hu
Thu Mar 7 03:43:39 CET 2002


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

Modified Files:
	mga_common.c video_out.h 
Log Message:
direct rendering support

Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- mga_common.c	7 Mar 2002 01:51:28 -0000	1.18
+++ mga_common.c	7 Mar 2002 02:43:35 -0000	1.19
@@ -1,6 +1,7 @@
 
 #include "fastmemcpy.h"
 #include "../mmx_defs.h"
+#include "../mp_image.h"
 
 // mga_vid drawing functions
 
@@ -172,7 +173,6 @@
 	mem2agpcpy_pic(vid_data, y, len, mga_vid_config.src_height, 2*bespitch, len);
 }
 
-
 static uint32_t
 draw_frame(uint8_t *src[])
 {
@@ -185,6 +185,36 @@
 }
 
 static uint32_t
+get_image(mp_image_t *mpi){
+    uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31;
+    uint32_t bespitch2 = bespitch/2;
+//    printf("mga: get_image() called\n");
+    if(mpi->type==MP_IMGTYPE_STATIC) return VO_FALSE; // it is not static
+    if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // slow video ram
+//    printf("width=%d vs. bespitch=%d, flags=0x%X  \n",mpi->width,bespitch,mpi->flags);
+    if((mpi->width==bespitch) ||
+       (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH))){
+       // we're lucky or codec accepts stride => ok, let's go!
+       if(mpi->flags&MP_IMGFLAG_PLANAR){
+	   mpi->planes[0]=vid_data;
+	   mpi->planes[1]=vid_data + bespitch*mga_vid_config.src_height;
+	   mpi->planes[2]=vid_data + bespitch*mga_vid_config.src_height
+                    + bespitch*mga_vid_config.src_height / 4;
+	   mpi->width=mpi->stride[0]=bespitch;
+	   mpi->stride[1]=mpi->stride[2]=bespitch2;
+       } else {
+           mpi->planes[0]=vid_data;
+	   mpi->width=bespitch;
+	   mpi->stride[0]=mpi->width*(mpi->bpp/8);
+       }
+       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)
 {
     switch(format){
@@ -205,6 +235,8 @@
   switch (request) {
   case VOCTRL_QUERY_FORMAT:
     return query_format(*((uint32_t*)data));
+  case VOCTRL_GET_IMAGE:
+    return get_image(data);
   }
   return VO_NOTIMPL;
 }

Index: video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- video_out.h	3 Mar 2002 18:47:28 -0000	1.24
+++ video_out.h	7 Mar 2002 02:43:35 -0000	1.25
@@ -36,6 +36,8 @@
 #define VOCTRL_PAUSE 7
 /* start/resume playback */
 #define VOCTRL_RESUME 8
+/* libmpcodecs direct rendering: */
+#define VOCTRL_GET_IMAGE 9
 
 #define VO_TRUE		1
 #define VO_FALSE	0




More information about the MPlayer-cvslog mailing list