add teletext parser to servicedvb
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 12 May 2006 17:32:36 +0000 (17:32 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 12 May 2006 17:32:36 +0000 (17:32 +0000)
lib/service/servicedvb.cpp
lib/service/servicedvb.h

index d1b9906..192d3a6 100644 (file)
@@ -242,7 +242,6 @@ RESULT eDVBPVRServiceOfflineOperations::deleteFromDisk(int simulate)
                if (!eraser)
                        eDebug("FATAL !! can't get background file eraser");
                
                if (!eraser)
                        eDebug("FATAL !! can't get background file eraser");
                
-                               /* TODO: deferred removing.. */
                for (std::list<std::string>::iterator i(res.begin()); i != res.end(); ++i)
                {
                        eDebug("Removing %s...", i->c_str());
                for (std::list<std::string>::iterator i(res.begin()); i != res.end(); ++i)
                {
                        eDebug("Removing %s...", i->c_str());
@@ -1526,6 +1525,8 @@ void eDVBServicePlay::switchToLive()
        m_cue = 0;
        m_decoder = 0;
        m_decode_demux = 0;
        m_cue = 0;
        m_decoder = 0;
        m_decode_demux = 0;
+       m_teletext_parser = 0;
+       
                /* free the timeshift service handler, we need the resources */
        m_service_handler_timeshift.free();
        m_timeshift_active = 0;
                /* free the timeshift service handler, we need the resources */
        m_service_handler_timeshift.free();
        m_timeshift_active = 0;
@@ -1542,6 +1543,7 @@ void eDVBServicePlay::switchToTimeshift()
        
        m_decode_demux = 0;
        m_decoder = 0;
        
        m_decode_demux = 0;
        m_decoder = 0;
+       m_teletext_parser = 0;
        
        m_timeshift_active = 1;
 
        
        m_timeshift_active = 1;
 
@@ -1622,6 +1624,9 @@ void eDVBServicePlay::updateDecoder()
                        m_decode_demux->getMPEGDecoder(m_decoder, m_is_primary);
                if (m_cue)
                        m_cue->setDecodingDemux(m_decode_demux, m_decoder);
                        m_decode_demux->getMPEGDecoder(m_decoder, m_is_primary);
                if (m_cue)
                        m_cue->setDecodingDemux(m_decode_demux, m_decoder);
+#ifdef INTERNAL_TELETEXT
+               m_teletext_parser = new eDVBTeletextParser(m_decode_demux);
+#endif
        }
 
        if (m_decoder)
        }
 
        if (m_decoder)
@@ -1633,7 +1638,13 @@ void eDVBServicePlay::updateDecoder()
                        m_decoder->setSyncPCR(pcrpid);
                else
                        m_decoder->setSyncPCR(-1);
                        m_decoder->setSyncPCR(pcrpid);
                else
                        m_decoder->setSyncPCR(-1);
+#ifndef INTERNAL_TELETEXT
                m_decoder->setTextPID(tpid);
                m_decoder->setTextPID(tpid);
+#else
+               if (m_teletext_parser)
+                       m_teletext_parser->start(tpid);
+#endif
+
                if (!m_is_primary)
                        m_decoder->setTrickmode(1);
                m_decoder->start();
                if (!m_is_primary)
                        m_decoder->setTrickmode(1);
                m_decoder->start();
index 81a6b74..01eb049 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <lib/dvb/pmt.h>
 #include <lib/dvb/eit.h>
 
 #include <lib/dvb/pmt.h>
 #include <lib/dvb/eit.h>
+#include <lib/dvb/teletext.h>
 #include <lib/base/filepush.h>
 
 class eServiceFactoryDVB: public iServiceHandler
 #include <lib/base/filepush.h>
 
 class eServiceFactoryDVB: public iServiceHandler
@@ -140,12 +141,14 @@ private:
        
        eDVBServicePlay(const eServiceReference &ref, eDVBService *service);
        
        
        eDVBServicePlay(const eServiceReference &ref, eDVBService *service);
        
+               /* events */
        void gotNewEvent();
        
        void serviceEvent(int event);
        void serviceEventTimeshift(int event);
        Signal2<void,iPlayableService*,int> m_event;
        
        void gotNewEvent();
        
        void serviceEvent(int event);
        void serviceEventTimeshift(int event);
        Signal2<void,iPlayableService*,int> m_event;
        
+               /* pvr */
        int m_is_pvr, m_is_paused, m_timeshift_enabled, m_timeshift_active;
        int m_first_program_info;
        
        int m_is_pvr, m_is_paused, m_timeshift_enabled, m_timeshift_active;
        int m_first_program_info;
        
@@ -157,6 +160,7 @@ private:
        int m_current_audio_stream;
        int selectAudioStream(int n);
        
        int m_current_audio_stream;
        int selectAudioStream(int n);
        
+               /* timeshift */
        ePtr<iDVBTSRecorder> m_record;
        std::set<int> m_pids_active;
 
        ePtr<iDVBTSRecorder> m_record;
        std::set<int> m_pids_active;
 
@@ -168,6 +172,8 @@ private:
        
        int m_skipmode;
        
        
        int m_skipmode;
        
+               /* cuesheet */
+       
        ePtr<eCueSheet> m_cue;
        
        struct cueEntry
        ePtr<eCueSheet> m_cue;
        
        struct cueEntry
@@ -192,6 +198,9 @@ private:
        void saveCuesheet();
        
        void cutlistToCuesheet();
        void saveCuesheet();
        
        void cutlistToCuesheet();
+       
+               /* teletext subtitles */
+       ePtr<eDVBTeletextParser> m_teletext_parser;
 };
 
 #endif
 };
 
 #endif