X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FSystemPlugins%2FVideomode%2FVideoHardware.py;h=9defb9eb887748829d3f548e517391da0befbb2b;hp=701daaf271b1039e7a587be48e8f6138ffc74f27;hb=6f73e6abddf4170357c490966d0e1c622eb376f5;hpb=c797d4040a1dfac3873b481111a84a5c557432f3 diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py index 701daaf..9defb9e 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -57,7 +57,6 @@ class VideoHardware: self.last_modes_preferred = [ ] self.on_hotplug = CList() - self.readAvailableModes() self.createConfig() @@ -67,7 +66,7 @@ class VideoHardware: # until we have the hotplug poll socket # self.timer = eTimer() -# self.timer.timeout.get().append(self.readPreferredModes) +# self.timer.callback.append(self.readPreferredModes) # self.timer.start(1000) def readAvailableModes(self): @@ -106,6 +105,7 @@ class VideoHardware: return True def setMode(self, port, mode, rate, force = None): + print "setMode - port:", port, "mode:", mode, "rate:", rate # we can ignore "port" self.current_mode = mode modes = self.rates[mode][rate] @@ -127,6 +127,16 @@ class VideoHardware: except IOError: print "setting videomode failed." + try: + open("/etc/videomode", "w").write(mode_50) # use 50Hz mode (if available) for booting + except IOError: + print "writing initial videomode to /etc/videomode failed." + + # workaround: this should not be set here. + if port != "Scart": + open("/proc/stb/video/aspect", "w").write("any") + open("/proc/stb/video/policy", "w").write("panscan") + def isPortAvailable(self, port): # fixme return True @@ -169,5 +179,21 @@ class VideoHardware: for (mode, rates) in modes: config.av.videorate[mode] = ConfigSelection(choices = rates) + def setConfiguredMode(self): + port = config.av.videoport.value + if port not in config.av.videomode: + print "current port not available, not setting videomode" + return + + mode = config.av.videomode[port].value + + if mode not in config.av.videorate: + print "current mode not available, not setting videomode" + return + + rate = config.av.videorate[mode].value + self.setMode(port, mode, rate) + config.av.edid_override = ConfigYesNo(default = False) video_hw = VideoHardware() +video_hw.setConfiguredMode()