X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/bef9bfb55955648b877b743c793b9d79a5a7bfe5..d8bb70354594dddb6ef28f6d41ce733bd9caf4e6:/lib/dvb/dvb.h diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index 04543ae2..fa1801db 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -10,8 +10,11 @@ #include #include #include +#include #include +#include + class eDVBChannel; /* we do NOT handle resource conflicts here. instead, the allocateChannel @@ -22,7 +25,7 @@ class iDVBAdapter; class eDVBRegisteredFrontend: public iObject, public Object { DECLARE_REF(eDVBRegisteredFrontend); - eTimer *disable; + ePtr disable; void closeFrontend() { if (!m_inuse && m_frontend->closeFrontend()) // frontend busy @@ -31,14 +34,10 @@ class eDVBRegisteredFrontend: public iObject, public Object public: Signal0 stateChanged; eDVBRegisteredFrontend(eDVBFrontend *fe, iDVBAdapter *adap) - :disable(new eTimer(eApp)), m_adapter(adap), m_frontend(fe), m_inuse(0) + :disable(eTimer::create(eApp)), m_adapter(adap), m_frontend(fe), m_inuse(0) { CONNECT(disable->timeout, eDVBRegisteredFrontend::closeFrontend); } - ~eDVBRegisteredFrontend() - { - delete disable; - } void dec_use() { if (!--m_inuse) @@ -107,7 +106,7 @@ public: virtual RESULT getDemux(ePtr &demux, int nr) = 0; virtual int getNumFrontends() = 0; - virtual RESULT getFrontend(ePtr &fe, int nr) = 0; + virtual RESULT getFrontend(ePtr &fe, int nr, bool simulate=false) = 0; }; class eDVBAdapterLinux: public iDVBAdapter @@ -120,12 +119,12 @@ public: RESULT getDemux(ePtr &demux, int nr); int getNumFrontends(); - RESULT getFrontend(ePtr &fe, int nr); + RESULT getFrontend(ePtr &fe, int nr, bool simulate=false); static int exist(int nr); private: int m_nr; - eSmartPtrList m_frontend; + eSmartPtrList m_frontend, m_simulate_frontend; eSmartPtrList m_demux; }; #endif // SWIG @@ -138,7 +137,7 @@ class eDVBResourceManager: public iObject, public Object eSmartPtrList m_adapter; eSmartPtrList m_demux; - eSmartPtrList m_frontend; + eSmartPtrList m_frontend, m_simulate_frontend; void addAdapter(iDVBAdapter *adapter); struct active_channel @@ -150,7 +149,7 @@ class eDVBResourceManager: public iObject, public Object active_channel(const eDVBChannelID &chid, eDVBChannel *ch) : m_channel_id(chid), m_channel(ch) { } }; - std::list m_active_channels; + std::list m_active_channels, m_active_simulate_channels; ePtr m_list; ePtr m_sec; @@ -164,7 +163,7 @@ class eDVBResourceManager: public iObject, public Object eUsePtr m_cached_channel; Connection m_cached_channel_state_changed_conn; - eTimer m_releaseCachedChannelTimer; + ePtr m_releaseCachedChannelTimer; void DVBChannelStateChanged(iDVBChannel*); void feStateChanged(); #ifndef SWIG @@ -188,10 +187,10 @@ public: }; RESULT connectChannelAdded(const Slot1 &channelAdded, ePtr &connection); - int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore); + int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, bool simulate=false); /* allocate channel... */ - RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr &channel); + RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr &channel, bool simulate=false); RESULT allocatePVRChannel(eUsePtr &channel); static RESULT getInstance(ePtr &); @@ -202,7 +201,7 @@ public: there might be a priority given to certain frontend/chid combinations. this will be evaluated here. */ - RESULT allocateFrontend(ePtr &fe, ePtr &feparm); + RESULT allocateFrontend(ePtr &fe, ePtr &feparm, bool simulate=false); RESULT allocateFrontendByIndex(ePtr &fe, int slot_index); /* allocate a demux able to filter on the selected frontend. */ @@ -210,7 +209,7 @@ public: #ifdef SWIG public: #endif - int canAllocateFrontend(ePtr &feparm); + int canAllocateFrontend(ePtr &feparm, bool simulate=false); bool canMeasureFrontendInputPower(); PSignal1 frontendUseMaskChanged; SWIG_VOID(RESULT) allocateRawChannel(eUsePtr &SWIG_OUTPUT, int slot_index); @@ -263,6 +262,8 @@ public: RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode); int getUseCount() { return m_use_count; } + + RESULT requestTsidOnid(ePyObject callback); private: ePtr m_frontend; ePtr m_demux, m_decoder_demux; @@ -303,6 +304,12 @@ private: oRefCount m_use_count; void AddUse(); void ReleaseUse(); + + /* for tsid/onid read */ + ePyObject m_tsid_onid_callback; + ePtr m_tsid_onid_demux; + ePtr > m_SDT; + void SDTready(int err); }; #endif // SWIG