X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e39c12fcbf218f0964782a48d6e66145e1ce5039..9bdb2bf12943594e9bcd309ed9c60e44af23dbf0:/lib/dvb/pmt.h?ds=sidebyside diff --git a/lib/dvb/pmt.h b/lib/dvb/pmt.h index d86d1ac9..5149167c 100644 --- a/lib/dvb/pmt.h +++ b/lib/dvb/pmt.h @@ -1,50 +1,100 @@ #ifndef __lib_dvb_dvbmid_h #define __lib_dvb_dvbmid_h +#include #include #include #include #include -#include -#include +#include +#include +#include + +#include +#include +#include +#include +#include + +class eDVBCAService; + +typedef std::map CAServiceMap; + +class eDVBCAService: public Object +{ + eServiceReferenceDVB m_service; + uint8_t m_used_demux[32]; + unsigned int m_prev_build_hash; + + int m_sock, m_clilen; + struct sockaddr_un m_servaddr; + unsigned int m_sendstate; + unsigned char m_capmt[2048]; + eTimer m_retryTimer; + void sendCAPMT(); + void Connect(); + + static CAServiceMap exist; + eDVBCAService(); + ~eDVBCAService(); +public: + static RESULT register_service( const eServiceReferenceDVB &ref, int demux_nums[2], eDVBCAService *&caservice ); + static RESULT unregister_service( const eServiceReferenceDVB &ref, int demux_nums[2], eTable *ptr ); + void buildCAPMT(eTable *ptr); +}; class eDVBServicePMTHandler: public Object { + friend class eDVBCAService; eServiceReferenceDVB m_reference; -// ePtr m_service; + ePtr m_service; int m_last_channel_state; - - eAUTable > m_PMT; - eAUTable > m_PAT; + eDVBCAService *m_ca_servicePtr; + + eAUTable > m_PMT; + eAUTable > m_PAT; eUsePtr m_channel; + eUsePtr m_pvr_channel; ePtr m_resourceManager; ePtr m_demux; void channelStateChanged(iDVBChannel *); ePtr m_channelStateChanged_connection; + void channelEvent(iDVBChannel *, int event); + ePtr m_channelEvent_connection; void PMTready(int error); void PATready(int error); + + int m_use_decode_demux; + uint8_t m_decode_demux_num; + public: eDVBServicePMTHandler(); + ~eDVBServicePMTHandler(); enum { eventNoResources, // a requested resource couldn't be allocated + eventTuneFailed, // tune failed eventNoPAT, // no pat could be received (timeout) eventNoPATEntry, // no pat entry for the corresponding SID could be found eventNoPMT, // no pmt could be received (timeout) eventNewProgramInfo, // we just received a PMT - eventTuned // a channel was sucessfully (re-)tuned in, you may start additional filters now + eventTuned, // a channel was sucessfully (re-)tuned in, you may start additional filters now + + eventSOF, // seek pre start + eventEOF, // a file playback did end }; Signal1 serviceEvent; - + struct videoStream { int pid; + int component_tag; }; struct audioStream @@ -52,7 +102,9 @@ public: int pid; enum { atMPEG, atAC3, atDTS }; int type; // mpeg2, ac3, dts, ... - // language code, ... + + int component_tag; + std::string language_code; /* iso-639, if available. */ }; struct program @@ -61,12 +113,25 @@ public: std::vector audioStreams; // ca info int pcrPid; + int pmtPid; + int textPid; + bool isCrypted; }; int getProgramInfo(struct program &program); - int getDemux(ePtr &demux); + int getDataDemux(ePtr &demux); + int getDecodeDemux(ePtr &demux); + PyObject *getCaIds(); + + int getPVRChannel(ePtr &pvr_channel); + int getService(eServiceReferenceDVB &service) { service = m_reference; return 0; } + int getPMT(ePtr > &ptr) { return m_PMT.getCurrent(ptr); } + int getChannel(eUsePtr &channel); + + int tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *sg=0); + void free(); - int tune(eServiceReferenceDVB &ref); + int m_pmt_pid; }; #endif