X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ba160cb23024029aac5b35aba554aaf0ac59c072..9ebda6e28dcc96d34b6c5c63d94883adc7ef2dd3:/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 ade2035d..c90f8fd8 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -58,6 +58,9 @@ 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() @@ -66,7 +69,16 @@ class VideoHardware: self.readPreferredModes() + # take over old AVSwitch component :) + from Components.AVSwitch import AVSwitch +# config.av.colorformat.notifiers = [ ] + config.av.aspectratio.notifiers = [ ] + config.av.tvsystem.notifiers = [ ] + config.av.wss.notifiers = [ ] + AVSwitch.setInput = self.AVSwitchSetInput + config.av.aspect.addNotifier(self.updateAspect) + config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect) @@ -75,6 +87,12 @@ 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] @@ -117,6 +135,7 @@ class VideoHardware: print "setMode - port:", port, "mode:", mode, "rate:", rate # we can ignore "port" self.current_mode = mode + self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) @@ -205,7 +224,6 @@ class VideoHardware: rate = config.av.videorate[mode].value self.setMode(port, mode, rate) - def updateAspect(self, cfgelement): # determine aspect = {any,4:3,16:9,16:10} @@ -252,9 +270,51 @@ class VideoHardware: aspect = "4:3" policy = {"letterbox": "letterbox", "panscan": "panscan", "scale": "bestfit"}[config.av.policy_169.value] - print "-> setting aspect, policy", aspect, policy + if not config.av.wss.value: + wss = "auto(4:3_off)" + else: + wss = "auto" + + print "-> setting aspect, policy, wss", aspect, policy, wss open("/proc/stb/video/aspect", "w").write(aspect) open("/proc/stb/video/policy", "w").write(policy) + open("/proc/stb/denc/0/wss", "w").write(wss) + 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()