Hi!

In my country (and in other exUSSR-countries) TV operators use two standards: SECAM and PAL. In current freevo configuration I can select only one standard for all channels.

My patch add feature in freevo for using second TV standard for the list of selected freq's with switching to other standard. See example in local_conf.py.example.



Index: local_conf.py.example
===================================================================
--- local_conf.py.example   (revision 9367)
+++ local_conf.py.example   (working copy)
@@ -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
+#
Index: src/tv/v4l2.py
===================================================================
--- src/tv/v4l2.py  (revision 9367)
+++ src/tv/v4l2.py  (working copy)
@@ -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)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to