X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/3a774aaf137dab965c4cda13c0a59ccf53dbcb72..924b11457b3276c94631707fc66419b8db6d5cb8:/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 d20bc630..d3389a75 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -22,17 +22,26 @@ class VideoHardware: modes = { } # a list of (high-level) modes for a certain port. - rates["PAL"] = { "50Hz": { 50: "pal", 60: "pal"}, - "60Hz": { 50: "pal60", 60: "pal60"}, - "multi": { 50: "pal", 60: "pal60"} } - rates["NTSC"] = { "60Hz": { 50: "ntsc", 60: "ntsc"} } - rates["Multi"] = { "multi": { 50: "pal", 60: "ntsc"} } - rates["720p"] = { "50Hz": { 50: "720p50", 60: "720p50"}, - "60Hz": { 50: "720p", 60: "720p"}, - "multi": { 50: "720p50", 60: "720p"} } - rates["1080i"] = { "50Hz": { 50: "1080i50", 60: "1080i50"}, - "60Hz": { 50: "1080i", 60: "1080i"}, - "multi": { 50: "1080i50", 60: "1080i"} } + rates["PAL"] = { "50Hz": { 50: "pal" }, + "60Hz": { 60: "pal60" }, + "multi": { 50: "pal", 60: "pal60" } } + + rates["NTSC"] = { "60Hz": { 60: "ntsc" } } + + rates["Multi"] = { "multi": { 50: "pal", 60: "ntsc" } } + + rates["480p"] = { "60Hz": { 60: "480p" } } + + rates["576p"] = { "50Hz": { 50: "576p" } } + + rates["720p"] = { "50Hz": { 50: "720p50", 60: "720p50" }, + "60Hz": { 60: "720p" }, + "multi": { 50: "720p50" } } + + rates["1080i"] = { "50Hz": { 50: "1080i50" }, + "60Hz": { 60: "1080i" }, + "multi": { 50: "1080i50", 60: "1080i" } } + rates["PC"] = { "1024x768": { 60: "1024x768"}, # not possible on DM7025 "800x600" : { 60: "800x600"}, # also not possible @@ -46,12 +55,13 @@ class VideoHardware: "1366x768" : { 60: "1366x768"}, "1366x768 multi" : { 50: "1366x768", 60: "1366x768_50"}, "1280x768": { 60: "1280x768"}, - "640x480" : { 60: "640x480"} + "640x480" : { 60: "640x480"} } modes["Scart"] = ["PAL", "NTSC", "Multi"] - modes["YPbPr"] = ["720p", "1080i"] - modes["DVI"] = ["720p", "1080i", "PC"] + modes["YPbPr"] = ["720p", "1080i", "576p", "480p"] + modes["DVI"] = ["720p", "1080i", "576p", "480p"] + modes["DVI-PC"] = ["PC"] widescreen_modes = set(["720p", "1080i"]) @@ -59,6 +69,8 @@ class VideoHardware: self.last_modes_preferred = [ ] self.on_hotplug = CList() self.standby = False + self.current_mode = None + self.current_port = None self.readAvailableModes() @@ -133,6 +145,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) @@ -161,8 +174,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 @@ -307,7 +323,7 @@ class VideoHardware: else: fb = "low" else: - if config.av.videoport.value == "Scart" and config.av.colorformat.value == "rgb": + if self.current_port == "Scart" and config.av.colorformat.value == "rgb": fb = "high" else: fb = "low"