[hbbtv] fix zapping delay from ait handling.
authorsmlee <smlee@dev3>
Wed, 8 Jan 2014 07:01:27 +0000 (16:01 +0900)
committersmlee <smlee@dev3>
Wed, 8 Jan 2014 10:37:32 +0000 (19:37 +0900)
lib/dvb/pmt.cpp
lib/python/Plugins/Extensions/HbbTV/aitreader.py
lib/python/Plugins/Extensions/HbbTV/plugin.py

index 5b89e8a..df11079 100644 (file)
@@ -386,8 +386,14 @@ void eDVBServicePMTHandler::AITready(int error)
                {
                        saveData(orgid, m_AITData, sectionLength);//4096);
                        for(HbbTVApplicationInfoListConstIterator infoiter = m_HbbTVApplications.begin() ; infoiter != m_HbbTVApplications.end() ; ++infoiter)
                {
                        saveData(orgid, m_AITData, sectionLength);//4096);
                        for(HbbTVApplicationInfoListConstIterator infoiter = m_HbbTVApplications.begin() ; infoiter != m_HbbTVApplications.end() ; ++infoiter)
+                       {
+                               char fileName[255] = {0};
+                               sprintf(fileName, "/tmp/ait.%d", (*infoiter)->m_OrgId);
+                               if (access(fileName, 0) < 0)
+                                       saveData((*infoiter)->m_OrgId, m_AITData, sectionLength);
                                eDebug("Found : control[%d], name[%s], url[%s]", 
                                        (*infoiter)->m_ControlCode, (*infoiter)->m_ApplicationName.c_str(), (*infoiter)->m_HbbTVUrl.c_str());
                                eDebug("Found : control[%d], name[%s], url[%s]", 
                                        (*infoiter)->m_ControlCode, (*infoiter)->m_ApplicationName.c_str(), (*infoiter)->m_HbbTVUrl.c_str());
+                       }
                        serviceEvent(eventHBBTVInfo);
                }
                else eDebug("No found anything.");
                        serviceEvent(eventHBBTVInfo);
                }
                else eDebug("No found anything.");
index 1d7a713..afbcd9a 100755 (executable)
@@ -1,8 +1,11 @@
 import os, xml.dom.minidom
 import os, xml.dom.minidom
+from enigma import iServiceInformation
 
 DUMPBIN = "/usr/lib/enigma2/python/Plugins/Extensions/HbbTV/dumpait"
 class eAITSectionReader:
        def __init__(self, demux, pmtid, sid):
 
 DUMPBIN = "/usr/lib/enigma2/python/Plugins/Extensions/HbbTV/dumpait"
 class eAITSectionReader:
        def __init__(self, demux, pmtid, sid):
+               self.mVuplusBox = None
+               self.mInfo = None
                self.mAppList  = []
                self.mDocument = None
                self.mCommand  = "%s --demux=%s --pmtid=%x --serviceid=%x"%(DUMPBIN, demux, pmtid, sid)
                self.mAppList  = []
                self.mDocument = None
                self.mCommand  = "%s --demux=%s --pmtid=%x --serviceid=%x"%(DUMPBIN, demux, pmtid, sid)
@@ -21,26 +24,46 @@ class eAITSectionReader:
 
        def __application(self, application):
                item = {}
 
        def __application(self, application):
                item = {}
-               item["name"]    = str(self.__item(application, "name"))
-               item["url"]     = str(self.__item(application, "url"))
-               item["control"] = int(self.__item(application, "control"))
-               item["orgid"]   = int(self.__item(application, "orgid"))
-               item["appid"]   = int(self.__item(application, "appid"))
-               item["profile"] = int(self.__item(application, "profile"))
+
+               if self.mVuplusBox is not None:
+                       item["name"]    = str(application[1])
+                       item["url"]     = str(application[2])
+                       item["control"] = int(application[0])
+                       item["orgid"]   = int(application[3])
+                       item["appid"]   = int(application[4])
+                       item["profile"] = int(application[5])
+               else:
+                       item["name"]    = str(self.__item(application, "name"))
+                       item["url"]     = str(self.__item(application, "url"))
+                       item["control"] = int(self.__item(application, "control"))
+                       item["orgid"]   = int(self.__item(application, "orgid"))
+                       item["appid"]   = int(self.__item(application, "appid"))
+                       item["profile"] = int(self.__item(application, "profile"))
                #print item
                return item
 
        def doParseApplications(self):
                l = []
                #print item
                return item
 
        def doParseApplications(self):
                l = []
-               for application in self.mDocument.getElementsByTagName("application"):
-                       item = self.__application(application)
-                       l.append(item)
+
+               if self.mVuplusBox is not None:
+                       for application in self.mInfo.getInfoObject(iServiceInformation.sHBBTVUrl):
+                               item = self.__application(application)
+                               l.append(item)
+               else:
+                       for application in self.mDocument.getElementsByTagName("application"):
+                               item = self.__application(application)
+                               l.append(item)
                self.mAppList = l
 
        def getApplicationList(self):
                return self.mAppList
 
                self.mAppList = l
 
        def getApplicationList(self):
                return self.mAppList
 
-       def doOpen(self):
+       def doOpen(self, info, is_vuplusbox):
+               if is_vuplusbox is not None:
+                       self.mVuplusBox = is_vuplusbox
+                       self.mInfo = info
+                       return True
+
                document = ""
                try:    document = os.popen(self.mCommand).read()
                except Exception, ErrMsg:
                document = ""
                try:    document = os.popen(self.mCommand).read()
                except Exception, ErrMsg:
index 73e2074..117605d 100644 (file)
@@ -1005,11 +1005,11 @@ class HbbTVHelper(Screen, InfoBarNotifications):
                                name = ""
 
                        pmtid = info.getInfo(iServiceInformation.sPMTPID)
                                name = ""
 
                        pmtid = info.getInfo(iServiceInformation.sPMTPID)
-                       demux = 0#info.getInfoString(iServiceInformation.sLiveStreamDemuxId)
+                       demux = info.getInfoString(iServiceInformation.sLiveStreamDemuxId)
 
                        from aitreader import eAITSectionReader
                        reader = eAITSectionReader(demux, pmtid, sid)
 
                        from aitreader import eAITSectionReader
                        reader = eAITSectionReader(demux, pmtid, sid)
-                       if reader.doOpen():
+                       if reader.doOpen(info, self.mVuplusBox):
                                reader.doParseApplications()
                                reader.doDump()
                        else:   print "no data!!"
                                reader.doParseApplications()
                                reader.doDump()
                        else:   print "no data!!"