[Mplayer-cvslog] CVS: main/libvo vo_png.c,1.19,1.20

Arpi of Ize arpi at mplayerhq.hu
Thu Oct 10 02:04:28 CEST 2002


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

Modified Files:
	vo_png.c 
Log Message:
draw_image()


Index: vo_png.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_png.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- vo_png.c	22 Sep 2002 02:33:26 -0000	1.19
+++ vo_png.c	10 Oct 2002 00:04:25 -0000	1.20
@@ -199,10 +199,17 @@
 
 static uint32_t draw_frame(uint8_t * src[])
 {
+    return -1;
+}
+
+static uint32_t draw_image(mp_image_t* mpi){
     char buf[100];
     int k, bppmul = bpp/8;
     struct pngdata png;
     png_byte *row_pointers[image_height];
+
+    // if -dr or -slices then do nothing:
+    if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
     
     snprintf (buf, 100, "%08d.png", ++framenum);
 
@@ -214,16 +221,18 @@
     }	     
 
     if(verbose > 1) printf("PNG Creating Row Pointers\n");
-    for ( k = 0; k < image_height; k++ ) row_pointers[k] = &src[0][image_width*k*bppmul];
-    
+    for ( k = 0; k < image_height; k++ )
+	row_pointers[k] = mpi->planes[0]+mpi->stride[0]*k;
+
     //png_write_flush(png.png_ptr);
     //png_set_flush(png.png_ptr, nrows);
 
     if(verbose > 1) printf("PNG Writing Image Data\n");
     png_write_image(png.png_ptr, row_pointers);
 
-    return destroy_png(png);
+    destroy_png(png);
 
+    return VO_TRUE;
 }
 
 static void draw_osd(void)
@@ -307,6 +316,8 @@
 static uint32_t control(uint32_t request, void *data, ...)
 {
   switch (request) {
+  case VOCTRL_DRAW_IMAGE:
+    return draw_image(data);
   case VOCTRL_QUERY_FORMAT:
     return query_format(*((uint32_t*)data));
   }




More information about the MPlayer-cvslog mailing list