fix bug described here -> http://www.dream-multimedia-tv.de/board/thread.php?threadid...
[enigma2.git] / lib / dvb / pmt.h
index 701930dc4fedfee6f6af6b69158570ef6f61581c..d1e28703ef26654b85f87a3065efa792c093509e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __lib_dvb_dvbmid_h
 #define __lib_dvb_dvbmid_h
 
+#ifndef SWIG
 #include <map>
 #include <lib/dvb/idvb.h>
 #include <lib/dvb/dvb.h>
@@ -44,8 +45,11 @@ public:
        void buildCAPMT(eTable<ProgramMapSection> *ptr);
 };
 
+#endif
+
 class eDVBServicePMTHandler: public Object
 {
+#ifndef SWIG
        friend class eDVBCAService;
        eServiceReferenceDVB m_reference;
        ePtr<eDVBService> m_service;
@@ -79,7 +83,14 @@ class eDVBServicePMTHandler: public Object
 public:
        eDVBServicePMTHandler();
        ~eDVBServicePMTHandler();
-       
+#endif
+
+#ifdef SWIG
+private:
+       eDVBServicePMTHandler();
+public:
+#endif
+
        enum
        {
                eventNoResources,  // a requested resource couldn't be allocated
@@ -93,7 +104,7 @@ public:
                eventSOF,          // seek pre start
                eventEOF,          // a file playback did end
        };
-
+#ifndef SWIG
        Signal1<void,int> serviceEvent;
 
        struct videoStream
@@ -117,22 +128,44 @@ public:
        struct subtitleStream
        {
                int pid;
-               int subtitling_type;
-               int composition_page_id;
-               int ancillary_page_id;
+               int subtitling_type;    /*  see ETSI EN 300 468 table 26 component_type
+                                                                       when stream_content is 0x03
+                                                                       0x10..0x13, 0x20..0x23 is used for dvb subtitles
+                                                                       0x01 is used for teletext subtitles */
+               union
+               {
+                       int composition_page_id;  // used for dvb subtitles
+                       int teletext_page_number;  // used for teletext subtitles
+               };
+               union
+               {
+                       int ancillary_page_id;  // used for dvb subtitles
+                       int teletext_magazine_number;  // used for teletext subtitles
+               };
                std::string language_code;
+               bool operator<(const subtitleStream &s) const
+               {
+                       if (pid != s.pid)
+                               return pid < s.pid;
+                       if (teletext_page_number != s.teletext_page_number)
+                               return teletext_page_number < s.teletext_page_number;
+                       return teletext_magazine_number < s.teletext_magazine_number;
+               }
        };
 
        struct program
        {
                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);
@@ -145,12 +178,14 @@ public:
        int getService(ePtr<eDVBService> &service) { service = m_service; return 0; }
        int getPMT(ePtr<eTable<ProgramMapSection> > &ptr) { return m_PMT.getCurrent(ptr); }
        int getChannel(eUsePtr<iDVBChannel> &channel);
+       void resetCachedProgram() { m_have_cached_program = false; }
 
        int tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *sg=0);
        void free();
 private:
        bool m_have_cached_program;
        program m_cached_program;
+#endif
 };
 
 #endif