[Sumover-dev] [svn commit] r4043 - in vic/branches/mpeg4: video

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed May 30 17:03:27 BST 2007


Author: piers
Date: Wed May 30 17:03:27 2007
New Revision: 4043

Modified:
   vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl
   vic/branches/mpeg4/video/grabber-v4l2.cpp
   vic/branches/mpeg4/video/grabber-video4linux.cpp

Log:
Applied patches from Doug Kosovic (Sent 28 May 07) - Thanks!
"One fixes an issue with the VIC_DEVICE env variable (as used by AGTk
3.02 and earlier) and grabber-v4l2.cpp . It didn't work when a V4L2
device is listed before the V4L, so don't list the V4L2 devices if
VIC_DEVICE env variable is set.

The other ui-ctrlmenu.tcl patch now allows specify V4L and V4L2 devices
like these examples:
 vic -D "V4L2:/dev/video1" 234.5.6.7/10000
 vic -D "V4L:/dev/vide0" 234.5.6.7/10000

I'll be checking in changes to the AG CVS repository to no longer use
the VIC_DEVICE env variable, but the new optional V4L/V4L2 command line
syntax and retro fitting the changes to the older AGTk 3.0.2 and AGTk
2.4 RPMs that I will release for Fedora 7."


Modified: vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl
==============================================================================
--- vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl	(original)
+++ vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl	Wed May 30 17:03:27 2007
@@ -176,6 +176,34 @@
 			return
 		}
 	}
+	if { [string equal -nocase -length 5 $d "V4L2:"] } {
+        	set d [string range $d 5 end]
+        	set k [string length $d]
+        	incr k -1
+		foreach v $inputDeviceList {
+	   		if { [string equal -length 5 [$v nickname] "V4L2-"] && \
+				[string range [$v nickname] end-$k end] == "$d" && \
+				[$v attributes] != "disabled" } {
+				set videoDevice $v
+				select_device $v
+				return
+			}
+		}
+	}
+	if { [string equal -nocase -length 4 $d "V4L:"] } {
+        	set d [string range $d 4 end]
+        	set k [string length $d]
+        	incr k -1
+		foreach v $inputDeviceList {
+	   		if { [string equal -length 4 [$v nickname] "V4L-"] && \
+				[string range [$v nickname] end-$k end] == "$d" && \
+				[$v attributes] != "disabled" } {
+				set videoDevice $v
+				select_device $v
+				return
+			}
+		}
+	}
 	foreach v $inputDeviceList {
 		if { "[$v attributes]" != "disabled" &&
 			"[$v nickname]" != "still" } {

Modified: vic/branches/mpeg4/video/grabber-v4l2.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-v4l2.cpp	(original)
+++ vic/branches/mpeg4/video/grabber-v4l2.cpp	Wed May 30 17:03:27 2007
@@ -209,6 +209,15 @@
         int  k,i,err,fd;
         char *nick, *attr;
 
+        // VIC_DEVICE env variable selects V4L device with AGTk 3.02 and earlier
+        // but doesn't work if V4L2 devices are listed before the V4L device
+        // so don't list V4L2 devices if VIC_DEVICE env variable is set.
+        const char *myDev = getenv("VIC_DEVICE");
+        if (myDev != 0)
+        {
+                 return;
+        }
+
         for (i = 0; dev[i] != NULL; i++) {
                 debug_msg("V4L2: trying %s... ",dev[i]);
                 if (-1 == (fd = open(dev[i],O_RDWR))) {

Modified: vic/branches/mpeg4/video/grabber-video4linux.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-video4linux.cpp	(original)
+++ vic/branches/mpeg4/video/grabber-video4linux.cpp	Wed May 30 17:03:27 2007
@@ -205,7 +205,7 @@
     int i, fd;
     char *nick, *attr;
 
-    // AGTk uses VIC_DEVICE env variable to select device
+    // AGTk 3.02 and earlier use VIC_DEVICE env variable to select device
     const char *myDev = getenv("VIC_DEVICE");
     if (myDev != 0)
     {



More information about the Sumover-dev mailing list