diff options
Diffstat (limited to 'lib/dvb')
| -rw-r--r-- | lib/dvb/db.cpp | 18 | ||||
| -rw-r--r-- | lib/dvb/db.h | 2 | ||||
| -rw-r--r-- | lib/dvb/demux.cpp | 2 | ||||
| -rw-r--r-- | lib/dvb/esection.cpp | 3 | ||||
| -rw-r--r-- | lib/dvb/esection.h | 6 | ||||
| -rw-r--r-- | lib/dvb/isection.h | 1 | ||||
| -rw-r--r-- | lib/dvb/scan.cpp | 39 | ||||
| -rw-r--r-- | lib/dvb/scan.h | 2 |
8 files changed, 49 insertions, 24 deletions
diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp index 1a2cd7df..810aba04 100644 --- a/lib/dvb/db.cpp +++ b/lib/dvb/db.cpp @@ -17,6 +17,16 @@ eDVBService::~eDVBService() { } +eDVBService &eDVBService::operator=(const eDVBService &s) +{ + m_service_name = s.m_service_name; + m_provider_name = s.m_provider_name; + m_flags = s.m_flags; + m_ca = s.m_ca; + m_cache = s.m_cache; + return *this; +} + DEFINE_REF(eDVBDB); eDVBDB::eDVBDB() @@ -67,7 +77,7 @@ eDVBDB::eDVBDB() { eDVBFrontendParametersSatellite sat; int frequency, symbol_rate, polarisation, fec, orbital_position, inversion; - sscanf(line+2, "%d:%d:%d:%d:%d:%d", &frequency, &symbol_rate, &polarisation, &fec, &orbital_position, &inversion); + sscanf(line+2, "%d:%d:%d:%d:%d:%d", &frequency, &symbol_rate, &polarisation, &fec, &inversion, &orbital_position); sat.frequency = frequency; sat.symbol_rate = symbol_rate; sat.polarisation = polarisation; @@ -209,15 +219,15 @@ eDVBDB::~eDVBDB() const eServiceReferenceDVB &s = i->first; fprintf(f, "%04x:%08x:%04x:%04x:%d:%d\n", s.getServiceID().get(), s.getDVBNamespace().get(), - s.getOriginalNetworkID().get(), s.getTransportStreamID().get(), + s.getTransportStreamID().get(),s.getOriginalNetworkID().get(), s.getServiceType(), 0); fprintf(f, "%s\n", i->second->m_service_name.c_str()); - fprintf(f, "p=%s", i->second->m_provider_name.c_str()); + fprintf(f, "p:%s", i->second->m_provider_name.c_str()); for (std::set<int>::const_iterator ca(i->second->m_ca.begin()); ca != i->second->m_ca.end(); ++ca) - fprintf(f, ",C=%04x", *ca); + fprintf(f, ",C:%04x", *ca); fprintf(f, "\n"); services++; } diff --git a/lib/dvb/db.h b/lib/dvb/db.h index 5a67870d..e673b9e6 100644 --- a/lib/dvb/db.h +++ b/lib/dvb/db.h @@ -16,6 +16,8 @@ public: std::set<int> m_ca; std::map<int,int> m_cache; virtual ~eDVBService(); + + eDVBService &operator=(const eDVBService &); }; class ServiceDescriptionTable; diff --git a/lib/dvb/demux.cpp b/lib/dvb/demux.cpp index 286821c3..191d9c38 100644 --- a/lib/dvb/demux.cpp +++ b/lib/dvb/demux.cpp @@ -74,6 +74,8 @@ eDVBSectionReader::eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESUL #endif fd = ::open(filename, O_RDWR); + eDebug("eDVBSectionReader has fd %d", fd); + if (fd >= 0) { notifier=new eSocketNotifier(context, fd, eSocketNotifier::Read); diff --git a/lib/dvb/esection.cpp b/lib/dvb/esection.cpp index 42a056d2..dbb9bf78 100644 --- a/lib/dvb/esection.cpp +++ b/lib/dvb/esection.cpp @@ -22,7 +22,8 @@ void eGTable::sectionRead(const __u8 *d) void eGTable::timeout() { - eDebug("timeout!"); + printf("timeout!\n"); +// eDebug("timeout!"); m_reader->stop(); ready = 1; error = -1; diff --git a/lib/dvb/esection.h b/lib/dvb/esection.h index 78895e76..6b8c8784 100644 --- a/lib/dvb/esection.h +++ b/lib/dvb/esection.h @@ -52,11 +52,13 @@ protected: else printf("-"); - printf(" %d/%d\n", avail.size(), max); + printf(" %d/%d TID %02x\n", avail.size(), max, data[0]); if (avail.size() == max) + { + printf("done!\n"); return 1; - else + } else return 0; } public: diff --git a/lib/dvb/isection.h b/lib/dvb/isection.h index f44c1632..1ed53699 100644 --- a/lib/dvb/isection.h +++ b/lib/dvb/isection.h @@ -48,6 +48,7 @@ public: virtual RESULT start(const eDVBSectionFilterMask &mask)=0; virtual RESULT stop()=0; virtual RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn)=0; + virtual ~iDVBSectionReader() { }; }; #endif diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp index 5571a810..322f35c3 100644 --- a/lib/dvb/scan.cpp +++ b/lib/dvb/scan.cpp @@ -13,10 +13,15 @@ #include <lib/base/eerror.h> #include <errno.h> +#define SCAN_eDebug(x...) +#define SCAN_eDebugNoNewLine(x...) + +DEFINE_REF(eDVBScan); + eDVBScan::eDVBScan(iDVBChannel *channel): m_channel(channel) { if (m_channel->getDemux(m_demux)) - eDebug("scan: failed to allocate demux!"); + SCAN_eDebug("scan: failed to allocate demux!"); m_channel->connectStateChange(slot(*this, &eDVBScan::stateChange), m_stateChanged_connection); } @@ -126,7 +131,7 @@ RESULT eDVBScan::startFilter() void eDVBScan::SDTready(int err) { - eDebug("got sdt"); + SCAN_eDebug("got sdt"); m_ready |= readySDT; if (!err) m_ready |= validSDT; @@ -135,7 +140,7 @@ void eDVBScan::SDTready(int err) void eDVBScan::NITready(int err) { - eDebug("got nit, err %d", err); + SCAN_eDebug("got nit, err %d", err); m_ready |= readyNIT; if (!err) m_ready |= validNIT; @@ -144,7 +149,7 @@ void eDVBScan::NITready(int err) void eDVBScan::BATready(int err) { - eDebug("got bat"); + SCAN_eDebug("got bat"); m_ready |= readyBAT; if (!err) m_ready |= validBAT; @@ -204,7 +209,7 @@ void eDVBScan::channelDone() (**m_SDT->getSections().begin()).getTransportStreamId(), hash); - eDebug("SDT: "); + SCAN_eDebug("SDT: "); ServiceDescriptionTableConstIterator i; for (i = m_SDT->getSections().begin(); i != m_SDT->getSections().end(); ++i) processSDT(dvbnamespace, **i); @@ -213,7 +218,7 @@ void eDVBScan::channelDone() if (m_ready & validNIT) { - eDebug("dumping NIT"); + SCAN_eDebug("dumping NIT"); NetworkInformationTableConstIterator i; for (i = m_NIT->getSections().begin(); i != m_NIT->getSections().end(); ++i) { @@ -222,7 +227,7 @@ void eDVBScan::channelDone() for (TransportStreamInfoConstIterator tsinfo(tsinfovec.begin()); tsinfo != tsinfovec.end(); ++tsinfo) { - eDebug("TSID: %04x ONID: %04x", (*tsinfo)->getTransportStreamId(), + SCAN_eDebug("TSID: %04x ONID: %04x", (*tsinfo)->getTransportStreamId(), (*tsinfo)->getOriginalNetworkId()); eOriginalNetworkID onid = (*tsinfo)->getOriginalNetworkId(); @@ -237,7 +242,7 @@ void eDVBScan::channelDone() case SATELLITE_DELIVERY_SYSTEM_DESCRIPTOR: { SatelliteDeliverySystemDescriptor &d = (SatelliteDeliverySystemDescriptor&)**desc; - eDebug("%d kHz, %d%d%d.%d%c %s MOD:%d %d symb/s, fec %d", + SCAN_eDebug("%d kHz, %d%d%d.%d%c %s MOD:%d %d symb/s, fec %d", d.getFrequency(), (d.getOrbitalPosition()>>12)&0xF, (d.getOrbitalPosition()>>8)&0xF, @@ -265,7 +270,7 @@ void eDVBScan::channelDone() break; } default: - eDebug("descr<%x>", (*desc)->getTag()); + SCAN_eDebug("descr<%x>", (*desc)->getTag()); break; } } @@ -277,7 +282,7 @@ void eDVBScan::channelDone() if ((m_ready & readyAll) != readyAll) return; - eDebug("channel done!"); + SCAN_eDebug("channel done!"); m_ch_scanned.push_back(m_ch_current); nextChannel(); } @@ -312,12 +317,12 @@ void eDVBScan::insertInto(eDVBDB *db) RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescriptionTable &sdt) { const ServiceDescriptionVector &services = *sdt.getDescriptions(); - eDebug("ONID: %04x", sdt.getOriginalNetworkId()); + SCAN_eDebug("ONID: %04x", sdt.getOriginalNetworkId()); eDVBChannelID chid(dvbnamespace, sdt.getTransportStreamId(), sdt.getOriginalNetworkId()); for (ServiceDescriptionConstIterator s(services.begin()); s != services.end(); ++s) { - eDebugNoNewLine("SID %04x: ", (*s)->getServiceId()); + SCAN_eDebugNoNewLine("SID %04x: ", (*s)->getServiceId()); eServiceReferenceDVB ref; ePtr<eDVBService> service = new eDVBService; @@ -338,7 +343,7 @@ RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescription case SERVICE_DESCRIPTOR: { ServiceDescriptor &d = (ServiceDescriptor&)**desc; - eDebug("name '%s', provider_name '%s'", d.getServiceName().c_str(), d.getServiceProviderName().c_str()); + SCAN_eDebug("name '%s', provider_name '%s'", d.getServiceName().c_str(), d.getServiceProviderName().c_str()); service->m_service_name = d.getServiceName(); service->m_provider_name = d.getServiceProviderName(); break; @@ -347,17 +352,17 @@ RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescription { CaIdentifierDescriptor &d = (CaIdentifierDescriptor&)**desc; const CaSystemIdVector &caids = *d.getCaSystemIds(); - eDebugNoNewLine("CA "); + SCAN_eDebugNoNewLine("CA "); for (CaSystemIdVector::const_iterator i(caids.begin()); i != caids.end(); ++i) { - eDebugNoNewLine("%04x ", *i); + SCAN_eDebugNoNewLine("%04x ", *i); service->m_ca.insert(*i); } - eDebug(""); + SCAN_eDebug(""); break; } default: - eDebug("descr<%x>", (*desc)->getTag()); + SCAN_eDebug("descr<%x>", (*desc)->getTag()); break; } } diff --git a/lib/dvb/scan.h b/lib/dvb/scan.h index 61a211ba..f7cb5d26 100644 --- a/lib/dvb/scan.h +++ b/lib/dvb/scan.h @@ -8,6 +8,8 @@ class eDVBScan: public Object, public iObject { +DECLARE_REF; +private: /* chid helper functions: */ /* heuristically determine if onid/tsid is valid */ |
