X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e39c12fcbf218f0964782a48d6e66145e1ce5039..3931e5f4380d167e1d651f0d056618294cf8234f:/lib/dvb/scan.h diff --git a/lib/dvb/scan.h b/lib/dvb/scan.h index fb6b56f4..9f0dd6ef 100644 --- a/lib/dvb/scan.h +++ b/lib/dvb/scan.h @@ -1,21 +1,34 @@ #ifndef __lib_dvb_scan_h #define __lib_dvb_scan_h -#include -#include -#include +#include +#include +#include +#include +#include + #include #include #include +struct service +{ + service(unsigned short pmtPid) + :pmtPid(pmtPid), serviceType(0xFF), scrambled(false) + { + } + unsigned short pmtPid; + unsigned char serviceType; + bool scrambled; +}; + class eDVBScan: public Object, public iObject { -DECLARE_REF(eDVBScan); -private: + DECLARE_REF(eDVBScan); /* chid helper functions: */ /* heuristically determine if onid/tsid is valid */ - int isValidONIDTSID(eOriginalNetworkID onid, eTransportStreamID tsid); + int isValidONIDTSID(int orbital_position, eOriginalNetworkID onid, eTransportStreamID tsid); /* build dvb namespace */ eDVBNamespace buildNamespace(eOriginalNetworkID onid, eTransportStreamID tsid, unsigned long hash); @@ -31,45 +44,75 @@ private: RESULT nextChannel(); RESULT startFilter(); - enum { readySDT=1, readyNIT=2, readyBAT=4, readyAll=7, - validSDT=8, validNIT=16, validBAT=32}; + enum { readyPAT=1, readySDT=2, readyNIT=4, readyBAT=8, + validPAT=16, validSDT=32, validNIT=64, validBAT=128}; /* scan state variables */ int m_channel_state; - int m_ready; - + int m_ready, m_ready_all; + + std::map m_corrected_frequencys; // yet just used for DVB-T + std::map > m_new_channels; std::map > m_new_services; - + std::map >::iterator m_last_service; + + std::map m_pmts_to_read; + std::map::iterator m_pmt_in_progress; + bool m_pmt_running; + bool m_abort_current_pmt; + std::list > m_ch_toScan, m_ch_scanned, m_ch_unavailable; ePtr m_ch_current; - - ePtr > m_SDT; - ePtr > m_NIT; - ePtr > m_BAT; - + eDVBChannelID m_chid_current; + eTransportStreamID m_pat_tsid; + + ePtr > m_SDT; + ePtr > m_NIT; + ePtr > m_BAT; + ePtr > m_PAT; + ePtr > m_PMT; + void SDTready(int err); void NITready(int err); void BATready(int err); - - void addChannel(const eDVBChannelID &chid, iDVBFrontendParameters *feparm); - int sameChannel(iDVBFrontendParameters *ch1, iDVBFrontendParameters *ch2) const; - + void PATready(int err); + void PMTready(int err); + + void addKnownGoodChannel(const eDVBChannelID &chid, iDVBFrontendParameters *feparm); + void addChannelToScan(const eDVBChannelID &chid, iDVBFrontendParameters *feparm); + + int sameChannel(iDVBFrontendParameters *ch1, iDVBFrontendParameters *ch2, bool exact=false) const; + void channelDone(); Signal1 m_event; - RESULT processSDT(eDVBNamespace dvbnamespace, const ServiceDescriptionTable &sdt); + RESULT processSDT(eDVBNamespace dvbnamespace, const ServiceDescriptionSection &sdt); + + int m_flags; + bool m_usePAT; + bool m_scan_debug; public: - eDVBScan(iDVBChannel *channel); + eDVBScan(iDVBChannel *channel, bool usePAT=true, bool debug=true ); ~eDVBScan(); - - void start(const std::list > &known_transponders); - enum { evtUpdate, evtFinish, evtFail }; - RESULT connectEvent(const Slot1 &event, ePtr &connection); - void insertInto(iDVBChannelList *db); + enum { + scanNetworkSearch = 1, scanSearchBAT = 2, + scanRemoveServices = 4, scanDontRemoveFeeds = 8, + scanDontRemoveUnscanned = 16, + clearToScanOnFirstNIT = 32, scanOnlyFree = 64 }; + + void start(const eSmartPtrList &known_transponders, int flags); + + enum { evtUpdate, evtNewService, evtFinish, evtFail }; + RESULT connectEvent(const Slot1 &event, ePtr &connection); + void insertInto(iDVBChannelList *db, bool dontRemoveNewFlags=false); void getStats(int &transponders_done, int &transponders_total, int &services); + void getLastServiceName(std::string &name); + RESULT getFrontend(ePtr &); + RESULT getCurrentTransponder(ePtr &); + eDVBChannelID getCurrentChannelID() { return m_chid_current; } }; #endif