comparison libvo/vo_zr.c @ 4259:f96a2b9b41eb

Added reverting support for -zr* options
author albeu
date Sat, 19 Jan 2002 17:02:50 +0000
parents 3a5f381c8c19
children d4acef803c94
comparison
equal deleted inserted replaced
4258:31ed0b5d8126 4259:f96a2b9b41eb
71 struct video_capability vc; 71 struct video_capability vc;
72 #define MJPEG_NBUFFERS 2 72 #define MJPEG_NBUFFERS 2
73 #define MJPEG_SIZE 1024*256 73 #define MJPEG_SIZE 1024*256
74 74
75 //should be command line options 75 //should be command line options
76 int norm = VIDEO_MODE_AUTO; 76 int norm = VIDEO_MODE_AUTO;
77 char *device = "/dev/video"; 77 #ifndef VO_ZR_DEFAULT_DEVICE
78 #define VO_ZR_DEFAULT_DEVICE "/dev/video"
79 #endif
80 char *device = NULL;
78 81
79 82
80 #ifdef ZR_USES_LIBJPEG 83 #ifdef ZR_USES_LIBJPEG
81 #include<jpeglib.h> 84 #include<jpeglib.h>
82 int ccount; 85 int ccount;
205 return 0; 208 return 0;
206 } 209 }
207 210
208 211
209 int zoran_getcap() { 212 int zoran_getcap() {
210 vdes = open(device, O_RDWR); 213 char* dev = device ? device : VO_ZR_DEFAULT_DEVICE;
214 vdes = open(dev, O_RDWR);
211 /* before we can ask for the maximum resolution, we must set 215 /* before we can ask for the maximum resolution, we must set
212 * the correct tv norm */ 216 * the correct tv norm */
213 217
214 if (ioctl(vdes, BUZIOC_G_PARAMS, &zp) < 0) { 218 if (ioctl(vdes, BUZIOC_G_PARAMS, &zp) < 0) {
215 mp_msg(MSGT_VO, MSGL_ERR, "device at %s is probably not a DC10(+)/buz/lml33\n", device); 219 mp_msg(MSGT_VO, MSGL_ERR, "device at %s is probably not a DC10(+)/buz/lml33\n", dev);
216 return 1; 220 return 1;
217 } 221 }
218 222
219 if (zp.norm != norm && norm != VIDEO_MODE_AUTO) { 223 if (zp.norm != norm && norm != VIDEO_MODE_AUTO) {
220 /* attempt to set requested norm */ 224 /* attempt to set requested norm */
232 } 236 }
233 } 237 }
234 238
235 if (vdes < 0) { 239 if (vdes < 0) {
236 mp_msg(MSGT_VO, MSGL_ERR, "error opening %s\n", 240 mp_msg(MSGT_VO, MSGL_ERR, "error opening %s\n",
237 device); 241 dev);
238 return 1; 242 return 1;
239 } 243 }
240 244
241 245
242 if (ioctl(vdes, VIDIOCGCAP, &vc) < 0) { 246 if (ioctl(vdes, VIDIOCGCAP, &vc) < 0) {
639 exit(0); 643 exit(0);
640 644
641 } 645 }
642 return ERR_NOT_AN_OPTION; 646 return ERR_NOT_AN_OPTION;
643 } 647 }
648
649 void vo_zr_revertoption(config_t* opt,char* param) {
650
651 if (!strcasecmp(param, "zrdev")) {
652 if(device)
653 free(device);
654 device=NULL;
655 } else if (!strcasecmp(param, "zrfi"))
656 forceinter=0;
657 else if (!strcasecmp(param, "zrcrop"))
658 g.set = g.xoff = g.yoff = 0;
659 else if (!strcasecmp(param, "zrvdec"))
660 vdec = 1;
661 else if (!strcasecmp(param, "zrquality"))
662 quality = 70;
663 else if (!strcasecmp(param, "zrdct"))
664 jpegdct = JDCT_IFAST;
665 else if (!strcasecmp(param, "zrnorm"))
666 norm = VIDEO_MODE_AUTO;
667
668 }