Index: ipk/source/system_splitscreen_0_3/CONTROL/control
===================================================================
--- ipk/source/system_splitscreen_0_3/CONTROL/control	(revision 2858)
+++ ipk/source/system_splitscreen_0_3/CONTROL/control	(revision 2858)
@@ -0,0 +1,10 @@
+Package: enigma2-plugin-system-splitscreen
+Version: 0.3
+Architecture: sh4
+OE: splitscreen v0.3
+Section: extra
+Priority: optional
+Maintainer: AAF
+Homepage: http://www.aaf-digital.info
+Description: splitscreen v0.3
+Source: http://www.aaf-digital.info
Index: ipk/source/system_splitscreen_0_3/CONTROL/postinst
===================================================================
--- ipk/source/system_splitscreen_0_3/CONTROL/postinst	(revision 2858)
+++ ipk/source/system_splitscreen_0_3/CONTROL/postinst	(revision 2858)
@@ -0,0 +1,13 @@
+#!/bin/sh
+TMP=/tmp/.au
+PLUGINDIR=/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen
+
+echo "successfully installed"
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo new freespace size $FREE kb
+fi
+exit 0
Index: ipk/source/system_splitscreen_0_3/CONTROL/postrm
===================================================================
--- ipk/source/system_splitscreen_0_3/CONTROL/postrm	(revision 2858)
+++ ipk/source/system_splitscreen_0_3/CONTROL/postrm	(revision 2858)
@@ -0,0 +1,14 @@
+#!/bin/sh
+TMP=/tmp/.au
+PLUGINDIR=/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen
+rm -r $PLUGINDIR > /dev/null 2>&1
+
+echo "successfully removed"
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo new freespace size $FREE kb
+fi
+exit 0
Index: ipk/source/system_splitscreen_0_3/CONTROL/preinst
===================================================================
--- ipk/source/system_splitscreen_0_3/CONTROL/preinst	(revision 2858)
+++ ipk/source/system_splitscreen_0_3/CONTROL/preinst	(revision 2858)
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+TMP=/tmp/.au
+echo "syncing disk"
+sync
+
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	SIZE=28
+	echo "checking freespace"
+	echo packege size $SIZE kb
+	echo freespace size $FREE kb
+	if  [ "$FREE" -lt "$SIZE" ]; then
+		echo "sorry no freespace left on device"
+		exit 1
+	else
+		echo ok
+	fi
+fi   
+echo "installing SplitScreen ..."
+echo "checking OS"
+if  [ `cat /etc/motd | grep AAF | grep M | grep rev | wc -l` -eq 0 ]; then                      
+	echo ---------------------------
+	echo DONT USE this IPK Package!!
+	echo ---
+	echo Only for AAF Image!!
+	echo ---------------------------
+	exit 1
+fi
+exit 0
Index: ipk/source/system_splitscreen_0_3/CONTROL/prerm
===================================================================
--- ipk/source/system_splitscreen_0_3/CONTROL/prerm	(revision 2858)
+++ ipk/source/system_splitscreen_0_3/CONTROL/prerm	(revision 2858)
@@ -0,0 +1,11 @@
+#!/bin/sh
+TMP=/tmp/.au
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo freespace size $FREE kb
+fi
+echo "removing SplitScreen"
+exit 0
Index: ipk/source/system_splitscreen_0_3/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen/Pluginfo
===================================================================
--- ipk/source/system_splitscreen_0_3/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen/Pluginfo	(revision 2858)
+++ ipk/source/system_splitscreen_0_3/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen/Pluginfo	(revision 2858)
@@ -0,0 +1,1 @@
+SplitScreen by gutemine
Index: ipk/source/system_splitscreen_0_3/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen/plugin.py
===================================================================
--- ipk/source/system_splitscreen_0_3/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen/plugin.py	(revision 2858)
+++ ipk/source/system_splitscreen_0_3/usr/lib/enigma2/python/Plugins/Extensions/SplitScreen/plugin.py	(revision 2858)
@@ -0,0 +1,188 @@
+# -*- coding: iso-8859-1 -*-
+#
+# SplitScreen by gutemine
+#
+splitscreen_version="0.3"
+#
+from enigma import eTimer
+from Screens.InfoBar import *
+from Plugins.Plugin import PluginDescriptor
+from Screens.Screen import Screen
+from Screens.InfoBarGenerics  import InfoBarPiP
+from Screens.PictureInPicture import PictureInPicture
+from Components.SystemInfo import SystemInfo
+from Components.config import config, ConfigPosition
+from Screens.ChannelSelection import ChannelSelection
+
+def autostart(reason, **kwargs):
+	if SystemInfo.get("NumVideoDecoders", 1) > 1:
+		print "[SPLITSCEEN] resetting"
+		l=open("/proc/stb/vmpeg/0/dst_left","w")
+		l.write("%x" % 0)
+		l.close()
+		t=open("/proc/stb/vmpeg/0/dst_top","w")
+		t.write("%x" % 0)
+		t.close()
+		h=open("/proc/stb/vmpeg/0/dst_height","w")
+		h.write("%x" % 576)
+		h.close()
+		w=open("/proc/stb/vmpeg/0/dst_width","w")
+		w.write("%x" % 720)
+		w.close()
+		try:
+			xxx = config.av.pip.value[0]
+			yyy = config.av.pip.value[1]
+			www = config.av.pip.value[2]
+			hhh = config.av.pip.value[3] 
+		except:
+			# default location
+			xxx = 400
+			yyy = 60
+			www = 240
+			hhh = 192
+		l=open("/proc/stb/vmpeg/1/dst_left","w")
+		l.write("%x" % xxx)
+		l.close()
+		t=open("/proc/stb/vmpeg/1/dst_top","w")
+		t.write("%x" % yyy) 
+		t.close()
+		h=open("/proc/stb/vmpeg/1/dst_height","w")
+		h.write("%x" % hhh)
+		h.close()
+		w=open("/proc/stb/vmpeg/1/dst_width","w")
+		w.write("%x" % www)
+		w.close()
+
+def Plugins(**kwargs):
+	return [PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart),
+			PluginDescriptor(name=_("Split Screen"), description=_("split PIP screen"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, icon="splitscreen.png", fnc=main)]
+
+def main(session, **kwargs):
+	session.open(SplitScreen)
+
+class SplitScreen(Screen):
+	def __init__(self, session, args = 0):
+		Screen.__init__(self, session)
+		if SystemInfo.get("NumVideoDecoders", 1) > 1:
+			try:
+				self.session.pipshown
+			except:
+				self.session.pipshown = False
+			if self.session.pipshown:
+				print "[SPLITSCREEN] pip already shown"
+				w=open("/proc/stb/vmpeg/0/dst_width","r")
+				ww=w.readline().rstrip()
+				w.close()
+				if not ww.endswith("%x" % 720):
+					print "[SPLITSCREEN] PiP is stopped"
+					self.showPiP()
+					print "[SPLITSCREEN] unsplitting"
+					l=open("/proc/stb/vmpeg/0/dst_left","w")
+					l.write("%x" % 0)
+					l.close()
+					t=open("/proc/stb/vmpeg/0/dst_top","w")
+					t.write("%x" % 0)
+					t.close()
+					h=open("/proc/stb/vmpeg/0/dst_height","w")
+					h.write("%x" % 576)
+					h.close()
+					w=open("/proc/stb/vmpeg/0/dst_width","w")
+					w.write("%x" % 720)
+					w.close()
+					try:
+						xxx = config.av.pip.value[0]
+						yyy = config.av.pip.value[1]
+						www = config.av.pip.value[2]
+						hhh = config.av.pip.value[3] 
+					except:
+						# default location
+						xxx = 400
+						yyy = 60
+						www = 240
+						hhh = 192
+					l=open("/proc/stb/vmpeg/1/dst_left","w")
+					l.write("%x" % xxx)
+					l.close()
+					t=open("/proc/stb/vmpeg/1/dst_top","w")
+					t.write("%x" % yyy) 
+					t.close()
+					h=open("/proc/stb/vmpeg/1/dst_height","w")
+					h.write("%x" % hhh)
+					h.close()
+					w=open("/proc/stb/vmpeg/1/dst_width","w")
+					w.write("%x" % www)
+					w.close()
+				else:
+					print "[SPLITSCREEN] splitting"
+					l=open("/proc/stb/vmpeg/0/dst_left","w")
+					l.write("%x" % 0)
+					l.close()
+					t=open("/proc/stb/vmpeg/0/dst_top","w")
+					t.write("%x" % 0)
+					t.close()
+					h=open("/proc/stb/vmpeg/0/dst_height","w")
+					h.write("%x" % 576)
+					h.close()
+					w=open("/proc/stb/vmpeg/0/dst_width","w")
+					w.write("%x" % 360)
+					w.close()
+					l=open("/proc/stb/vmpeg/1/dst_left","w")
+					l.write("%x" % 360)
+					l.close()
+					t=open("/proc/stb/vmpeg/1/dst_top","w")
+					t.write("%x" % 0)
+					t.close()
+					h=open("/proc/stb/vmpeg/1/dst_height","w")
+					h.write("%x" % 576)
+					h.close()
+					w=open("/proc/stb/vmpeg/1/dst_width","w")
+					w.write("%x" % 360)
+					w.close()
+			else:
+				print "[SPLITSCREEN] PiP is started"
+				self.showPiP()
+				print "[SPLITSCREEN] splitting"
+				l=open("/proc/stb/vmpeg/0/dst_left","w")
+				l.write("%x" % 0)
+				l.close()
+				t=open("/proc/stb/vmpeg/0/dst_top","w")
+				t.write("%x" % 0)
+				t.close()
+				h=open("/proc/stb/vmpeg/0/dst_height","w")
+				h.write("%x" % 576)
+				h.close()
+				w=open("/proc/stb/vmpeg/0/dst_width","w")
+				w.write("%x" % 360)
+				w.close()
+				l=open("/proc/stb/vmpeg/1/dst_left","w")
+				l.write("%x" % 360)
+				l.close()
+				t=open("/proc/stb/vmpeg/1/dst_top","w")
+				t.write("%x" % 0)
+				t.close()
+				h=open("/proc/stb/vmpeg/1/dst_height","w")
+				h.write("%x" % 576)
+				h.close()
+				w=open("/proc/stb/vmpeg/1/dst_width","w")
+				w.write("%x" % 360)
+				w.close()
+		else:
+			print "[SPLITSCREEN] too less video decoders"
+		self.close()
+
+	def showPiP(self):
+		self.servicelist = self.session.instantiateDialog(ChannelSelection)
+		if self.session.pipshown:
+			del self.session.pip
+			self.session.pipshown = False
+		else:
+			self.session.pip = self.session.instantiateDialog(PictureInPicture)
+			self.session.pip.show()
+			newservice = self.session.nav.getCurrentlyPlayingServiceReference()
+			if self.session.pip.playService(newservice):
+				self.session.pipshown = True
+				self.session.pip.servicePath = self.servicelist.getCurrentServicePath()
+			else:
+				self.session.pipshown = False
+				del self.session.pip
+			self.session.nav.playService(newservice)
