aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2009-02-11 12:52:48 +0100
committerFelix Domke <tmbinc@elitedvb.net>2009-02-11 12:52:48 +0100
commitbbfcb7ea1f040d030277e2b6f2efa9ea0967bf2b (patch)
treec5945c791698c14723e989449e6b4bfcc275c05d /lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
parent4f7990ff2a55874b9eb65e3c9cd47dacb9f76deb (diff)
parent5e6f814d005a01caa437a532e61f4b338617ff67 (diff)
downloadenigma2-bbfcb7ea1f040d030277e2b6f2efa9ea0967bf2b.tar.gz
enigma2-bbfcb7ea1f040d030277e2b6f2efa9ea0967bf2b.zip
Merge branch 'master' of /home/tmbinc/enigma2-git into tmbinc/FixTimingBugs
Conflicts: lib/dvb/decoder.cpp
Diffstat (limited to 'lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py')
-rw-r--r--lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py81
1 files changed, 36 insertions, 45 deletions
diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
index 2422475e..6a85c4da 100644
--- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
+++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
@@ -59,10 +59,37 @@ class VideoHardware:
widescreen_modes = set(["720p", "1080i"])
+ def getOutputAspect(self):
+ ret = (16,9)
+ port = config.av.videoport.value
+ if port not in config.av.videomode:
+ print "current port not available in getOutputAspect!!! force 16:9"
+ else:
+ mode = config.av.videomode[port].value
+ force_widescreen = self.isWidescreenMode(port, mode)
+ is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"]
+ is_auto = config.av.aspect.value == "auto"
+ if is_widescreen:
+ if force_widescreen:
+ pass
+ else:
+ aspect = {"16_9": "16:9", "16_10": "16:10"}[config.av.aspect.value]
+ if aspect == "16:10":
+ ret = (16,10)
+ elif is_auto:
+ try:
+ aspect_str = open("/proc/stb/vmpeg/0/aspect", "r").read()
+ if aspect_str == "1": # 4:3
+ ret = (4,3)
+ except IOError:
+ pass
+ else: # 4:3
+ ret = (4,3)
+ return ret
+
def __init__(self):
self.last_modes_preferred = [ ]
self.on_hotplug = CList()
- self.standby = False
self.current_mode = None
self.current_port = None
@@ -79,7 +106,7 @@ class VideoHardware:
config.av.aspectratio.notifiers = [ ]
config.av.tvsystem.notifiers = [ ]
config.av.wss.notifiers = [ ]
- AVSwitch.setInput = self.AVSwitchSetInput
+ AVSwitch.getOutputAspect = self.getOutputAspect
config.av.aspect.addNotifier(self.updateAspect)
config.av.wss.addNotifier(self.updateAspect)
@@ -91,12 +118,6 @@ 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"
- self.updateStandby()
-
def readAvailableModes(self):
try:
modes = open("/proc/stb/video/videomode_choices").read()[:-1]
@@ -264,6 +285,7 @@ class VideoHardware:
is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"]
is_auto = config.av.aspect.value == "auto"
+ policy2 = "policy" # use main policy
if is_widescreen:
if force_widescreen:
@@ -271,6 +293,7 @@ class VideoHardware:
else:
aspect = {"16_9": "16:9", "16_10": "16:10"}[config.av.aspect.value]
policy = {"pillarbox": "panscan", "panscan": "letterbox", "nonlinear": "nonlinear", "scale": "bestfit"}[config.av.policy_43.value]
+ policy2 = {"letterbox": "letterbox", "panscan": "panscan", "scale": "bestfit"}[config.av.policy_169.value]
elif is_auto:
aspect = "any"
policy = "bestfit"
@@ -283,46 +306,14 @@ class VideoHardware:
else:
wss = "auto"
- print "-> setting aspect, policy, wss", aspect, policy, wss
+ print "-> setting aspect, policy, policy2, wss", aspect, policy, policy2, wss
open("/proc/stb/video/aspect", "w").write(aspect)
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"]:
- input = "scart"
- sb = "vcr"
- else:
- input = "off"
- sb = "0"
- else:
- input = "encoder"
- sb = "auto"
-
- open("/proc/stb/avs/0/sb", "w").write(sb)
- 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)
+ try:
+ open("/proc/stb/video/policy2", "w").write(policy2)
+ except IOError:
+ pass
config.av.edid_override = ConfigYesNo(default = False)
video_hw = VideoHardware()