From cd6e0c369eb5e3a67aa298642d176a0e1af2a547 Mon Sep 17 00:00:00 2001 From: smlee Date: Tue, 15 Nov 2016 18:52:46 +0900 Subject: [PATCH] [Videomode] Updated - Support YPbPr(444,422,420) for HDMI colorspace - Support HDMI colordepth --- .../SystemPlugins/Videomode/VideoHardware.py | 22 ++++++++++++++++++++++ .../Plugins/SystemPlugins/Videomode/plugin.py | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py index c423bc5..8781659 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -286,11 +286,33 @@ class VideoHardware: hdmicolorspace_choices = {} hdmicolorspace_choices["Edid(Auto)"] = _("Auto") hdmicolorspace_choices["Hdmi_Rgb"] = _("RGB") + hdmicolorspace_choices["444"] = _("YCbCr444") + hdmicolorspace_choices["422"] = _("YCbCr422") + hdmicolorspace_choices["420"] = _("YCbCr420") config.av.hdmicolorspace = ConfigSelection(choices = hdmicolorspace_choices, default = "Edid(Auto)") config.av.hdmicolorspace.addNotifier(setHdmiColorspace) else: config.av.hdmicolorspace = NoSave(ConfigNothing()) + if os.path.exists("/proc/stb/video/hdmi_colordepth"): + def setHdmiColordepth(config): + try: + print "set HDMI Colordepth : ",config.value + f = open("/proc/stb/video/hdmi_colordepth", "w") + f.write(config.value) + f.close() + except IOError: + print "set HDMI Colordepth failed!" + hdmicolordepth_choices = {} + hdmicolordepth_choices["auto"] = _("Auto") + hdmicolordepth_choices["8bit"] = _("8bit") + hdmicolordepth_choices["10bit"] = _("10bit") + hdmicolordepth_choices["12bit"] = _("12bit") + config.av.hdmicolordepth = ConfigSelection(choices = hdmicolordepth_choices, default = "auto") + config.av.hdmicolordepth.addNotifier(setHdmiColordepth) + else: + config.av.hdmicolordepth = NoSave(ConfigNothing()) + def changedVideomode(self, configElement): if self.is_init: return diff --git a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py index abe93df..ce5aeaf 100755 --- a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py @@ -22,6 +22,7 @@ class avSetupScreen(ConfigListScreen, Screen): {"idx":8, "level":1, "text":"WSS on 4:3", "item":"config.av.wss"}, {"idx":9, "level":1, "text":"Auto scart switching", "requires":"ScartSwitch", "item":"config.av.vcrswitch"}, {"idx":10, "level":1, "text":"HDMI Colorspace", "item":"config.av.hdmicolorspace"}, + {"idx":11, "level":1, "text":"HDMI Colordepth", "item":"config.av.hdmicolordepth"}, {"idx":0, "level":1, "text":"Dolby Digital default", "item":"config.av.defaultac3"}, {"idx":0, "level":1, "text":"Dolby Digital / DTS downmix", "requires":"CanDownmixAC3", "item":"config.av.downmix_ac3"}, {"idx":0, "level":1, "text":"PCM Multichannel", "requires":"CanPcmMultichannel", "item":"config.av.pcm_multichannel"}, @@ -131,7 +132,7 @@ class avSetupScreen(ConfigListScreen, Screen): # Color Format, WSS on 4:3, Auto scart switching elif (idx == 7 or idx == 8 or idx == 9) and not current_port == "Scart": continue - elif (idx == 10) and not current_port == "DVI": # HDMI Colorspace + elif (idx == 10 or idx == 11) and not current_port == "DVI": # HDMI Colorspace/Colordepth continue if idx == 0 and item_level == 1: # audio self.audio_cfg.append(item_text) -- 2.7.4