no bluescreen with old drivers
[enigma2.git] / lib / python / Screens / ServiceInfo.py
index 3899968a9e01c9a5d81ccae4830b2e8cd4a80794..5973ec20d0676e28360b34237ff0307c935da64f 100644 (file)
@@ -30,8 +30,7 @@ def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4):
                elif valueType == TYPE_VALUE_HEX_DEC:
                        b = ("0x%0" + str(param) + "x (%dd)") % (b, b)
                else:
-                       b = str(b)              
-       
+                       b = str(b)
        
        res.append((eListboxPythonMultiContent.TYPE_TEXT, 220, 0, 350, 25, 0, RT_HALIGN_LEFT, b))
 
@@ -102,30 +101,44 @@ class ServiceInfo(Screen):
                                name = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference()).getServiceName()
                        else:
                                name = "N/A"
-                       Labels = ( ("Name",  name, TYPE_TEXT),
-                                          ("Provider", self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
-                                          ("Videoformat", self.getServiceInfoValue(iServiceInformation.sAspect), TYPE_TEXT),
-                                          ("Namespace", self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8))
+                       aspect = self.getServiceInfoValue(iServiceInformation.sAspect)
+                       if aspect in ( 1, 2, 5, 6, 9, 0xA, 0xD, 0xE ):
+                               aspect = "4:3"
+                       else:
+                               aspect = "16:9"
+                       width = self.info.getInfo(iServiceInformation.sVideoWidth)
+                       height = self.info.getInfo(iServiceInformation.sVideoHeight)
+                       if width != -1 and height != -1:
+                               Labels = ( ("Name", name, TYPE_TEXT),
+                                                  ("Provider", self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
+                                                  ("Videoformat", aspect, TYPE_TEXT),
+                                                  ("Videosize", "%dx%d" %(width, height), TYPE_TEXT),
+                                                  ("Namespace", self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8))
+                       else:
+                               Labels = ( ("Name", name, TYPE_TEXT),
+                                                  ("Provider", self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
+                                                  ("Videoformat", aspect, TYPE_TEXT),
+                                                  ("Namespace", self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8))
                        self.fillList(Labels)
                else:
                        if self.transponder_info:
-                               conv = { "type"                         : _("Transponder Type:"),
-                                                "frequency"            : _("Frequency:"),
-                                                "symbolrate"           : _("Symbolrate:"),
-                                                "orbital position" : _("Orbital Position:"),
-                                                "inversion"            : _("Inversion:"),
-                                                "fec inner"            : _("FEC:"),
-                                                "modulation"           : _("Modulation:"),
-                                                "polarization"         : _("Polarization:"),
-                                                "roll off"                     : _("Rolloff:"),
-                                                "system"                       : _("System:"),
-                                                "bandwidth"            : _("Bandwidth:"),
-                                                "code rate lp"         : _("Coderate LP:"),
-                                                "code rate hp"         : _("Coderate HP:"),
-                                                "constellation"        : _("Constellation:"),
-                                                "transmission mode": _("Transmission Mode:"),
-                                                "guard interval"       : _("Guard Interval:"),
-                                                "hierarchy"            : _("Hierarchy Information:") }
+                               conv = { "type"                         : _("Transponder Type"),
+                                                "frequency"            : _("Frequency"),
+                                                "symbolrate"           : _("Symbolrate"),
+                                                "orbital position" : _("Orbital Position"),
+                                                "inversion"            : _("Inversion"),
+                                                "fec inner"            : _("FEC"),
+                                                "modulation"           : _("Modulation"),
+                                                "polarization"         : _("Polarization"),
+                                                "roll off"                     : _("Rolloff"),
+                                                "system"                       : _("System"),
+                                                "bandwidth"            : _("Bandwidth"),
+                                                "code rate lp"         : _("Coderate LP"),
+                                                "code rate hp"         : _("Coderate HP"),
+                                                "constellation"        : _("Constellation"),
+                                                "transmission mode": _("Transmission Mode"),
+                                                "guard interval"       : _("Guard Interval"),
+                                                "hierarchy"            : _("Hierarchy Information") }
                                Labels = [ ]
                                for i in self.transponder_info.keys():
                                        Labels.append( (conv[i], self.transponder_info[i], TYPE_TEXT) )
@@ -192,7 +205,7 @@ class ServiceInfo(Screen):
                                           ("Transmission Mode", frontendData["transmission_mode"], TYPE_TEXT),
                                           ("Guard Interval", frontendData["guard_interval"], TYPE_TEXT),
                                           ("Hierarchy Inform.", frontendData["hierarchy_information"], TYPE_TEXT),
-                                               )
+                                               )
                
        def fillList(self, Labels):
                tlist = [ ]