X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FConverter%2FServiceInfo.py;h=e2fa12c488b8c70279e05cef703b4d020b32d17f;hb=376c4a25184424fb78904837add6c2e1e773b4c6;hp=461a0461e67e1be9243310591751d8f2e1ba459f;hpb=3087c136c3cac8ef5d1a94438d95256118a68dc9;p=vuplus_dvbapp diff --git a/lib/python/Components/Converter/ServiceInfo.py b/lib/python/Components/Converter/ServiceInfo.py index 461a046..e2fa12c 100644 --- a/lib/python/Components/Converter/ServiceInfo.py +++ b/lib/python/Components/Converter/ServiceInfo.py @@ -19,6 +19,7 @@ class ServiceInfo(Converter, object): ONID = 13 SID = 14 FRAMERATE = 15 + TRANSFERBPS = 16 def __init__(self, type): @@ -40,15 +41,16 @@ class ServiceInfo(Converter, object): "OnId": (self.ONID, (iPlayableService.evUpdatedInfo,)), "Sid": (self.SID, (iPlayableService.evUpdatedInfo,)), "Framerate": (self.FRAMERATE, (iPlayableService.evVideoSizeChanged,iPlayableService.evUpdatedInfo,)), + "TransferBPS": (self.TRANSFERBPS, (iPlayableService.evUpdatedInfo,)), }[type] - def getServiceInfoString(self, info, what, convert = lambda x: x): + def getServiceInfoString(self, info, what, convert = lambda x: "%d" % x): v = info.getInfo(what) if v == -1: return "N/A" if v == -2: return info.getInfoString(what) - return "%d" % convert(v) + return convert(v) @cached def getBoolean(self): @@ -69,7 +71,7 @@ class ServiceInfo(Converter, object): while idx < n: i = audio.getTrackInfo(idx) description = i.getDescription(); - if "AC3" in description or "DTS" in description: + if "AC3" in description or "DTS" in description or "Dolby Digital" in description: return True idx += 1 return False @@ -111,7 +113,9 @@ class ServiceInfo(Converter, object): elif self.type == self.SID: return self.getServiceInfoString(info, iServiceInformation.sSID) elif self.type == self.FRAMERATE: - return self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: (x+500)/1000) + return self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: "%d fps" % ((x+500)/1000)) + elif self.type == self.TRANSFERBPS: + return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x/1024)) return "" text = property(getText)