X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/787d93752ee846a26edb4643db3f44ddd33e06f3..d41938053190e075de41c63acfdcea3e239dcaba:/lib/dvb_ci/dvbci.cpp diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 9a551df0..235b0ac3 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -73,6 +73,8 @@ int eDVBCIInterfaces::reset(int slotid) if( (slot = getSlot(slotid)) == 0 ) return -1; + eDVBCISession::deleteSessions(slot); + return slot->reset(); } @@ -83,19 +85,37 @@ int eDVBCIInterfaces::enableTS(int slotid, int enable) if( (slot = getSlot(slotid)) == 0 ) return -1; + int tunernum = 0; if (enable) { - slot->resetPrevSentCAPMTVersion(); + tunernum=-1; PMTHandlerList::iterator it = m_pmt_handlers.begin(); while (it != m_pmt_handlers.end()) { if ( it->cislot == slot ) - slot->sendCAPMT(it->pmthandler); // send capmt + { + eDVBServicePMTHandler *pmthandler = it->pmthandler; + eUsePtr channel; + if (!pmthandler->getChannel(channel)) + { + ePtr frontend; + if (!channel->getFrontend(frontend)) + { + eDVBFrontend *fe = (eDVBFrontend*) &(*frontend); + tunernum = fe->getID(); + } + } + break; + } ++it; } + if ( tunernum == -1 ) + { + eFatal("couldn't find the correct tuner num in enableTS"); + return -1; + } } - - return slot->enableTS(enable); + return slot->enableTS(enable, tunernum); } int eDVBCIInterfaces::initialize(int slotid) @@ -110,13 +130,38 @@ int eDVBCIInterfaces::initialize(int slotid) while (it != m_pmt_handlers.end()) { if ( it->cislot == slot ) + { slot->sendCAPMT(it->pmthandler); // send capmt + break; + } ++it; } return slot->initialize(); } +int eDVBCIInterfaces::sendCAPMT(int slotid) +{ + eDVBCISlot *slot; + + if( (slot = getSlot(slotid)) == 0 ) + return -1; + + slot->resetPrevSentCAPMTVersion(); + PMTHandlerList::iterator it = m_pmt_handlers.begin(); + while (it != m_pmt_handlers.end()) + { + if ( it->cislot == slot ) + { + slot->sendCAPMT(it->pmthandler); // send capmt + return 0; + } + ++it; + } + + return -1; +} + int eDVBCIInterfaces::startMMI(int slotid) { eDVBCISlot *slot; @@ -213,7 +258,7 @@ void eDVBCIInterfaces::removePMTHandler(eDVBServicePMTHandler *pmthandler) if (it != m_pmt_handlers.end()) { eDVBCISlot *slot = it->cislot; - eDVBServicePMTHandler *pmthandler = it->pmthandler; +// eDVBServicePMTHandler *pmthandler = it->pmthandler; m_pmt_handlers.erase(it); if (slot && !--slot->use_count) { @@ -286,6 +331,7 @@ void eDVBCISlot::data(int what) state = stateRemoved; enableTS(0); printf("ci removed\n"); + eDVBCISession::deleteSessions(this); notifier->setRequested(eSocketNotifier::Read); //HACK eDVBCI_UI::getInstance()->setState(0,0); @@ -362,6 +408,21 @@ eDVBCISlot::~eDVBCISlot() enableTS(0); } +void eDVBCISlot::setAppManager( eDVBCIApplicationManagerSession *session ) +{ + application_manager=session; +} + +void eDVBCISlot::setMMIManager( eDVBCIMMISession *session ) +{ + mmi_session = session; +} + +void eDVBCISlot::setCAManager( eDVBCICAManagerSession *session ) +{ + ca_manager = session; +} + int eDVBCISlot::getSlotID() { return slotid; @@ -445,7 +506,7 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector &caids = ids.empty() && ca_manager ? ca_manager->getCAIDs() : ids; + const std::vector &caids = ids.empty() ? ca_manager->getCAIDs() : ids; ePtr > ptr; if (pmthandler->getPMT(ptr)) return -1; @@ -503,25 +564,41 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vectorsendCAPMT(slotid); +} eAutoInitP0 init_eDVBCIInterfaces(eAutoInitNumbers::dvb, "CI Slots");