X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/925629a36b521924a774da09b4f11515dd1889b3..5928c8c18abacbedd119752fe294a9393da6d2f7:/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py index 7149504a..59c50476 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -2,6 +2,7 @@ from enigma import eTimer from Components.config import config, ConfigSelection, ConfigSubDict, ConfigYesNo from Tools.CList import CList +from Tools.HardwareInfo import HardwareInfo # The "VideoHardware" is the interface to /proc/stb/video. # It generates hotplug events, and gives you the list of @@ -67,7 +68,7 @@ class VideoHardware: else: mode = config.av.videomode[port].value force_widescreen = self.isWidescreenMode(port, mode) - is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"] + is_widescreen = force_widescreen or config.av.aspect.value in ("16_9", "16_10") is_auto = config.av.aspect.value == "auto" if is_widescreen: if force_widescreen: @@ -90,12 +91,15 @@ class VideoHardware: def __init__(self): self.last_modes_preferred = [ ] self.on_hotplug = CList() - self.standby = False self.current_mode = None self.current_port = None self.readAvailableModes() + if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): + print "remove DVI-PC because of not existing modes" + del self.modes["DVI-PC"] + self.createConfig() # self.on_hotplug.append(self.createConfig) @@ -107,7 +111,6 @@ class VideoHardware: config.av.aspectratio.notifiers = [ ] config.av.tvsystem.notifiers = [ ] config.av.wss.notifiers = [ ] - AVSwitch.setInput = self.AVSwitchSetInput AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) @@ -120,12 +123,6 @@ class VideoHardware: # self.timer.callback.append(self.readPreferredModes) # self.timer.start(1000) - config.av.colorformat.addNotifier(self.updateFastblank) - - def AVSwitchSetInput(self, mode): - self.standby = mode == "SCART" - self.updateStandby() - def readAvailableModes(self): try: modes = open("/proc/stb/video/videomode_choices").read()[:-1] @@ -232,20 +229,29 @@ class VideoHardware: return res def createConfig(self, *args): - # create list of output ports - portlist = self.getPortList() + hw_type = HardwareInfo().get_device_name() + lst = [] - # create list of available modes - config.av.videoport = ConfigSelection(choices = [(port, _(port)) for port in portlist]) config.av.videomode = ConfigSubDict() config.av.videorate = ConfigSubDict() + # create list of output ports + portlist = self.getPortList() for port in portlist: + descr = port + if descr == 'DVI' and hw_type in ('dm500hd', 'dm800se'): + descr = 'HDMI' + elif descr == 'DVI-PC' and hw_type in ('dm500hd', 'dm800se'): + descr = 'HDMI-PC' + lst.append((port, descr)) + + # create list of available modes modes = self.getModeList(port) if len(modes): config.av.videomode[port] = ConfigSelection(choices = [mode for (mode, rates) in modes]) for (mode, rates) in modes: config.av.videorate[mode] = ConfigSelection(choices = rates) + config.av.videoport = ConfigSelection(choices = lst) def setConfiguredMode(self): port = config.av.videoport.value @@ -291,7 +297,7 @@ class VideoHardware: force_widescreen = self.isWidescreenMode(port, mode) - is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"] + is_widescreen = force_widescreen or config.av.aspect.value in ("16_9", "16_10") is_auto = config.av.aspect.value == "auto" policy2 = "policy" # use main policy @@ -322,42 +328,6 @@ class VideoHardware: open("/proc/stb/video/policy2", "w").write(policy2) except IOError: pass - self.updateSlowblank() - self.updateFastblank() - - def updateSlowblank(self): - if self.standby: - from Components.SystemInfo import SystemInfo - if SystemInfo["ScartSwitch"]: - input = "scart" - sb = "vcr" - else: - input = "off" - sb = "0" - else: - input = "encoder" - sb = "auto" - - open("/proc/stb/avs/0/sb", "w").write(sb) - open("/proc/stb/avs/0/input", "w").write(input) - - def updateStandby(self): - self.updateSlowblank() - self.updateFastblank() - - def updateFastblank(self, *args): - if self.standby: - from Components.SystemInfo import SystemInfo - if SystemInfo["ScartSwitch"]: - fb = "vcr" - else: - fb = "low" - else: - if self.current_port == "Scart" and config.av.colorformat.value == "rgb": - fb = "high" - else: - fb = "low" - open("/proc/stb/avs/0/fb", "w").write(fb) config.av.edid_override = ConfigYesNo(default = False) video_hw = VideoHardware()