changeset 4259:f96a2b9b41eb

Added reverting support for -zr* options
author albeu
date Sat, 19 Jan 2002 17:02:50 +0000
parents 31ed0b5d8126
children d0b80b2a136f
files libvo/vo_zr.c
diffstat 1 files changed, 30 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_zr.c	Sat Jan 19 17:01:48 2002 +0000
+++ b/libvo/vo_zr.c	Sat Jan 19 17:02:50 2002 +0000
@@ -73,8 +73,11 @@
 #define MJPEG_SIZE	1024*256
 
 //should be command line options
-int norm = VIDEO_MODE_AUTO; 
-char *device = "/dev/video";
+int norm = VIDEO_MODE_AUTO;
+#ifndef VO_ZR_DEFAULT_DEVICE
+#define VO_ZR_DEFAULT_DEVICE "/dev/video"
+#endif
+char *device = NULL;
 
 
 #ifdef ZR_USES_LIBJPEG
@@ -207,12 +210,13 @@
 
 
 int zoran_getcap() {
-	vdes = open(device, O_RDWR);
+	char* dev = device ? device : VO_ZR_DEFAULT_DEVICE;
+	vdes = open(dev, O_RDWR);
 	/* before we can ask for the maximum resolution, we must set 
 	 * the correct tv norm */
 
 	if (ioctl(vdes, BUZIOC_G_PARAMS, &zp) < 0) {
-		mp_msg(MSGT_VO, MSGL_ERR, "device at %s is probably not a DC10(+)/buz/lml33\n", device);
+		mp_msg(MSGT_VO, MSGL_ERR, "device at %s is probably not a DC10(+)/buz/lml33\n", dev);
 		return 1;
 	}
 	
@@ -234,7 +238,7 @@
 	
 	if (vdes < 0) {
 		mp_msg(MSGT_VO, MSGL_ERR, "error opening %s\n", 
-				device);
+				dev);
 		return 1;
 	}
 
@@ -641,3 +645,24 @@
     }
     return ERR_NOT_AN_OPTION;
 }
+
+void vo_zr_revertoption(config_t* opt,char* param) {
+
+  if (!strcasecmp(param, "zrdev")) {
+    if(device)
+      free(device);
+    device=NULL;
+  } else if (!strcasecmp(param, "zrfi"))
+    forceinter=0;
+  else if (!strcasecmp(param, "zrcrop"))
+    g.set = g.xoff = g.yoff = 0;
+  else if (!strcasecmp(param, "zrvdec"))
+    vdec = 1;
+  else if (!strcasecmp(param, "zrquality"))
+    quality = 70;
+  else if (!strcasecmp(param, "zrdct"))
+    jpegdct = JDCT_IFAST;
+  else if (!strcasecmp(param, "zrnorm"))
+    norm = VIDEO_MODE_AUTO;
+
+}