X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb%2Fpmt.h;h=483c06b15ae3007c06514ca7760d30fdf7a05300;hp=95d3cc43522c36fa506ce1cf8de2ff218f27d099;hb=4d7f4836f07bb037bc1c840983e5ef1c99606005;hpb=80132b0b269cb147e42c61824a73ad70f707acf5 diff --git a/lib/dvb/pmt.h b/lib/dvb/pmt.h index 95d3cc4..483c06b 100644 --- a/lib/dvb/pmt.h +++ b/lib/dvb/pmt.h @@ -1,7 +1,9 @@ #ifndef __lib_dvb_dvbmid_h #define __lib_dvb_dvbmid_h +#ifndef SWIG #include +#include #include #include #include @@ -19,10 +21,23 @@ class eDVBCAService; class eDVBScan; +struct channel_data: public Object +{ + ePtr m_channel; + ePtr m_stateChangedConn; + int m_prevChannelState; + int m_dataDemux; +}; + +// TODO .. put all static stuff into a 'eDVBCAServiceHandler class' + typedef std::map CAServiceMap; +typedef std::map ChannelMap; class eDVBCAService: public Object { + eIOBuffer m_buffer; + ePtr m_sn; eServiceReferenceDVB m_service; uint8_t m_used_demux[32]; unsigned int m_prev_build_hash; @@ -31,28 +46,39 @@ class eDVBCAService: public Object struct sockaddr_un m_servaddr; unsigned int m_sendstate; unsigned char m_capmt[2048]; - eTimer m_retryTimer; + ePtr m_retryTimer; void sendCAPMT(); void Connect(); + void socketCB(int what); + static void DVBChannelAdded(eDVBChannel*); + static void DVBChannelStateChanged(iDVBChannel*); static CAServiceMap exist; + static ChannelMap exist_channels; + static ePtr m_chanAddedConn; + static channel_data *getChannelData(eDVBChannelID &chid); + eDVBCAService(); ~eDVBCAService(); public: + static void registerChannelCallback(eDVBResourceManager *res_mgr); 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); }; +#endif + class eDVBServicePMTHandler: public Object { +#ifndef SWIG friend class eDVBCAService; eServiceReferenceDVB m_reference; ePtr m_service; int m_last_channel_state; eDVBCAService *m_ca_servicePtr; - eDVBScan *m_dvb_scan; // for sdt scan + ePtr m_dvb_scan; // for sdt scan eAUTable > m_PMT; eAUTable > m_PAT; @@ -79,7 +105,14 @@ class eDVBServicePMTHandler: public Object public: eDVBServicePMTHandler(); ~eDVBServicePMTHandler(); - +#endif + +#ifdef SWIG +private: + eDVBServicePMTHandler(); +public: +#endif + enum { eventNoResources, // a requested resource couldn't be allocated @@ -90,24 +123,28 @@ public: eventNewProgramInfo, // we just received a PMT eventTuned, // a channel was sucessfully (re-)tuned in, you may start additional filters now + eventPreStart, // before start filepush thread eventSOF, // seek pre start eventEOF, // a file playback did end + + eventMisconfiguration, // a channel was not found in any list, or no frontend was found which could provide this channel }; - +#ifndef SWIG Signal1 serviceEvent; struct videoStream { int pid; int component_tag; - enum { vtMPEG2, vtMPEG4_H264 }; + enum { vtMPEG2, vtMPEG4_H264, vtMPEG1, vtMPEG4_Part2, vtVC1, vtVC1_SM }; int type; }; struct audioStream { - int pid; - enum { atMPEG, atAC3, atDTS, atAAC }; + int pid, + rdsPid; // hack for some radio services which transmit radiotext on different pid (i.e. harmony fm, HIT RADIO FFH, ...) + enum { atMPEG, atAC3, atDTS, atAAC, atAACHE, atLPCM }; int type; // mpeg2, ac3, dts, ... int component_tag; @@ -146,12 +183,14 @@ public: { std::vector videoStreams; std::vector audioStreams; + int defaultAudioStream; std::vector subtitleStreams; std::set caids; int pcrPid; int pmtPid; int textPid; bool isCrypted() { return !caids.empty(); } + PyObject *createPythonObject(); }; int getProgramInfo(struct program &program); @@ -166,11 +205,12 @@ public: int getChannel(eUsePtr &channel); void resetCachedProgram() { m_have_cached_program = false; } - int tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *sg=0); + int tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *sg=0, bool simulate=false, eDVBService *service = 0); void free(); private: bool m_have_cached_program; program m_cached_program; +#endif }; #endif