[AG-TECH] AG2.2 replacement for setupvideo.py

dgolden at cp.dias.ie dgolden at cp.dias.ie
Fri Jun 18 11:41:30 CDT 2004


>
> That makes sense, clearly the discovery of devices in that code is
> platform
> specific.
>
> If you can write a python function that enumerates them we can integrate
> that as a patch.
>

Not the most general fix ever,  but the below works:

--- Config.py.orig      2004-06-18 16:03:28.000000000 +0100
+++ Config.py   2004-06-18 17:35:31.000000000 +0100
@@ -641,11 +641,15 @@
         deviceList = dict()

         videodevpath = '/proc/video/dev'
+
+        if os.path.exists('/sys/class/video4linux'):
+            videodevpath = '/sys/class/video4linux'
+
         v4lctlexe = '/usr/bin/v4lctl'

         if os.path.exists(videodevpath):
             # Get list of devices
-            cmd = "ls /proc/video/dev | grep video"
+            cmd = "ls " + videodevpath + "/" + " | grep video"
             fh = os.popen(cmd,'r')
             for line in fh.readlines():
                 device = os.path.join('/dev',line.strip())





More information about the ag-tech mailing list