close(fd);
}
+#include <dvbsi++/application_profile.h>
+#include <dvbsi++/application_descriptor.h>
+#define PACK_VERSION(major,minor,micro) (((major) << 16) + ((minor) << 8) + (micro))
+#define UNPACK_VERSION(version,major,minor,micro) { \
+ major = (version)&0xff; \
+ minor = (version>>8)&0xff; \
+ micro = (version>>16)&0xff; \
+}
void eDVBServicePMTHandler::AITready(int error)
{
eDebug("AITready");
ePtr<eTable<ApplicationInformationSection> > ptr;
if (!m_AIT.getCurrent(ptr))
{
- int orgid = 0, appid = 0;
+ short profilecode = 0;
+ int orgid = 0, appid = 0, profileVersion = 0;
m_ApplicationName = m_HBBTVUrl = "";
eraseHbbTVApplications(&m_HbbTVApplications);
switch ((*desc)->getTag())
{
case APPLICATION_DESCRIPTOR:
+ {
+ ApplicationDescriptor* applicationDescriptor = (ApplicationDescriptor*)(*desc);
+ ApplicationProfileList* applicationProfiles = applicationDescriptor->getApplicationProfiles();
+ ApplicationProfileConstIterator interactionit = applicationProfiles->begin();
+ for(; interactionit != applicationProfiles->end(); ++interactionit)
+ {
+ profilecode = (*interactionit)->getApplicationProfile();
+ profileVersion = PACK_VERSION(
+ (*interactionit)->getVersionMajor(),
+ (*interactionit)->getVersionMinor(),
+ (*interactionit)->getVersionMicro()
+ );
+ }
break;
+ }
case APPLICATION_NAME_DESCRIPTOR:
{
ApplicationNameDescriptor *nameDescriptor = (ApplicationNameDescriptor*)(*desc);
}
}
}
- m_HbbTVApplications.push_back(new HbbTVApplicationInfo(controlCode, orgid, appid, hbbtvUrl, applicaionName));
+ if(!hbbtvUrl.empty())
+ {
+ char* uu = hbbtvUrl.c_str();
+ if(!strncmp(uu, "http://", 7) || !strncmp(uu, "dvb://", 6) || !strncmp(uu, "https://", 8))
+ {
+ switch(profileVersion)
+ {
+ case 65793:
+ case 66049:
+ m_HbbTVApplications.push_back(new HbbTVApplicationInfo(controlCode, orgid, appid, hbbtvUrl, applicaionName, profilecode));
+ break;
+ case 1280:
+ case 65538:
+ default:
+ m_HbbTVApplications.push_back(new HbbTVApplicationInfo((-1)*controlCode, orgid, appid, hbbtvUrl, applicaionName, profilecode));
+ break;
+ }
+ }
+ }
}
}
{
for(HbbTVApplicationInfoListConstIterator infoiter = m_HbbTVApplications.begin() ; infoiter != m_HbbTVApplications.end() ; ++infoiter)
{
- ePyObject tuple = PyTuple_New(5);
+ ePyObject tuple = PyTuple_New(6);
PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong((*infoiter)->m_ControlCode));
PyTuple_SET_ITEM(tuple, 1, PyString_FromString((*infoiter)->m_ApplicationName.c_str()));
PyTuple_SET_ITEM(tuple, 2, PyString_FromString((*infoiter)->m_HbbTVUrl.c_str()));
PyTuple_SET_ITEM(tuple, 3, PyInt_FromLong((*infoiter)->m_OrgId));
PyTuple_SET_ITEM(tuple, 4, PyInt_FromLong((*infoiter)->m_AppId));
+ PyTuple_SET_ITEM(tuple, 5, PyInt_FromLong((*infoiter)->m_ProfileCode));
PyList_Append(ret, tuple);
Py_DECREF(tuple);
}
int m_OrgId;
int m_AppId;
int m_ControlCode;
+ short m_ProfileCode;
std::string m_HbbTVUrl;
std::string m_ApplicationName;
public:
- HbbTVApplicationInfo(int controlCode, int orgid, int appid, std::string hbbtvUrl, std::string applicationName)
- : m_ControlCode(controlCode), m_HbbTVUrl(hbbtvUrl), m_ApplicationName(applicationName), m_OrgId(orgid), m_AppId(appid)
+ HbbTVApplicationInfo(int controlCode, int orgid, int appid, std::string hbbtvUrl, std::string applicationName, int profileCode)
+ : m_ControlCode(controlCode), m_HbbTVUrl(hbbtvUrl), m_ApplicationName(applicationName), m_OrgId(orgid),
+ m_AppId(appid), m_ProfileCode(profileCode)
{}
};
typedef std::list<HbbTVApplicationInfo *> HbbTVApplicationInfoList;
<screen name="HbbTVWindow" position="0,0" size="1280,720" backgroundColor="transparent" flags="wfNoBorder" title="HbbTV Plugin">
</screen>
"""
- def __init__(self, session, url=None, cbf=None, useAIT=False):
+ def __init__(self, session, url=None, cbf=None, useAIT=False, profile=0):
self._session = session
eRCInput.getInstance().lock()
self._url = url
self._use_ait = useAIT
+ self._profile = profile
self._cb_closed_func = cbf
self.onLayoutFinish.append(self._layoutFinished)
def _layoutFinished(self):
command_util = getCommandUtil()
+ profile = self._profile
(sid, onid, tsid, name, orgid) = getChannelInfos()
- params = struct.pack('!IIIII', orgid, sid, onid, tsid, len(name)) + name
+ params = struct.pack('!IIIIII', orgid, profile, sid, onid, tsid, len(name)) + name
if self._use_ait:
command_util.sendCommand('OP_HBBTV_UNLOAD_AIT')
time.sleep(1)
self._timer_infobar.start(1000)
self._excuted_browser = False
+ self._profile = 0
__gval__.command_util = BrowserCommandUtil()
return
use_ait = False
+
for x in self._urls:
control_code = x[0]
tmp_url = x[2]
if tmp_url == url and control_code == 1:
use_ait = True
+
self._excuted_browser = True
- self._session.open(HbbTVWindow, url, self._cb_closed_browser, use_ait)
+ self._session.open(HbbTVWindow, url, self._cb_closed_browser, use_ait, self._profile)
def _cb_closed_browser(self):
self._excuted_browser = False
except: pass
def getStartHbbTVUrl(self):
- url, self._urls = None, None
+ url, self._urls, self._profile = None, None, 0
service = self._session.nav.getCurrentService()
info = service and service.info()
if not info: return None
self._urls = info.getInfoObject(iServiceInformation.sHBBTVUrl)
for u in self._urls:
- if u[0] == 1: # 0:control code, 1:name, 2:url, 3:orgid, 4:appid
+ if u[0] in (1, -1): # 0:control code, 1:name, 2:url, 3:orgid, 4:appid, 5:profile code
url = u[2]
+ self._profile = u[5]
if url is None:
url = info.getInfoString(iServiceInformation.sHBBTVUrl)
return url
def showApplicationSelectionBox(self):
applications = []
+
if self.getStartHbbTVUrl():
for x in self._urls:
applications.append((x[1], x))
try:
for x in info.getInfoObject(iServiceInformation.sHBBTVUrl):
print x
- if x[0] == 1:
+ if x[0] in (-1, 1):
self.updateAIT(x[3])
self["HbbtvApplication"].setApplicationName(x[1])
break