summaryrefslogtreecommitdiffstats
path: root/tvision.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-10 23:37:25 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-10 23:37:25 +0000
commit437489c79649c6b6c47a4994b27af90c9d8a6f4d (patch)
tree384cca9153e79ecb227ea93e189d06acf97e3119 /tvision.c
parentfc363d39bc8a1aecc72b62c1108d7cc3b0b40a64 (diff)
downloadmpv-437489c79649c6b6c47a4994b27af90c9d8a6f4d.tar.bz2
mpv-437489c79649c6b6c47a4994b27af90c9d8a6f4d.tar.xz
uyvy->yv12->postprocess->libvo
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2804 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'tvision.c')
-rw-r--r--tvision.c49
1 files changed, 44 insertions, 5 deletions
diff --git a/tvision.c b/tvision.c
index 6c8da13a36..61af2ea6eb 100644
--- a/tvision.c
+++ b/tvision.c
@@ -45,8 +45,14 @@ int i;
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 @@ int count=0;
}
/* 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 @@ int count=0;
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++;