pass more information about why a channel alloc fails, and display proper error messa...
[enigma2.git] / lib / dvb / pmt.h
index 086619d370eade0819ec8d77a0836173b2714b37..f34d761aee58ed330bbb5c39879e685ead95c5e5 100644 (file)
 class eDVBCAService;
 class eDVBScan;
 
+struct channel_data: public Object
+{
+       ePtr<eDVBChannel> m_channel;
+       ePtr<eConnection> m_stateChangedConn;
+       int m_prevChannelState;
+       int m_dataDemux;
+};
+
+// TODO .. put all static stuff into a 'eDVBCAServiceHandler class'
+
 typedef std::map<eServiceReferenceDVB, eDVBCAService*> CAServiceMap;
+typedef std::map<iDVBChannel*, channel_data*> ChannelMap;
 
 class eDVBCAService: public Object
 {
+       eSocketNotifier *m_sn;
        eServiceReferenceDVB m_service;
        uint8_t m_used_demux[32];
        unsigned int m_prev_build_hash;
@@ -35,11 +47,19 @@ class eDVBCAService: public Object
        eTimer 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<eConnection> 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<ProgramMapSection> *ptr );
        void buildCAPMT(eTable<ProgramMapSection> *ptr);
@@ -103,6 +123,8 @@ public:
                
                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<void,int> serviceEvent;
@@ -157,12 +179,15 @@ public:
        {
                std::vector<videoStream> videoStreams;
                std::vector<audioStream> audioStreams;
+               int defaultAudioStream;
                std::vector<subtitleStream> subtitleStreams;
                std::set<uint16_t> caids;
                int pcrPid;
                int pmtPid;
                int textPid;
                bool isCrypted() { return !caids.empty(); }
+               
+               PyObject *createPythonObject();
        };
 
        int getProgramInfo(struct program &program);