if fileExists(x[1]):
TranscodingConfigList.append(x)
+ def getModel(self):
+ if fileExists("/proc/stb/info/vumodel"):
+ fd = open("/proc/stb/info/vumodel")
+ vumodel=fd.read().strip()
+ fd.close()
+ return vumodel
+ else:
+ return False
+
def createConfig(self):
config.plugins.transcodingsetup = ConfigSubsection()
config.plugins.transcodingsetup.transcoding = ConfigSelection(default = "disable", choices = [ ("enable", _("enable")), ("disable", _("disable"))] )
global TranscodingConfigList
for x in TranscodingConfigList:
if x[0] == "Bitrate":
- config.plugins.transcodingsetup.bitrate = ConfigInteger(default = 2000000, limits = (100000, 5000000))
+ if self.getModel() == "solo2":
+ default_bitrate = 400000
+ br_min = 50000
+ br_max = 1000000
+ else:
+ default_bitrate = 2000000
+ br_min = 100000
+ br_max = 5000000
+ config.plugins.transcodingsetup.bitrate = ConfigInteger(default = default_bitrate, limits = (br_min, br_max))
x.append(config.plugins.transcodingsetup.bitrate)
elif x[0] == "Framerate":
- config.plugins.transcodingsetup.framerate = ConfigSelection(default = "30000", choices = [ ("23976", _("23976")), ("24000", _("24000")), ("29970", _("29970")), ("30000", _("30000")), ("59940", _("59940")), ("60000", _("60000"))])
+ config.plugins.transcodingsetup.framerate = ConfigSelection(default = "30000", choices = [ ("23976", _("23976")), ("24000", _("24000")), ("25000", _("25000")), ("29970", _("29970")), ("30000", _("30000")), ("50000", _("50000")), ("59940", _("59940")), ("60000", _("60000"))])
x.append(config.plugins.transcodingsetup.framerate)
def setTranscoding(self, transcoding, port):
if transcoding not in ["enable","disable"] or port not in ["8001","8002"]:
- print "Input error."
+# print "Input error."
return -7
if not fileExists("/proc/stb/encoder/enable"):
return -1
return res
def setEncoderEnable(self,mode = "disable"):
- print "<TranscodingSetup> set encoder %s" % mode
+# print "<TranscodingSetup> set encoder %s" % mode
mode = mode.strip(' ').strip('\n')
try:
fd = open("/proc/stb/encoder/enable",'r')
return -1
def setPort(self, port = "8001"):
- print "<TranscodingSetup> set port %s" % port
+# print "<TranscodingSetup> set port %s" % port
try:
fp = file('/etc/inetd.conf', 'r')
datas = fp.readlines()
def inetdRestart(self):
if fileExists("/etc/init.d/inetd"):
os_system("/etc/init.d/inetd restart")
+ elif fileExists("/etc/init.d/inetd.busybox"):
+ os_system("/etc/init.d/inetd.busybox restart")
def setEncoderExtra(self):
global TranscodingConfigList
return 0
def setEncoder(self, procPath, value):
- print "<TranscodingSetup> set %s "%procPath, value
+# print "<TranscodingSetup> set %s "%procPath, value
if not fileExists(procPath):
return -1
if isinstance(value, str):
old_value = fd.read().strip(' ').strip('\n')
fd.close()
if old_value != value:
+ print "<TranscodingSetup> set %s "%procPath, value
fd = open(procPath,'w')
fd.write(value)
fd.close()