Added remote ip arguments to scripts

This commit is contained in:
sebastian 2014-06-10 19:43:01 +02:00
parent 537e0681f2
commit ac920fae91
3 changed files with 19 additions and 6 deletions

View File

@ -5,6 +5,7 @@ require version 0.4.2
# Define allowed remote host IP addresses. If omitted then only 127.0.0.1 will be accepted. # Define allowed remote host IP addresses. If omitted then only 127.0.0.1 will be accepted.
system host allow 127.0.0.1 system host allow 127.0.0.1
system host allow 192.168.11.211
# Listen on port 9999 for command control connections # Listen on port 9999 for command control connections
system control port 9999 system control port 9999

View File

@ -3,17 +3,17 @@
import sys import sys
import socket import socket
from gi.repository import Gtk from gi.repository import Gtk, GObject
from scenechanger import SceneChanger from scenechanger import SceneChanger
from textchanger import TextChanger from textchanger import TextChanger
from timercontroller import TimerController from timercontroller import TimerController
class VideoController: class VideoController(object):
def __init__(self): def __init__(self, ip):
self.snowmix_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.snowmix_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.snowmix_socket.connect(("localhost", 9999)) self.snowmix_socket.connect((ip, 9999))
self.scenechanger = SceneChanger(self.snowmix_socket) self.scenechanger = SceneChanger(self.snowmix_socket)
self.textchanger = TextChanger(self.snowmix_socket) self.textchanger = TextChanger(self.snowmix_socket)
@ -99,5 +99,10 @@ class VideoController:
self.messagebox.hide() self.messagebox.hide()
return True return True
videocontroller = VideoController() if len(sys.argv) != 2:
print "Usage %s <remote ip>" % sys.argv[0]
sys.exit(-1)
videocontroller = VideoController(sys.argv[1])
GObject.threads_init()
Gtk.main() Gtk.main()

View File

@ -2,6 +2,13 @@
# Deliver mixer1 output to screen. # Deliver mixer1 output to screen.
# Taken from the original snowmix sources # Taken from the original snowmix sources
if [ -z "$1" ]; then
echo "Usage $0 <remote ip>"
exit
fi
remote_ip="$1"
tmpfile=/tmp/output2screen.tmp.$$ tmpfile=/tmp/output2screen.tmp.$$
echo 'system info' | nc 127.0.0.1 9999 >$tmpfile echo 'system info' | nc 127.0.0.1 9999 >$tmpfile
geometry=`grep 'STAT: System geometry' $tmpfile |cut -f3 -d: |cut -f2 -d' '|tr 'x' ' '` geometry=`grep 'STAT: System geometry' $tmpfile |cut -f3 -d: |cut -f2 -d' '|tr 'x' ' '`
@ -53,6 +60,6 @@ while true ; do
'video/x-raw-yuv' !\ 'video/x-raw-yuv' !\
jpegenc !\ jpegenc !\
rtpjpegpay !\ rtpjpegpay !\
udpsink host=192.168.11.90 port=9998 sync=true udpsink host=$remote_ip port=9998 sync=true
sleep 2 sleep 2
done done