VideoMode: add 2160p mode if hardware supports it
authorAthanasios Oikonomou <athoik@gmail.com>
Mon, 14 Dec 2015 20:24:18 +0000 (22:24 +0200)
committerErik Slagter <erik@openpli.org>
Tue, 15 Dec 2015 15:00:51 +0000 (16:00 +0100)
Add 2160p video mode to VideoHardware and to VideoWizard.
Use intersection to widescreen modes and supported modes, to get only supported widescreen modes.

(cherry picked from commit 30fc4983704fde72997d56935b329792669f6d4a)
Signed-off-by: Erik Slagter <erik@openpli.org>

lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py

index 81886eb..d3a8105 100644 (file)
@@ -42,6 +42,10 @@ class VideoHardware:
                                                                "60Hz":         { 60: "1080p" },
                                                                "multi":        { 50: "1080p50", 60: "1080p" } }
 
+       rates["2160p"] =                { "50Hz":       { 50: "2160p50" },
+                                                               "60Hz":         { 60: "2160p" },
+                                                               "multi":        { 50: "2160p50", 60: "2160p" } }
+
        rates["PC"] = {
                "1024x768": { 60: "1024x768" }, # not possible on DM7025
                "800x600" : { 60: "800x600" },  # also not possible
@@ -60,7 +64,7 @@ class VideoHardware:
 
        modes["Scart"] = ["PAL", "NTSC", "Multi"]
        modes["YPbPr"] = ["720p", "1080i", "576p", "480p", "576i", "480i"]
-       modes["DVI"] = ["720p", "1080p", "1080i", "576p", "480p", "576i", "480i"]
+       modes["DVI"] = ["720p", "1080p", "2160p", "1080i", "576p", "480p", "576i", "480i"]
        modes["DVI-PC"] = ["PC"]
 
        def getOutputAspect(self):
@@ -98,6 +102,7 @@ class VideoHardware:
                self.current_port = None
 
                self.readAvailableModes()
+               self.widescreen_modes = set(["720p", "1080i", "1080p", "2160p"]).intersection(*[self.modes_available])
 
                if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"):
                        print "[VideoHardware] remove DVI-PC because of not existing modes"
@@ -106,18 +111,6 @@ class VideoHardware:
                self.createConfig()
                self.readPreferredModes()
 
-               portlist = self.getPortList()
-               has1080p50 = False
-               for port in portlist:
-                       if port == 'DVI' and HardwareInfo().has_hdmi():
-                               if "1080p50" in self.modes_available:
-                                       has1080p50 = True
-
-               if has1080p50:
-                       self.widescreen_modes = set(["720p", "1080i", "1080p"])
-               else:
-                       self.widescreen_modes = set(["720p", "1080i"])
-
                # take over old AVSwitch component :)
                from Components.AVSwitch import AVSwitch
                config.av.aspectratio.notifiers = [ ]
index 3774454..2e27b76 100644 (file)
@@ -133,7 +133,7 @@ class VideoWizard(WizardLanguage, Rc):
        def modeSelect(self, mode):
                ratesList = self.listRates(mode)
                print "[VideoWizard] ratesList:", ratesList
-               if self.port == "DVI" and mode in ("720p", "1080i", "1080p"):
+               if self.port == "DVI" and mode in ("720p", "1080i", "1080p", "2160p"):
                        self.rate = "multi"
                        self.hw.setMode(port = self.port, mode = mode, rate = "multi")
                else: