X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/5d6e862f8d4aa80b0907f520237ac28aa1247829..fc6db03e4ba81da917b64bb55e65e82bb2808b22:/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 893fa5f6..87529af3 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -59,6 +59,8 @@ class VideoHardware: self.last_modes_preferred = [ ] self.on_hotplug = CList() self.standby = False + self.current_mode = None + self.current_port = None self.readAvailableModes() @@ -85,6 +87,7 @@ 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" @@ -132,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) @@ -160,8 +164,11 @@ class VideoHardware: def saveMode(self, port, mode, rate): config.av.videoport.value = port + config.av.videoport.save() config.av.videomode[port].value = mode + config.av.videomode[port].save() config.av.videorate[mode].value = rate + config.av.videorate[mode].save() def isPortAvailable(self, port): # fixme @@ -276,25 +283,41 @@ class VideoHardware: 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"]: - mode = "scart" + input = "scart" sb = "vcr" else: - mode = "off" + input = "off" sb = "0" else: - mode = "encoder" + input = "encoder" sb = "auto" open("/proc/stb/avs/0/sb", "w").write(sb) - open("/proc/stb/avs/0/input", "w").write(mode) + 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()