From cb0260fc843d3d7386dd79ae977081d0ad082e04 Mon Sep 17 00:00:00 2001 From: Ronny Strutz Date: Mon, 28 Nov 2005 23:12:57 +0000 Subject: [PATCH] enable TS when appmanager is ready (tuner-A to input0) --- lib/dvb_ci/dvbci.cpp | 32 ++++++++++++++++++++++++++++++++ lib/dvb_ci/dvbci.h | 4 ++++ lib/dvb_ci/dvbci_ui.cpp | 3 +++ 3 files changed, 39 insertions(+) diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 8f1fcac9..a4bc4ff3 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -76,6 +76,16 @@ int eDVBCIInterfaces::reset(int slotid) return slot->reset(); } +int eDVBCIInterfaces::enableTS(int slotid, int enable) +{ + eDVBCISlot *slot; + + if( (slot = getSlot(slotid)) == 0 ) + return -1; + + return slot->enableTS(enable); +} + int eDVBCIInterfaces::initialize(int slotid) { eDVBCISlot *slot; @@ -253,6 +263,7 @@ void eDVBCISlot::data(int what) if(what == eSocketNotifier::Priority) { if(state != stateRemoved) { state = stateRemoved; + enableTS(0); printf("ci removed\n"); notifier->setRequested(eSocketNotifier::Read); //HACK @@ -327,6 +338,7 @@ eDVBCISlot::eDVBCISlot(eMainloop *context, int nr) eDVBCISlot::~eDVBCISlot() { + enableTS(0); } int eDVBCISlot::getSlotID() @@ -338,6 +350,8 @@ int eDVBCISlot::reset() { printf("edvbcislot: reset requested\n"); + enableTS(0); + ioctl(fd, 0); return 0; @@ -472,4 +486,22 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector init_eDVBCIInterfaces(eAutoInitNumbers::dvb, "CI Slots"); diff --git a/lib/dvb_ci/dvbci.h b/lib/dvb_ci/dvbci.h index 0c1051ba..1576b4fd 100644 --- a/lib/dvb_ci/dvbci.h +++ b/lib/dvb_ci/dvbci.h @@ -48,6 +48,9 @@ public: int sendCAPMT(eDVBServicePMTHandler *ptr, const std::vector &caids=std::vector()); uint8_t getPrevSentCAPMTVersion() const { return prev_sent_capmt_version; } void resetPrevSentCAPMTVersion() { prev_sent_capmt_version = 0xFF; } + + enableTS(int enable); + }; struct CIPmtHandler @@ -95,6 +98,7 @@ public: int answerEnq(int slot, char *value); int cancelEnq(int slot); int getMMIState(int slot); + int enableTS(int slot, int enable); }; #endif diff --git a/lib/dvb_ci/dvbci_ui.cpp b/lib/dvb_ci/dvbci_ui.cpp index 2bfabf13..191d6ca4 100644 --- a/lib/dvb_ci/dvbci_ui.cpp +++ b/lib/dvb_ci/dvbci_ui.cpp @@ -43,6 +43,9 @@ int eDVBCI_UI::getState(int slot) void eDVBCI_UI::setState(int slot, int newState) { state[slot] = newState; + + if(newState == 2) //enable TS + eDVBCIInterfaces::getInstance()->enableTS(slot, 1); } std::string eDVBCI_UI::getAppName(int slot) -- 2.30.2