+ def setTranscoding(self, configElement):
+ encoder = configElement.value
+ procPath = "/proc/stb/encoder/enable"
+ if self.setConfig(procPath, encoder):
+ self.showMessage("Set encoder %s failed."%encoder, MessageBox.TYPE_ERROR)
+ elif encoder == "enable" and config.plugins.transcodingsetup.port.value == "8001":
+ msg = "OK. Encoder enable.\nPC Streaming is replaced with mobile streaming."
+ self.showMessage(msg, MessageBox.TYPE_INFO)
+ else:
+ self.showMessage("OK. Encoder %s."%encoder, MessageBox.TYPE_INFO)
+ if encoder == "disable":
+ config.plugins.transcodingsetup.port.value = "8002"
+
+ def setBitrate(self, configElement):
+ bitrate = configElement.value
+ procPath = "/proc/stb/encoder/0/bitrate"
+ if self.setConfig(procPath, bitrate):
+ fd = open(procPath,'r')
+ curValue = fd.read().strip(' ').strip('\n')
+ fd.close()
+ if curValue.isdigit():
+ config.plugins.transcodingsetup.bitrate.value = int(curValue)
+ config.plugins.transcodingsetup.bitrate.save()
+ self.showMessage("Set bitrate failed.", MessageBox.TYPE_ERROR)
+
+ def serFramerate(self, configElement):
+ framerate = configElement.value
+ procPath = "/proc/stb/encoder/0/framerate"
+ if self.setConfig(procPath, framerate):
+ self.showMessage("Set framerate failed.", MessageBox.TYPE_ERROR)
+
+ def setPort(self, configElement):
+ port = configElement.value
+ print "[TranscodingSetup] set port ",port