Author: duncan
Date: Sun Apr 15 20:49:01 2007
New Revision: 9462
Modified:
branches/rel-1/freevo/local_conf.py.example
branches/rel-1/freevo/src/tv/plugins/ivtv_record.py
branches/rel-1/freevo/src/tv/plugins/mplayer.py
branches/rel-1/freevo/src/tv/v4l2.py
Log:
[ 1694182 ] using nonstandard norm in freevo (PART II)
REVERSED [ 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 Sun Apr 15 20:49:01 2007
@@ -1601,21 +1601,3 @@
# ,"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/plugins/ivtv_record.py
==============================================================================
--- branches/rel-1/freevo/src/tv/plugins/ivtv_record.py (original)
+++ branches/rel-1/freevo/src/tv/plugins/ivtv_record.py Sun Apr 15 20:49:01 2007
@@ -44,6 +44,7 @@
from event import Event
from tv.channels import FreevoChannels
+import tv.v4l2 as V4L2
DEBUG = config.DEBUG
@@ -123,6 +124,14 @@
if DEBUG: print 'Setting Input to %s' % vg.input_num
v.setinput(vg.input_num)
+ cur_std = v.getstd()
+ try:
+ new_std = V4L2.NORMS.get(vg.tuner_norm)
+ if cur_std != new_std:
+ v.setstd(new_std)
+ except:
+ print "Error! Videogroup norm value '%s' not from NORMS:
%s" \
+ % (vg.tuner_norm,V4L2.NORMS.keys())
if DEBUG: print 'Setting Channel to %s' % self.prog.tunerid
fc.chanSet(str(self.prog.tunerid), False)
Modified: branches/rel-1/freevo/src/tv/plugins/mplayer.py
==============================================================================
--- branches/rel-1/freevo/src/tv/plugins/mplayer.py (original)
+++ branches/rel-1/freevo/src/tv/plugins/mplayer.py Sun Apr 15 20:49:01 2007
@@ -101,6 +101,15 @@
ivtv_dev = ivtv.IVTV(vg.vdev)
ivtv_dev.init_settings()
ivtv_dev.setinput(vg.input_num)
+ cur_std = ivtv_dev.getstd()
+ import tv.v4l2
+ try:
+ new_std = tv.v4l2.NORMS.get(vg.tuner_norm)
+ if cur_std != new_std:
+ ivtv_dev.setstd(new_std)
+ except:
+ print "Error! Videogroup norm value '%s' not from NORMS:
%s" \
+ % (vg.tuner_norm,tv.v4l2.NORMS.keys())
#ivtv_dev.print_settings()
ivtv_dev.close()
self.fc.chanSet(tuner_channel, True)
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 Sun Apr 15 20:49:01 2007
@@ -193,7 +193,6 @@
0x0020 : 'SLIDER',
}
-
NORMS = {
'NTSC' : 0x00003000,
'PAL' : 0x000000ff,
@@ -291,33 +290,6 @@
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