enable TS when appmanager is ready
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 28 Nov 2005 23:12:57 +0000 (23:12 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 28 Nov 2005 23:12:57 +0000 (23:12 +0000)
(tuner-A to input0)

lib/dvb_ci/dvbci.cpp
lib/dvb_ci/dvbci.h
lib/dvb_ci/dvbci_ui.cpp

index 8f1fcac92c6ad7f1aef3cc8179ef36a747deea5c..a4bc4ff3d3f6f8cb26756983cf356e05cc6170f6 100644 (file)
@@ -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<u
        
 }
 
+int eDVBCISlot::enableTS(int enable)
+{
+       printf("eDVBCISlot::enableTS(%d)\n", enable);
+
+       FILE *f;
+       if((f = fopen("/proc/stb/tsmux/input0", "wb")) == NULL) {
+               printf("cannot open /proc/stb/audio/j1_mute\n");
+               return;
+       }
+
+       fprintf(f, "%s", enable?"CI":"A");
+
+       fclose(f);
+
+       return 0;
+}
+
+
 eAutoInitP0<eDVBCIInterfaces> init_eDVBCIInterfaces(eAutoInitNumbers::dvb, "CI Slots");
index 0c1051ba66829c3c52a3fa91df0cecfb8183c92e..1576b4fd63421893895d1b23ca20f3f4fdbbb39b 100644 (file)
@@ -48,6 +48,9 @@ public:
        int sendCAPMT(eDVBServicePMTHandler *ptr, const std::vector<uint16_t> &caids=std::vector<uint16_t>());
        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
index 2bfabf133583e809751ad89e7f039d7e9e96c1bd..191d6ca400727c147b6ec6528cb667116b5bd80b 100644 (file)
@@ -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)