[Mplayer-cvslog] CVS: main tvision.c,1.1.1.1,1.2

Arpi of Ize arpi at mplayer.dev.hu
Sun Nov 11 00:37:27 CET 2001


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

Modified Files:
	tvision.c 
Log Message:
uyvy->yv12->postprocess->libvo

Index: tvision.c
===================================================================
RCS file: /cvsroot/mplayer/main/tvision.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- tvision.c	24 Feb 2001 20:28:40 -0000	1.1.1.1
+++ tvision.c	10 Nov 2001 23:37:25 -0000	1.2
@@ -45,8 +45,14 @@
 int fd=-1;
 char* frame=NULL;
 int count=0;
+unsigned char* tmpframe=NULL;
+unsigned char* tmpframe2=NULL;
+unsigned char* planes[3];
+unsigned int stride[3];
+unsigned char* planes2[3];
+unsigned int stride2[3];
 
-  if(argc>1) video_driver=argv[1];
+//  if(argc>1) video_driver=argv[1];
 
 // check video_out driver name:
   if(!video_driver)
@@ -91,20 +97,37 @@
     }
 
     /* prepare for grabbing */
-    gb1.format = VIDEO_PALETTE_YUV422;
+    gb1.format = (argc>1) ? atoi(argv[1]) : VIDEO_PALETTE_YUV422;
+//    gb1.format = VIDEO_PALETTE_YUV420;
 //    gb1.format = VIDEO_PALETTE_RGB24;
     gb1.frame  = 0;
-    gb1.width  = 352;//720;//640;//320;
-    gb1.height = 288;//576;//480;//240;
+    gb1.width  = 704;//640;//320;
+    gb1.height = 576;//480;//240;
 
     gb2.format = gb1.format;
     gb2.frame  = 1;
     gb2.width  = gb1.width;
     gb2.height = gb1.height;
 
-    video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_YUY2);
+    video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_YV12);
+//    video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_UYVY);
+//    video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_YUY2);
 //    video_out->init(gb1.width,gb1.height,1024,768,0,0,IMGFMT_RGB|24);
 
+    tmpframe=malloc(gb1.width*gb1.height*3/2);
+    stride[0]=(gb1.width+15)&(~15);
+    stride[1]=stride[2]=stride[0]/2;
+    planes[0]=tmpframe;
+    planes[1]=planes[0]+stride[0]*gb1.height;
+    planes[2]=planes[1]+stride[0]*gb1.height/4;
+
+    tmpframe2=malloc(gb1.width*gb1.height*3/2);
+    stride2[0]=(gb1.width+15)&(~15);
+    stride2[1]=stride2[2]=stride2[0]/2;
+    planes2[0]=tmpframe2;
+    planes2[1]=planes2[0]+stride2[0]*gb1.height;
+    planes2[2]=planes2[1]+stride2[0]*gb1.height/4;
+
     if (-1 == ioctl(fd,VIDIOCMCAPTURE,&gb1)) {
 	if (errno == EAGAIN)
 	    fprintf(stderr,"grabber chip can't sync (no station tuned in?)\n");
@@ -128,7 +151,23 @@
 	    exit(1);
 	}
         frame=map + gb_buffers.offsets[(count%2) ? 0 : 1];
+#if 0
         video_out->draw_frame((unsigned char**)&frame);
+#else
+	{ 
+	  uyvytoyv12(frame,planes[0],planes[1],planes[2],
+	  gb1.width,gb1.height,
+	  stride[0],stride[1],gb1.width*2);
+	  
+
+	  postprocess(planes,stride[0],
+	              planes2,stride2[0],
+		      gb1.width,gb1.height,
+		      planes[0],0, 0x20000);
+	  
+          video_out->draw_slice(planes2,stride2,gb1.width,gb1.height,0,0);
+	}
+#endif
         video_out->flip_page();
         
         count++;




More information about the MPlayer-cvslog mailing list