[Mplayer-cvslog] CVS: main/libmpcodecs dec_video.c,1.117,1.118 vd.c,1.9,1.10

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


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

Modified Files:
	dec_video.c vd.c 
Log Message:
direct rendering support

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -r1.117 -r1.118
--- dec_video.c	7 Mar 2002 00:44:18 -0000	1.117
+++ dec_video.c	7 Mar 2002 02:44:16 -0000	1.118
@@ -189,6 +189,7 @@
 unsigned int t2;
 double tt;
 
+sh_video->video_out=video_out;
 mpi=mpvdec->decode(sh_video, start, in_size, drop_frame);
 
 //------------------------ frame decoded. --------------------
@@ -215,7 +216,7 @@
     cur_video_time_usage=tt;
 }
 
-if(!(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALBACK))){
+if(!(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK))){
     // blit frame:
     if(mpi->flags&MP_IMGFLAG_PLANAR)
         video_out->draw_slice(mpi->planes,mpi->stride,sh_video->disp_w,sh_video->disp_h,0,0);

Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vd.c	7 Mar 2002 01:39:07 -0000	1.9
+++ vd.c	7 Mar 2002 02:44:16 -0000	1.10
@@ -62,6 +62,8 @@
 	NULL
 };
 
+#include "libvo/video_out.h"
+
 int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt){
 
     return 1;
@@ -109,8 +111,8 @@
   }
   if(mpi){
     mpi->type=mp_imgtype;
-    mpi->flags&=~(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE);
-    mpi->flags|=mp_imgflag&(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE);
+    mpi->flags&=~(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE|MP_IMGFLAG_DIRECT);
+    mpi->flags|=mp_imgflag&(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE|MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH|MP_IMGFLAG_ALIGNED_STRIDE|MP_IMGFLAG_DRAW_CALLBACK);
     if((mpi->width!=w2 || mpi->height!=h) && !(mpi->flags&MP_IMGFLAG_DIRECT)){
 	mpi->width=w2;
 	mpi->height=h;
@@ -120,16 +122,15 @@
 	    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)) 
-         && mpi->type>MP_IMGTYPE_EXPORT){
+    if(!mpi->bpp) mp_image_setfmt(mpi,sh->codec->outfmt[sh->outfmtidx]);
+    if(!(mpi->flags&MP_IMGFLAG_ALLOCATED) && mpi->type>MP_IMGTYPE_EXPORT){
+
+	// check libvo first!
+	vo_functions_t* vo=sh->video_out;
+	if(vo) vo->control(VOCTRL_GET_IMAGE,mpi);
+	
+        if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
           // non-direct and not yet allocaed image. allocate it!
-	  printf("*** Allocating mp_image_t, %dx%dx%dbpp %s %s, %d bytes\n",
-	          mpi->width,mpi->height,mpi->bpp,
-		  (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB",
-		  (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed",
-	          mpi->bpp*mpi->width*mpi->height/8);
 	  mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*mpi->height/8);
 	  if(mpi->flags&MP_IMGFLAG_PLANAR){
 	      // YV12/I420. feel free to add other planar formats here...
@@ -141,7 +142,17 @@
 	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8;
 	  }
 	  mpi->flags|=MP_IMGFLAG_ALLOCATED;
-      }
+        }
+	if(!(mpi->flags&MP_IMGFLAG_TYPE_DISPLAYED)){
+	    mp_msg(MSGT_DECVIDEO,MSGL_INFO,"*** %s mp_image_t, %dx%dx%dbpp %s %s, %d bytes\n",
+	          (mpi->flags&MP_IMGFLAG_DIRECT)?"Direct Rendering":"Allocating",
+	          mpi->width,mpi->height,mpi->bpp,
+		  (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB",
+		  (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed",
+	          mpi->bpp*mpi->width*mpi->height/8);
+	    mpi->flags|=MP_IMGFLAG_TYPE_DISPLAYED;
+	}
+	
     }
   }
   return mpi;




More information about the MPlayer-cvslog mailing list