X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb_ci%2Fdvbci.cpp;h=83bbed75c04ce8e7108c5835ea87347240cb552c;hp=0227c43cc080cabb74cd089327a356783442e501;hb=4fc2a70eeb86fa51b783b4a9c034b926db0013a3;hpb=14384e3f5aaf81897d1931a14afd11d855bd6140 diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 0227c43..83bbed7 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -332,6 +332,20 @@ void eDVBCIInterfaces::recheckPMTHandlers() eDebug("'%s' is in service list of slot %d... so use it", ref.toString().c_str(), ci_it->getSlotID()); useThis = true; } + else // check parent + { + eServiceReferenceDVB parent_ref = ref.getParentServiceReference(); + if (parent_ref) + { + it = ci_it->possible_services.find(ref); + if (it != ci_it->possible_services.end()) + { + eDebug("parent '%s' of '%s' is in service list of slot %d... so use it", + parent_ref.toString().c_str(), ref.toString().c_str(), ci_it->getSlotID()); + useThis = true; + } + } + } } if (!useThis && !ci_it->possible_providers.empty()) { @@ -354,6 +368,7 @@ void eDVBCIInterfaces::recheckPMTHandlers() } if (!useThis && !ci_it->possible_caids.empty()) { + mask |= 4; for (CAID_LIST::iterator ca(caids.begin()); ca != caids.end(); ++ca) { caidSet::iterator it = ci_it->possible_caids.find(*ca); @@ -898,6 +913,31 @@ RESULT eDVBCIInterfaces::setDescrambleRules(int slotid, SWIG_PYOBJECT(ePyObject) return 0; } +PyObject *eDVBCIInterfaces::readCICaIds(int slotid) +{ + eDVBCISlot *slot = getSlot(slotid); + if (!slot) + { + char tmp[255]; + snprintf(tmp, 255, "eDVBCIInterfaces::readCICaIds try to get CAIds for CI Slot %d... but just %d slots are available", slotid, m_slots.size()); + PyErr_SetString(PyExc_StandardError, tmp); + } + else + { + int idx=0; + eDVBCICAManagerSession *ca_manager = slot->getCAManager(); + const std::vector *ci_caids = ca_manager ? &ca_manager->getCAIDs() : 0; + ePyObject list = PyList_New(ci_caids ? ci_caids->size() : 0); + if (ci_caids) + { + for (std::vector::const_iterator it = ci_caids->begin(); it != ci_caids->end(); ++it) + PyList_SET_ITEM(list, idx++, PyLong_FromLong(*it)); + } + return list; + } + return 0; +} + int eDVBCISlot::send(const unsigned char *data, size_t len) { int res=0;