From a2b81eb390ee9cfb892734251429a062a4fa77e4 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 15 Mar 2009 11:58:52 +0100 Subject: [PATCH] add "High bitrate support" choice in CI Setup (needs new drivers to work) --- data/skin_default.xml | 4 ++-- lib/dvb_ci/dvbci.cpp | 25 +++++++++++++++++++++++++ lib/dvb_ci/dvbci.h | 2 ++ lib/dvb_ci/dvbci_ui.cpp | 5 +++++ lib/dvb_ci/dvbci_ui.h | 2 ++ lib/python/Screens/Ci.py | 21 +++++++++++++++++++-- po/de.po | 3 +++ po/enigma2.pot | 4 ++++ 8 files changed, 62 insertions(+), 4 deletions(-) diff --git a/data/skin_default.xml b/data/skin_default.xml index f99e1a7..ed3b8a2 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -172,9 +172,9 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count > 7 and 2 or 3) - + - + diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 8fa1bca..ce1f7d6 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -938,6 +938,14 @@ PyObject *eDVBCIInterfaces::readCICaIds(int slotid) return 0; } +int eDVBCIInterfaces::setCIClockRate(int slotid, int rate) +{ + eDVBCISlot *slot = getSlot(slotid); + if (slot) + return slot->setClockRate(rate); + return -1; +} + int eDVBCISlot::send(const unsigned char *data, size_t len) { int res=0; @@ -1323,4 +1331,21 @@ int eDVBCISlot::setSource(data_source source) return 0; } +int eDVBCISlot::setClockRate(int rate) +{ + char buf[64]; + snprintf(buf, 64, "/proc/stb/tsmux/ci%d_tsclk", slotid); + FILE *ci = fopen(buf, "wb"); + if (ci) + { + if (rate) + fprintf(ci, "high"); + else + fprintf(ci, "normal"); + fclose(ci); + return 0; + } + return -1; +} + eAutoInitP0 init_eDVBCIInterfaces(eAutoInitNumbers::dvb, "CI Slots"); diff --git a/lib/dvb_ci/dvbci.h b/lib/dvb_ci/dvbci.h index c11a120..cdaaf90 100644 --- a/lib/dvb_ci/dvbci.h +++ b/lib/dvb_ci/dvbci.h @@ -94,6 +94,7 @@ public: void removeService(uint16_t program_number=0xFFFF); int getNumOfServices() { return running_services.size(); } int setSource(data_source source); + int setClockRate(int); }; struct CIPmtHandler @@ -146,6 +147,7 @@ public: int getMMIState(int slot); int sendCAPMT(int slot); int setInputSource(int tunerno, data_source source); + int setCIClockRate(int slot, int rate); #ifdef SWIG public: #endif diff --git a/lib/dvb_ci/dvbci_ui.cpp b/lib/dvb_ci/dvbci_ui.cpp index af613c4..b1bfdc2 100644 --- a/lib/dvb_ci/dvbci_ui.cpp +++ b/lib/dvb_ci/dvbci_ui.cpp @@ -71,5 +71,10 @@ int eDVBCI_UI::getMMIState(int slot) return eDVBCIInterfaces::getInstance()->getMMIState(slot); } +int eDVBCI_UI::setClockRate(int slot, int rate) +{ + return eDVBCIInterfaces::getInstance()->setCIClockRate(slot, rate); +} + //FIXME: correct "run/startlevel" eAutoInitP0 init_dvbciui(eAutoInitNumbers::rc, "DVB-CI UI"); diff --git a/lib/dvb_ci/dvbci_ui.h b/lib/dvb_ci/dvbci_ui.h index b53ab02..65b0f95 100644 --- a/lib/dvb_ci/dvbci_ui.h +++ b/lib/dvb_ci/dvbci_ui.h @@ -13,6 +13,7 @@ class eDVBCI_UI: public eMMI_UI #endif void stateChanged(int val) { ciStateChanged(val); } public: + enum { rateNormal, rateHigh }; PSignal1 ciStateChanged; #ifndef SWIG eDVBCI_UI(); @@ -26,6 +27,7 @@ public: int answerMenu(int slot, int answer); int answerEnq(int slot, char *val); int cancelEnq(int slot); + int setClockRate(int slot, int rate); }; #endif diff --git a/lib/python/Screens/Ci.py b/lib/python/Screens/Ci.py index a997f7f..19f4d92 100644 --- a/lib/python/Screens/Ci.py +++ b/lib/python/Screens/Ci.py @@ -12,11 +12,21 @@ from enigma import eTimer, eDVBCI_UI, eDVBCIInterfaces MAX_NUM_CI = 4 +def setCIBitrate(configElement): + if configElement.value == "no": + eDVBCI_UI.getInstance().setClockRate(configElement.slotid, eDVBCI_UI.rateNormal) + else: + eDVBCI_UI.getInstance().setClockRate(configElement.slotid, eDVBCI_UI.rateHigh) + def InitCiConfig(): config.ci = ConfigSubList() for slot in range(MAX_NUM_CI): config.ci.append(ConfigSubsection()) config.ci[slot].canDescrambleMultipleServices = ConfigSelection(choices = [("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default = "auto") + if SystemInfo["CommonInterfaceSupportsHighBitrates"]: + config.ci[slot].canHandleHighBitrates = ConfigSelection(choices = [("no", _("No")), ("yes", _("Yes"))], default = "no") + config.ci[slot].canHandleHighBitrates.slotid = slot + config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate) class MMIDialog(Screen): def __init__(self, session, slotid, action, handler = eDVBCI_UI.getInstance(), wait_text = _("wait for ci...") ): @@ -226,7 +236,13 @@ class CiMessageHandler: self.ci = { } self.dlgs = { } eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged) - SystemInfo["CommonInterface"]= eDVBCIInterfaces.getInstance().getNumOfSlots() > 0 + SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots() > 0 + try: + file = open("/proc/stb/tsmux/ci0_tsclk", "r") + file.close() + SystemInfo["CommonInterfaceSupportsHighBitrates"] = True + except: + SystemInfo["CommonInterfaceSupportsHighBitrates"] = False def setSession(self, session): self.session = session @@ -285,7 +301,7 @@ class CiSelection(Screen): def selectionChanged(self): cur_idx = self["entries"].getCurrentIndex() - self["text"].setText(_("Slot %d")%((cur_idx / 4)+1)) + self["text"].setText(_("Slot %d")%((cur_idx / 5)+1)) def keyConfigEntry(self, key): try: @@ -315,6 +331,7 @@ class CiSelection(Screen): self.list.append( (appname, ConfigNothing(), 2, slot) ) self.list.append(getConfigListEntry(_("Multiple service support"), config.ci[slot].canDescrambleMultipleServices)) + self.list.append(getConfigListEntry(_("High bitrate support"), config.ci[slot].canHandleHighBitrates)) def updateState(self, slot): state = eDVBCI_UI.getInstance().getState(slot) diff --git a/po/de.po b/po/de.po index 6fc8257..acf7d8a 100644 --- a/po/de.po +++ b/po/de.po @@ -1541,6 +1541,9 @@ msgstr "Hierarchieinformationen" msgid "Hierarchy mode" msgstr "Hierarchiemodus" +msgid "High bitrate support" +msgstr "Kann hohe Datenraten verarbeiten" + msgid "Horizontal" msgstr "" diff --git a/po/enigma2.pot b/po/enigma2.pot index 0e63744..e8cc831 100644 --- a/po/enigma2.pot +++ b/po/enigma2.pot @@ -1828,6 +1828,10 @@ msgstr "" msgid "Hierarchy mode" msgstr "" +#: ../lib/python/Screens/Ci.py:334 +msgid "High bitrate support" +msgstr "" + #: ../lib/python/Tools/Transponder.py:31 msgid "Horizontal" msgstr "" -- 2.7.4