[Mplayer-cvslog] CVS: main/libmpcodecs vd.c,1.5,1.6

Arpi of Ize arpi at mplayer.dev.hu
Wed Mar 6 21:54:17 CET 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mplayer:/var/tmp.root/cvs-serv28777

Modified Files:
	vd.c 
Log Message:
vd_ffmpeg added, handling of EXPORT imgtype changed

Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vd.c	2 Mar 2002 22:08:19 -0000	1.5
+++ vd.c	6 Mar 2002 20:54:14 -0000	1.6
@@ -24,11 +24,15 @@
 extern vd_functions_t mpcodecs_vd_null;
 extern vd_functions_t mpcodecs_vd_cinepak;
 extern vd_functions_t mpcodecs_vd_qtrpza;
+extern vd_functions_t mpcodecs_vd_ffmpeg;
 
 vd_functions_t* mpcodecs_vd_drivers[] = {
         &mpcodecs_vd_null,
         &mpcodecs_vd_cinepak,
         &mpcodecs_vd_qtrpza,
+#ifdef USE_LIBAVCODEC
+        &mpcodecs_vd_ffmpeg,
+#endif
 	NULL
 };
 
@@ -39,6 +43,7 @@
 
 static mp_image_t* static_images[2];
 static mp_image_t* temp_images[1];
+static mp_image_t* export_images[1];
 static int static_idx=0;
 
 // mp_imgtype: buffering type, see mp_image.h
@@ -51,7 +56,9 @@
   // and if not, then fallback to software buffers:
   switch(mp_imgtype){
   case MP_IMGTYPE_EXPORT:
-    mpi=new_mp_image(w,h);
+//    mpi=new_mp_image(w,h);
+    if(!export_images[0]) export_images[0]=new_mp_image(w,h);
+    mpi=export_images[0];
     break;
   case MP_IMGTYPE_STATIC:
     if(!static_images[0]) static_images[0]=new_mp_image(w,h);
@@ -77,6 +84,15 @@
     mpi->type=mp_imgtype;
     mpi->flags&=~(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE);
     mpi->flags|=mp_imgflag&(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE);
+    if((mpi->width!=w || mpi->height!=h) && !(mpi->flags&MP_IMGFLAG_DIRECT)){
+	mpi->width=w;
+	mpi->height=h;
+	if(mpi->flags&MP_IMGFLAG_ALLOCATED){
+	    // need to re-allocate buffer memory:
+	    free(mpi->planes[0]);
+	    mpi->flags&=~MP_IMGFLAG_ALLOCATED;
+	}
+    }
     if(!mpi->bpp){
       mp_image_setfmt(mpi,sh->codec->outfmt[sh->outfmtidx]);
       if(!(mpi->flags&(MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_DIRECT)) 




More information about the MPlayer-cvslog mailing list