[Mplayer-cvslog] CVS: main/libvo mga_common.c,1.43,1.44

Arpi of Ize arpi at mplayerhq.hu
Wed Oct 9 16:38:51 CEST 2002


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

Modified Files:
	mga_common.c 
Log Message:
draw_image() implementation (new libvo API)


Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- mga_common.c	9 Oct 2002 13:40:23 -0000	1.43
+++ mga_common.c	9 Oct 2002 14:38:38 -0000	1.44
@@ -120,29 +120,14 @@
 
 }
 
-
-static void
-write_frame_yuy2(uint8_t *y)
-{
-        int len=2*mga_vid_config.src_width;
-	uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31;
-
-	mem2agpcpy_pic(vid_data, y, len, mga_vid_config.src_height, 2*bespitch, len);
-}
-
 static uint32_t
 draw_frame(uint8_t *src[])
 {
-    switch(mga_vid_config.format){
-    case MGA_VID_FORMAT_YUY2:
-    case MGA_VID_FORMAT_UYVY:
-        write_frame_yuy2(src[0]);break;
-    }
+    printf("!!! mga::draw_frame() called !!!\n");
     return 0;
 }
 
-static uint32_t
-get_image(mp_image_t *mpi){
+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");
@@ -177,6 +162,25 @@
 }
 
 static uint32_t
+draw_image(mp_image_t *mpi){
+    uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31;
+
+    // if -dr or -slices then do nothing:
+    if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
+
+    if(mpi->flags&MP_IMGFLAG_PLANAR){
+	// copy planar:
+        draw_slice(mpi->planes,mpi->stride,mpi->w,mpi->h,mpi->x,mpi->y);
+    } else {
+	// copy packed:
+	mem2agpcpy_pic(vid_data, mpi->planes[0],	// dst,src
+		    mpi->w*(mpi->bpp/8), mpi->h,	// w,h
+		    bespitch*2, mpi->stride[0]);	// dstride,sstride
+    }
+    return VO_TRUE;
+}
+
+static uint32_t
 query_format(uint32_t format)
 {
     switch(format){
@@ -185,8 +189,6 @@
     case IMGFMT_IYUV:
     case IMGFMT_YUY2:
     case IMGFMT_UYVY:
-//    case IMGFMT_RGB|24:
-//    case IMGFMT_BGR|24:
         return 3 | VFCAP_OSD|VFCAP_HWSCALE_UP|VFCAP_HWSCALE_DOWN;
     }
     return 0;
@@ -219,6 +221,8 @@
     return query_format(*((uint32_t*)data));
   case VOCTRL_GET_IMAGE:
     return get_image(data);
+  case VOCTRL_DRAW_IMAGE:
+    return draw_image(data);
   case VOCTRL_SET_EQUALIZER:
     {
      va_list ap;
@@ -379,7 +383,6 @@
 	ioctl(f,MGA_VID_ON,0);
 
   return 0;
-
 }
 
 static int mga_uninit(){




More information about the MPlayer-cvslog mailing list