Author: duncan
Date: Sat Apr 14 17:51:12 2007
New Revision: 9435

Modified:
   branches/rel-1/freevo/local_conf.py.example
   branches/rel-1/freevo/src/tv/v4l2.py

Log:
[ 1691068 ] using nonstandard norm in freevo
Patch from Valera Koval applied


Modified: branches/rel-1/freevo/local_conf.py.example
==============================================================================
--- branches/rel-1/freevo/local_conf.py.example (original)
+++ branches/rel-1/freevo/local_conf.py.example Sat Apr 14 17:51:12 2007
@@ -1601,3 +1601,21 @@
 #             ,"track||'-'||title"]
 #     ,'alt_grouping':[None,None,'year||album','track']
 #     })
+#
+#
+#This addition for use more than one tv standard (like PAL, SECAM, NTSC, 
SECAM-DK)
+#without modification source code (this addition may be used exUSSR countries)
+#
+#For use with nonstandard norm for some freq
+#please add freq in freq list (see tv/freq.py):
+#TV_NONSTANDARD_FREQ=(59250, 77250, 85250, 183250, 215250)
+#
+#and
+#
+#set norm for this freq list
+#TV_NONSTANDARD_NORM='secam-dk'
+#
+#After restart freevo if you switch to channel with freq from 
+#TV_NONSTANDARD_FREQ list, you switch tuner to TV_NONSTANDARD_NORM standard
+#If freq will be not from TV_NONSTANDARD_FREQ, you will be switched to CONF.tv 
standard
+#

Modified: branches/rel-1/freevo/src/tv/v4l2.py
==============================================================================
--- branches/rel-1/freevo/src/tv/v4l2.py        (original)
+++ branches/rel-1/freevo/src/tv/v4l2.py        Sat Apr 14 17:51:12 2007
@@ -195,9 +195,10 @@
 
 
 NORMS = {
-    'NTSC'  : 0x3000,
-    'PAL'   : 0xff,
-    'SECAM' : 0x7f0000,
+    'NTSC'     : 0x00003000,
+    'PAL'      : 0x000000ff,
+    'SECAM'    : 0x007f0000,
+    'SECAM-DK' : 0x00320000,
 }
 
 
@@ -290,6 +291,33 @@
 
 
     def setfreq(self, freq):
+        #standard norm
+        (v_norm, v_input, v_clist, v_dev) = config.TV_SETTINGS.split()
+        std = NORMS.get(string.upper(v_norm))
+        if config.TV_NONSTANDARD_FREQ and config.TV_NONSTANDARD_NORM:
+            if string.upper(config.TV_NONSTANDARD_NORM) in NORMS.keys():
+                if DEBUG >= 3:
+                    print "found nonstandard freq list:",
+                    print config.TV_NONSTANDARD_FREQ
+                    print "found nonstandard norm: %s" % 
string.upper(config.TV_NONSTANDARD_NORM)
+                    
+                newfreq=freq*1000/16
+                if newfreq in config.TV_NONSTANDARD_FREQ:
+                    if DEBUG >= 3: print "new freq in TV_NONSTANDARD_FREQ: %r" 
% newfreq
+                    std = NORMS.get(string.upper(config.TV_NONSTANDARD_NORM))
+                    if DEBUG >= 3: print "prepare set new standard: 0x%x" % std
+            else:
+                print "Error! config.TV_NONSTANDARD_NORM value '%s' not from 
NORMS: %s" \
+                    % (config.TV_NONSTANDARD_NORM,NORMS.keys())
+
+        #get current norm
+        getst = self.getstd()
+        if DEBUG >= 3: print "get standard: 0x%x" % getst
+        if getst != std:
+            if DEBUG >= 3: print "set standard: 0x%x" % std
+            self.setstd(std)
+            sleep(1)
+
         val = struct.pack(FREQUENCY_ST, long(0), long(2), freq)
         r = fcntl.ioctl(self.device, i32(SETFREQ_NO), val)
         if DEBUG >= 3: print "setfreq: val=%r, r=%r" % (val, r)

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to