From 0ec9fc28a6058c5a574fb4a7196b758954c05492 Mon Sep 17 00:00:00 2001 From: gn64_jp Date: Sat, 12 May 2012 14:15:38 +0000 Subject: [PATCH] add tsid channel information for complete BS support. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@940 4e526526-5e11-4fc0-8910-f8fd03428081 --- rec10/trunk/src/recording_earth_pt1.py | 12 ++++++------ rec10/trunk/src/scan_ch.py | 4 ++-- rec10/trunk/src/tester.py | 9 ++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/rec10/trunk/src/recording_earth_pt1.py b/rec10/trunk/src/recording_earth_pt1.py index 4699aee..027bb5e 100644 --- a/rec10/trunk/src/recording_earth_pt1.py +++ b/rec10/trunk/src/recording_earth_pt1.py @@ -33,11 +33,11 @@ def channel2freq(channel):##freqを返す ch=int(channel.upper().replace("BS","")) freq=str((ch-1)*38360/2+1049480) return freq -def testTune(adapter,channel): +def testTune(adapter,channel,tsid): my_env=recdblist.getEnv() - tunecmd=configreader.getConfDVB("DVBtune")+u" "+adapter+u" "+channel2freq(channel) + #tunecmd=configreader.getConfDVB("DVBtune")+u" "+adapter+u" "+channel2freq(channel) #p1=subprocess.Popen(tunecmd,shell=True) - p1=subprocess.Popen([configreader.getConfDVB("DVBtune"),adapter,channel2freq(channel)],env=my_env,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + p1=subprocess.Popen([configreader.getConfDVB("DVBtune"),adapter,channel2freq(channel),tsid,"0.2","/dev/null"],env=my_env,stdout=subprocess.PIPE,stderr=subprocess.PIPE) time.sleep(0.2) try: os.kill(p1.pid,signal.SIGKILL) @@ -65,9 +65,9 @@ def getAdapter(channel): for i in chl: chlr.append(int(i)) return chlr -def getActiveAdapter(channel): +def getActiveAdapter(channel,tsid="0"): for i in getAdapter(channel): - rt=testTune(str(i),channel) + rt=testTune(str(i),channel,tsid) if rt==1: return str(i) def record(channel,tsid,out,timelength,decode=0): @@ -76,7 +76,7 @@ def record(channel,tsid,out,timelength,decode=0): ft.write(u"#!/bin/bash\n/bin/cat $1 > \"$2\"") ft.close() os.system(u"chmod +x "+tmppath+u"rec.sh") - adapt=getActiveAdapter(channel) + adapt=getActiveAdapter(channel,tsid) my_env=recdblist.getEnv() if adapt!=None: tunecmd=configreader.getConfDVB("DVBtune")+u" "+adapt+u" "+channel2freq(channel)+u" "+tsid+u" "+timelength+u" "+out diff --git a/rec10/trunk/src/scan_ch.py b/rec10/trunk/src/scan_ch.py index d6c12de..84a96b2 100644 --- a/rec10/trunk/src/scan_ch.py +++ b/rec10/trunk/src/scan_ch.py @@ -101,7 +101,7 @@ def checkTs(ch,tsid="0"): return 0 def addCh(ch,bctype,chtxthead,tsid="0"): - prglist=getChProgNum(ch)##[prglist,logt] + prglist=getChProgNum(ch,tsid)##[prglist,logt] for lstr in prglist[0]: #print [bctype,chtxthead+"_"+lstr, ch, lstr] try: @@ -116,7 +116,7 @@ def addCh(ch,bctype,chtxthead,tsid="0"): except Exception, inst: recdblist.addCommonlogEX("Warning", "addCh (scan_ch.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200) checkB25Purchased(ch, prglist[1]) -def getChProgNum(ch,tsid="0"): +def getChProgNum(ch,tsid): pout=os.path.join(tmppath,"ch_"+str(ch)+".ts") if tsid != "0": pout=os.path.join(tmppath,"ch_"+str(ch)+"_"+tsid+".ts") diff --git a/rec10/trunk/src/tester.py b/rec10/trunk/src/tester.py index 5ac0eee..ba59001 100644 --- a/rec10/trunk/src/tester.py +++ b/rec10/trunk/src/tester.py @@ -15,7 +15,7 @@ import os #import install #import datetime #import rec10d - +import scan_ch #import os #import time #import n_gram @@ -54,12 +54,11 @@ if __name__ == "__main__": #epgdb.updateLogo_bc("bs") #print ts2x264.getX264CoreVersion() #auto_process.killDeadEncode(recpath) - print "12" - print recording_earth_pt1.channel2freq("12") + #print "12" + #print recording_earth_pt1.channel2freq("12") print "BS2" print recording_earth_pt1.channel2freq("BS2") print "CS6" print recording_earth_pt1.channel2freq("CS6") - recording_earth_pt1.getActiveAdapter("1") - recording_earth_pt1.record("13", "0", "/home/yukikaze/dvb/rec10test.ts", "10") + scan_ch.searchCh() "" -- 2.11.0