sec.cpp \
subtitle.cpp \
teletext.cpp \
+ ecm.cpp \
tstools.cpp \
volume.cpp \
fbc.cpp \
specs.h \
subtitle.h \
teletext.h \
+ ecm.h \
tstools.h \
volume.h \
fbc.h \
--- /dev/null
+#include <lib/base/eerror.h>
+#include <lib/dvb/ecm.h>
+#include <lib/dvb/idemux.h>
+#include <lib/gdi/gpixmap.h>
+
+
+
+DEFINE_REF(eDVBECMParser);
+
+
+
+eDVBECMParser::eDVBECMParser(iDVBDemux *demux)
+{
+
+ if (demux->createPESReader(eApp, m_pes_reader))
+ eDebug("failed to create ECM PES reader!");
+ else
+ m_pes_reader->connectRead(slot(*this, &eDVBECMParser::processData), m_read_connection);
+}
+
+eDVBECMParser::~eDVBECMParser()
+{
+}
+
+
+
+int eDVBECMParser::start(int pid)
+{
+
+
+ if (m_pes_reader)
+ {
+ m_pid = pid;
+ return m_pes_reader->start(pid);
+ }
+ else
+ return -1;
+}
+
+int eDVBECMParser::stop()
+{
+ if (m_pes_reader)
+ {
+ eDebug("stop ecm");
+ return m_pes_reader->stop();
+ }
+ return -1;
+}
+
+void eDVBECMParser::processData(const __u8 *p, int len)
+{
+}
+
+void eDVBECMParser::processPESPacket(__u8 *pkt, int len)
+{
+}
+
+
--- /dev/null
+#ifndef __lib_dvb_ecm_h
+#define __lib_dvb_ecm_h
+
+#include <lib/base/object.h>
+#include <lib/dvb/idvb.h>
+#include <lib/dvb/pesparse.h>
+#include <lib/dvb/pmt.h>
+#include <lib/gdi/gpixmap.h>
+#include <map>
+
+
+class eDVBECMParser: public iObject, public ePESParser, public Object
+{
+ DECLARE_REF(eDVBECMParser);
+public:
+ eDVBECMParser(iDVBDemux *demux);
+ virtual ~eDVBECMParser();
+ int start(int pid);
+ int stop();
+ void processData(const __u8 *p, int len);
+private:
+ void processPESPacket(__u8 *pkt, int len);
+ int m_pid;
+
+ ePtr<iDVBPESReader> m_pes_reader;
+ ePtr<eConnection> m_read_connection;
+
+};
+
+#endif
if (slot->linked_next)
slot->linked_next->setSource(slot->current_source);
else // last CI in chain
+ {
setInputSource(slot->current_tuner, slot->current_source);
+ slot->removeVtunerPid();
+ }
slot->linked_next = 0;
slot->use_count=0;
slot->plugged=true;
eDebug("The CI in Slot %d has said it can handle caid %04x... so use it", ci_it->getSlotID(), *z);
useThis = true;
user_mapped = false;
+ ci_it->addVtunerPid(pmthandler);
break;
}
}
data_source tuner_source = TUNER_A;
switch (tunernum)
{
- case 0 ... 18:
+ case 0 ... 22:
tuner_source = (data_source)tunernum;
break;
default:
if (slot->linked_next)
slot->linked_next->setSource(slot->current_source);
else
+ {
setInputSource(slot->current_tuner, slot->current_source);
+ slot->removeVtunerPid();
+ }
if (base_slot != slot)
{
return slot->getMMIState();
}
-static const char *tuner_source[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "CI0", "CI1", "CI2", "CI3"};
+static const char *tuner_source[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "CI0", "CI1", "CI2", "CI3"};
int eDVBCIInterfaces::setInputSource(int tuner_no, data_source source)
{
{
perror(filename);
}
+
+ for(int i = 0; i < NUM_OF_ECM ; i++)
+ {
+ m_ecm[i] = 0;
+ }
+ ecm_num = 0;
+
}
eDVBCISlot::~eDVBCISlot()
return -1;
}
+void eDVBCISlot::addVtunerPid(eDVBServicePMTHandler *pmthandler)
+{
+ ePtr<iDVBDemux> demux;
+ eDVBServicePMTHandler::program p;
+
+ if (!pmthandler->getDataDemux(demux) && !ecm_num)
+ {
+
+ if (!pmthandler->getProgramInfo(p))
+ {
+ for (std::list<eDVBServicePMTHandler::program::capid_pair>::const_iterator i(p.caids.begin());
+ i != p.caids.end(); ++i)
+ {
+ if (i->capid >= 0)
+ {
+ eDebug("PES Start ECM PID = %d Caid = %d ecm_num=%d", i->capid, i->caid, ecm_num);
+ m_ecm[ecm_num] = new eDVBECMParser(demux);
+ m_ecm[ecm_num++]->start(i->capid);
+ }
+ }
+ }
+ }
+
+}
+
+void eDVBCISlot::removeVtunerPid(void)
+{
+ for(int i = 0; i < ecm_num ; i++)
+ {
+ if(m_ecm[i])
+ {
+ m_ecm[i]->stop();
+ m_ecm[i] = 0;
+ }
+ }
+ ecm_num = 0;
+}
+
eAutoInitP0<eDVBCIInterfaces> init_eDVBCIInterfaces(eAutoInitNumbers::dvb, "CI Slots");
#ifndef SWIG
#include <lib/base/ebase.h>
+#include <lib/dvb/ecm.h>
#include <lib/service/iservice.h>
#include <lib/python/python.h>
#include <set>
enum data_source
{
- TUNER_A=0, TUNER_B, TUNER_C, TUNER_D, TUNER_E, TUNER_F, TUNER_G, TUNER_H, TUNER_I, TUNER_J, TUNER_K, TUNER_L, TUNER_M, TUNER_N, TUNER_O, TUNER_P, TUNER_Q, TUNER_R, CI_A, CI_B, CI_C, CI_D
+ TUNER_A=0, TUNER_B, TUNER_C, TUNER_D, TUNER_E, TUNER_F, TUNER_G, TUNER_H, TUNER_I, TUNER_J, TUNER_K, TUNER_L, TUNER_M, TUNER_N, TUNER_O, TUNER_P, TUNER_Q, TUNER_R, TUNER_S, TUNER_T, TUNER_U, TUNER_V, CI_A, CI_B, CI_C, CI_D
};
typedef std::pair<std::string, uint32_t> providerPair;
bool user_mapped;
void data(int);
bool plugged;
+
+#define NUM_OF_ECM 32
+ ePtr<eDVBECMParser> m_ecm[NUM_OF_ECM];
+ int ecm_num;
public:
enum {stateRemoved, stateInserted, stateInvalid, stateResetted};
eDVBCISlot(eMainloop *context, int nr);
int getNumOfServices() { return running_services.size(); }
int setSource(data_source source);
int setClockRate(int);
+ void addVtunerPid(eDVBServicePMTHandler *pmthandler);
+ void removeVtunerPid(void);
};
struct CIPmtHandler