X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/24c472e37de8db4007cdd4c5d67d3fd4e914f0b1..dea2fe0418b7e3761ff8f7a1f59e4066b3ed2cc8:/lib/dvb_ci/dvbci.cpp diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 9c4e0ac2..b074342e 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -6,6 +6,7 @@ #include #include +#include // access to python config #include #include #include @@ -61,7 +62,7 @@ eDVBCISlot *eDVBCIInterfaces::getSlot(int slotid) if(i->getSlotID() == slotid) return i; - printf("FIXME: request for unknown slot\n"); + eDebug("FIXME: request for unknown slot"); return 0; } @@ -217,6 +218,23 @@ void eDVBCIInterfaces::ciRemoved(eDVBCISlot *slot) } } +static bool canDescrambleMultipleServices(int slotid) +{ + char configStr[255]; + snprintf(configStr, 255, "config.ci.%d.canDescrambleMultipleServices", slotid); + std::string str; + ePythonConfigQuery::getConfigValue(configStr, str); + if ( str == "auto" ) + { + std::string appname = eDVBCI_UI::getInstance()->getAppName(slotid); + if (appname.find("AlphaCrypt") != std::string::npos) + return true; + } + else if (str == "yes") + return true; + return false; +} + void eDVBCIInterfaces::recheckPMTHandlers() { // eDebug("recheckPMTHAndlers()"); @@ -278,7 +296,6 @@ void eDVBCIInterfaces::recheckPMTHandlers() { if ( tmp->cislot ) { - bool canHandleMultipleServices=false; eServiceReferenceDVB ref2; tmp->pmthandler->getServiceReference(ref2); eDVBChannelID s1, s2; @@ -286,15 +303,8 @@ void eDVBCIInterfaces::recheckPMTHandlers() { ref.getChannelID(s1); ref2.getChannelID(s2); - // FIXME .. build a "ci can handle multiple services" config entry - // Yes / No / Auto - if ( eDVBCI_UI::getInstance()->getAppName(ci_it->getSlotID()) == "AlphaCrypt" ) - { - canHandleMultipleServices = true; - eDebug("Alphacrypt can handle multiple services"); - } } - if (ref == ref2 || (s1 == s2 && canHandleMultipleServices) ) + if (ref == ref2 || (s1 == s2 && canDescrambleMultipleServices(ci_it->getSlotID()))) { it->cislot = tmp->cislot; ++it->cislot->use_count; @@ -412,10 +422,10 @@ int eDVBCISlot::send(const unsigned char *data, size_t len) { int res=0; //int i; - //printf("< "); + //eDebugNoNewLine("< "); //for(i=0;i 0) { // int i; -// printf("> "); +// eDebugNoNewLine("> "); // for(i=0;istartMMI(); @@ -582,7 +592,7 @@ int eDVBCISlot::startMMI() int eDVBCISlot::stopMMI() { - printf("edvbcislot: stopMMI()\n"); + eDebug("edvbcislot: stopMMI()"); if(mmi_session) mmi_session->stopMMI(); @@ -592,7 +602,7 @@ int eDVBCISlot::stopMMI() int eDVBCISlot::answerText(int answer) { - printf("edvbcislot: answerText(%d)\n", answer); + eDebug("edvbcislot: answerText(%d)", answer); if(mmi_session) mmi_session->answerText(answer); @@ -610,7 +620,7 @@ int eDVBCISlot::getMMIState() int eDVBCISlot::answerEnq(char *value) { - printf("edvbcislot: answerENQ(%s)\n", value); + eDebug("edvbcislot: answerENQ(%s)", value); if(mmi_session) mmi_session->answerEnq(value); @@ -620,7 +630,7 @@ int eDVBCISlot::answerEnq(char *value) int eDVBCISlot::cancelEnq() { - printf("edvbcislot: cancelENQ\n"); + eDebug("edvbcislot: cancelENQ"); if(mmi_session) mmi_session->cancelEnq(); @@ -730,20 +740,20 @@ void eDVBCISlot::removeService(uint16_t program_number) int eDVBCISlot::enableTS(int enable, int tuner) { -// printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); -// printf("eDVBCISlot::enableTS(%d %d)\n", enable, tuner); +// eDebug("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); +// eDebug("eDVBCISlot::enableTS(%d %d)", enable, tuner); FILE *input0, *input1, *ci; if((input0 = fopen("/proc/stb/tsmux/input0", "wb")) == NULL) { - printf("cannot open /proc/stb/tsmux/input0\n"); + eDebug("cannot open /proc/stb/tsmux/input0"); return 0; } if((input1 = fopen("/proc/stb/tsmux/input1", "wb")) == NULL) { - printf("cannot open /proc/stb/tsmux/input1\n"); + eDebug("cannot open /proc/stb/tsmux/input1"); return 0; } if((ci = fopen("/proc/stb/tsmux/input2", "wb")) == NULL) { - printf("cannot open /proc/stb/tsmux/input2\n"); + eDebug("cannot open /proc/stb/tsmux/input2"); return 0; }