summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2012-05-09 13:43:48 (GMT)
committer Jaromil <jaromil@dyne.org>2012-05-09 13:43:48 (GMT)
commitd4431aaa50d4329602a7c82ed8a150a6ba0c15d0 (patch)
tree58c092e50aeeb2df1dd99aef3a6ae3d405b5d8ee
parent97d7c05c1aae0f99dacc7a8e45d0f3acd1483951 (diff)
documentation update and build cleanup
-rw-r--r--AUTHORS26
-rw-r--r--ChangeLog10
-rw-r--r--README114
-rw-r--r--TODO6
-rw-r--r--configure.ac2
-rwxr-xr-xscripts/listen-sync.sh89
-rwxr-xr-xscripts/offer-sync.sh105
-rwxr-xr-xscripts/upnp-cmd296
-rwxr-xr-xscripts/upnp.sh100
-rwxr-xr-xscripts/watchdog.sh51
-rw-r--r--src/0mq/Makefile.am2
-rw-r--r--src/include/Makefile.am4
-rw-r--r--src/include/impl/Makefile.am13
-rw-r--r--src/include/pgm/Makefile.am7
-rw-r--r--src/include/pgm/ip/Makefile.am2
-rw-r--r--src/pgm/Makefile.am2
-rw-r--r--src/uuid/Makefile.am4
17 files changed, 154 insertions, 679 deletions
diff --git a/AUTHORS b/AUTHORS
index b1c4b89..390cf43 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,9 +1,27 @@
-The author of HDSync is Denis Roio <jaromil@nimk.nl>
+HDSync is copyright (C) 2010-2012 by Denis Roio <jaromil@dyne.org>
-HDSync code includes GNU netcat by Giovanni Giacobbi
+HDSync source includes code by:
-Stability fixes were contributed by Michael van Rosmalen
+ iMatix Corporation (ZeroMQ library)
+ Miru Limited (PGM library)
+ Theodore Ts'o (UUID library)
+
+Testing and fixes were contributed by:
+ Nicholas Lue, Michael van Rosmalen
This software is packaged to run on B-rad's WDLXTV firmware and
-benefits by the research and development of the wdlxtv.com community.
+benefits by the research and development of the WDLXTV.com community.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>
diff --git a/ChangeLog b/ChangeLog
index b81e297..52c19ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,17 @@
+9 May 2012 - 1.0 "Montevideo"
+ Stable run, no freeze
+ Better sync precision
+ Complete rewrite in C/C++
+ Single ELF binary architecture
+ ZeroMQ based network stack
+ Network messaging in TCP and PGM
+
13 December 2011 - 0.6.1 "Dried sunflower"
Watchdog to avoid random freezes
Better of operations logging
Manual option for network configuration
Sleep value now in micro-seconds (1/1000000)
-
+
28 October 2011 - 0.6 "Sunflower"
Improved stability
Fixes to loop videos
diff --git a/README b/README
index 4e1925b..cbb145c 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
-
-
-: from the tradition of Montevideo / Time Based Arts, NIMk presents:
+: From the tradition of Montevideo / Time Based Arts
+: and for the very last time as Netherlands Media Art Institute
+: we are proudly presenting you:
:
: ,, ,,
: `7MM `7MM
@@ -11,23 +11,39 @@
: MM MM `Mb MM L. I8 VVV MM MM YM. ,
: .JMML JMML.`Wbmd"MML. M9mmmP' ,V .JMML JMML.YMbmd'
: ,V
-: OOb' ver. 0.6.1
+: OOb' ver. 1.0
:
: A network based sync-starter for multi-channel HD Video
-: by Denis Roio aka Jaromil
-:
-: http://syncstarter.org
+: Written by Denis Roio aka Jaromil
+: Website: http://syncstarter.org
-
-The digital video syncstarter software is developed by the
-Montevideo/NIMk Artlab to provide synced playback of multiple high
-definition videos on multiple screens.
+The digital video syncstarter software was developed through the past
+years by the Montevideo/NIMk Artlab to provide synced playback of
+multiple high definition videos on multiple screens.
In the video art field there are many artworks requiring the real-time
synced playback of audio/video: HDSync provides such a functionality
for HD decoders, to sync HD video playback on multiple devices.
-More information on our R&D deparment: http://nimk.nl/eng/research
+As a consequence of cultural funding cuts in the Netherlands, this
+development program is being shut down and the whole institute will be
+closing by the end of the year, after more than 30 years of activity.
+
+Nevertheless we hope this development will survive as free and open
+source software, hoping it can benefit the video art community at
+large, keeping the Montevideo / Time Based Arts tradition alive.
+
+ More about HDSync: http://syncstarter.org/hdsync
+
+ Browse HDSync source code: http://code.dyne.org/hdsync
+
+ More syncstarter software: http://syncstarter.org/software
+
+ Hire our artisanal services: http://syncstarter.org/service
+
+ More info about the Dyne.org software foundry: http://dyne.org
+
+ Donations welcome (and much needed) on http://dyne.org/donate
** Usage and compatibility
@@ -35,13 +51,57 @@ HDSync only works on a specific hardware configuration: WD HD Live
players running B-Rad's WDLXTV firmware, something artists themselves
can afford for approx 100EUR on the consumer market.
-** Development in progress
+Interesting portability horizons at the moment: AppleTV and Boxee
+devices, as well new WDTV models. But we lack the hardware so if you
+have extra please consider a donation!
+
+Of course HDSync can be compiled for x86 and used to activate
+computers running a UPNP-AV daemon that controls video playback.
+Development could as well go into the direction of implementing a PC
+based syncstarter, but this also depends from the support this project
+will receive in future.
-This release can synchronise the playback of multiple channels
-(virtually unlimited) on the same local network: hdsync can
-automatically handshake and start playing in sync, restoring the sync
-at every loop. Empirical tests show a current error margin of 1 to 3
-frames, with further development we aim to achieve frame exact sync.
+At the current stage of development hdsync is consisting only of
+portable C/C++ code that can be easily cross-compiled to ARM, MIPS and
+more embedded platforms. It is rather simple to port it to more
+set-top boxes, but we miss the hardware and the time in order to do
+it.
+
+If you are interested to port this software on an hardware platform
+you possess, please contact us! We can arrange a deal, borrow your
+hardware and settle a development plan. This way you, your company or
+your institution might be able to save significant amounts of money by
+adapting the syncstarter software to an existing infrastructure rather
+than buying new hardware.
+
+** News for this release
+
+This release can synchronise the playback of multiple channels,
+virtually unlimited, so far the known record is set to 37.
+
+This release consists of a full rewrite of the 0.6 version of HDSync
+in C language, eliminating most of the shell scripted interaction and
+condensing operations into a single process.
+
+The result of this rewrite is more stability (the 4 hours freeze is
+now solved!), visibly lower latency of operations, more control over
+network handshake and synchronization - plus we've made the HDSync
+software easy to port on more platforms.
+
+Empirical tests show way better synchronization (close to frame
+precision) and very low margin of error in re-syncing after loops
+(still some de-sync occurs from time to time when using short clips).
+
+Please note that now it is necessary to add 5 seconds of black in
+front of the synced videos, in order to avoid an irregular blink at
+the start of every loop.
+
+
+with exception of certain looped that seem to go out of sync at random
+times, an issue being investigated, but not occurring.
+
+ a current error margin of 1 to 3 frames, with further
+development we aim to achieve frame exact sync.
** Documentation
@@ -51,12 +111,12 @@ More documentation is included inside the doc/ directory
** Building from source
-In order to compile HDSync you need to use a MIPSEL toolchain (like
-the one provided by Emdebian) and use it to compile this software:
-./configure --host=mipsel-linux-gnu is the correct target
+In order to compile HDSync for WDTV you need to use a MIPSEL toolchain
+(like the one provided by Emdebian) and use it to compile this
+software: ./configure --host=mipsel-linux-gnu is the correct target
However, ready to use binaries (hdsync.app.bin) are provided on
-http://ftp.dyne.org/hdsync
+http://files.dyne.org/hdsync
** Support and warranty
@@ -65,8 +125,12 @@ allow collaboration with developers interested: we release HDSync as
free and open source (GNU GPL v3) in the hope it will be useful, but
WITHOUT ANY WARRANTY.
-In case you need assistance to setup your own HD sync-starter, you can
-contact us and ask a quote, see details on
-http://syncstarter.org/service
+Voluntary support is provided by the community of users, please join
+our free mailinglist and let us know your progress and projects
+http://mailinglists.dyne.org/cgi-bin/mailman/listinfo/syncstarter
+archived on http://lists.dyne.org/lurker/list/syncstarter.en.html
+In case you need assistance to setup your own HD sync-starter, you can
+contact us and ask a quote, details on http://syncstarter.org/service
+** So Long, and Thanks For All the Fish!
diff --git a/TODO b/TODO
index 01f0775..84f51dd 100644
--- a/TODO
+++ b/TODO
@@ -2,9 +2,9 @@
Some of the next steps
+ Measure network latency and report it, adjust sync clocks
+ we can do this using a stopclock function
+
+
-+ Reach frame precise sync, idea:
- serve the video file through a pipe from a C program
-+ Rewrite all network handshake using 0mq to lower latency
diff --git a/configure.ac b/configure.ac
index 05a48c8..c29ef27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ dnl ==============================================================
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
-AC_INIT([HDSync],[0.6.1],[jaromil@nimk.nl],[hdsync])
+AC_INIT([HDSync],[1.0],[jaromil@dyne.org],[hdsync])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
diff --git a/scripts/listen-sync.sh b/scripts/listen-sync.sh
deleted file mode 100755
index 046d370..0000000
--- a/scripts/listen-sync.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2010-2011 Denis Roio <jaromil@nimk.nl>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-PATH=/usr/bin:/bin:/usr/sbin:/sbin
-
-. $APPROOT/bin/utils-sync.sh
-
-
-# launch background listener for acks
-rm -f /tmp/hdsync.reply
-touch /tmp/hdsync.reply
-(while [ -r /tmp/hdsync.reply ]; do
- answer=`echo | $NC -c -u -l -p 3333`;
- echo $answer >> /tmp/hdsync.reply
- done) &
-
-# loop continuously
-while [ true ]; do
-
- sleep 10
-
- # check the state of the video
- state=`$AV -s localhost -p $UPNPPORT get 2>&1| awk '/^TInfo:/ {print $2}'`
- echo "`date +%T` state (avremote) is $state"
-
- if [ "$state" == "NO_MEDIA_PRESENT" ]; then
-
- # will get ready for sync
- prepare_play >> /tmp/hdsync.log
-
- elif [ "$state" == "STOPPED" ]; then
-
- # will get ready for sync again
- prepare_play >> /tmp/hdsync.log
-
- elif [ "$state" == "PAUSED_PLAYBACK" ]; then
- # will sync start
-
- rm -f /tmp/hdsync.reply
- touch /tmp/hdsync.reply
-
- echo "`date +%T` listening for offers on $IP"
-
- offer="`echo | $NC -c -u -l -p 3332`"
-
- echo "`date +%T` offered sync by $offer"
-
- # repeat udp replies to offer until ack
- echo "`date +%T` replying with our ip until ack"
- ack=""
- while [ "$ack" = "" ]; do
- sleep 1
- echo "$IP" | $NC -c -u $offer 3331
- echo -n "."
- ack=`cat /tmp/hdsync.reply`
- done
-
- echo "`date +%T` ack received, we are channel $ack"
-
-
- echo "`date +%T` ready: awaiting syncstarter signal"
-
-
- # exit after connection (-e true)
- $NC -c -u -l -p 3336 -e true
-
- if [ $HDSYNC_SLEEP ]; then
- usleep $HDSYNC_SLEEP
- fi
-
- # "press play on tape"
- $SYNC -s localhost -p $UPNPPORT start
- echo "`date +%T` sync playback started"
- fi
-done
diff --git a/scripts/offer-sync.sh b/scripts/offer-sync.sh
deleted file mode 100755
index dfc23b4..0000000
--- a/scripts/offer-sync.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2010-2011 Denis Roio <jaromil@nimk.nl>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-PATH=/usr/bin:/bin:/usr/sbin:/sbin
-
-. $APPROOT/bin/utils-sync.sh
-
-# launch background listener
-rm -f /tmp/hdsync.reply
-touch /tmp/hdsync.reply
-(while [ true ]; do
- answer=`echo | $NC -c -u -l -p 3331 | awk '{print $1}'`;
- echo $answer >> /tmp/hdsync.reply
- echo $answer | $NC -c -u $answer 3333
- echo "`date +%T` ack sent to $answer"
- done) &
-
-# loop continuously
-while [ true ]; do
-
- sleep 10
-
- # check the state of the video
- state=`$AV -s localhost -p $UPNPPORT get 2>&1| awk '/^TInfo:/ {print $2}'`
- echo "`date +%T` state (avremote) is $state"
-
- if [ "$state" == "NO_MEDIA_PRESENT" ]; then
-
- # will get ready for sync
- prepare_play >> /tmp/hdsync.log
-
- elif [ "$state" == "STOPPED" ]; then
-
- # will get ready for sync again
- prepare_play >> /tmp/hdsync.log
-
- elif [ "$state" == "PAUSED_PLAYBACK" ]; then
- # will sync start
-
- rm -f /tmp/hdsync.reply
- touch /tmp/hdsync.reply
-
- echo "`date +%T` broadcasting offer signals from $IP"
- # we do broadcast only on class C
- # must always make sure also listener expects on class C
- bcast=`echo $IP | awk 'BEGIN { FS="." } {print $1 "." $2 "." $3 }'`.255
- echo "to netmask $bcast"
-
- # send broadcast signals until somebody listens
- listeners=0
- expected=`expr $TOTAL_CHANNELS - 1`
- while [ $listeners -lt $expected ]; do
- echo -n "`date +%X` "
- $BC $bcast 3332 $IP
- listeners=`cat /tmp/hdsync.reply | sort | uniq | wc -w`
- sleep 1
- done
-
-# echo "harvesting replies"
-# cat /tmp/hdsync.reply | sort | uniq > /tmp/hdsync.listeners
-#
-# echo "sending acks"
-# c=1
-# for l in `cat /tmp/hdsync.listeners`; do
-# echo "$c: $l"
-# echo "$c" | $NC -c -u $l 3333
-# done
-
-
- echo "`date +%T` waiting for other players to get ready..."
- sync
-
- # sync start in 2 seconds!
- (sleep 2
- $BC $bcast 3336 s >> /dev/null) &
-
- # exit after connection (-e true)
- $NC -c -u -l -p 3336 -e true
-
- if [ $HDSYNC_SLEEP ]; then
- usleep $HDSYNC_SLEEP
- fi
-
- # "press play on tape"
- $SYNC -s localhost -p $UPNPPORT start
- echo "`date +%T` sync playback started"
- fi
-
-# $BC $bcast 3336 s >> /dev/null # keep broadcasting in case someone didnt get the message
-
-done
diff --git a/scripts/upnp-cmd b/scripts/upnp-cmd
deleted file mode 100755
index 80dce5e..0000000
--- a/scripts/upnp-cmd
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/usr/bin/php-cgi -q
-<?php
-
-# UPnP Command Line Tool for WDTV Live
-# Version: 0.1
-# Author: Zoster
-
-
-#### Command Line Functions ####
-
-if ( $argc < 2 ) {
- die (_stringHelp());
-}
-
-$actionName = $argv[1];
-
-if ( function_exists('_action' . $actionName)) {
- switch ($argc) {
- case 2:
- call_user_func('_action' . $actionName);
- break;
- case 3:
- call_user_func('_action' . $actionName, $argv[2]);
- break;
- case 4:
- call_user_func('_action' . $actionName, $argv[2], $argv[3]);
- break;
- default:
- call_user_func('_action' . $actionName);
- break;
- }
-} else {
- die (_stringHelp());
-}
-
-function _stringHelp() {
- $hlp = 'UPnP command line tool for WDTV Live v0.1' . "\n";
- $hlp .= 'Usage: upnp-cmd action argument' . "\n";
- $hlp .= '' . "\n";
- $hlp .= 'Available AVTransport actions:' . "\n";
- $hlp .= '' . "\n";
- $hlp .= 'GetCurrentTransportActions' . "\n";
- $hlp .= 'GetDeviceCapabilities' . "\n";
- $hlp .= 'GetMediaInfo' . "\n";
- $hlp .= 'GetPositionInfo' . "\n";
- $hlp .= 'GetTransportInfo' . "\n";
- $hlp .= 'GetTransportSettings' . "\n";
- $hlp .= 'Next' . "\n";
- $hlp .= 'Pause' . "\n";
- $hlp .= 'Play' . "\n";
- $hlp .= 'Previous' . "\n";
- $hlp .= 'Seek <SeekMode> <SeekTarget> (allowed SeekMode: "X_DLNA_REL_BYTE", "REL_TIME", "TRACK_NR")' . "\n";
- $hlp .= 'SetAVTransportURI <URI> <URIMetaData> (allowed URI: "http://server/file", "file:///folder/file"' . "\n";
- $hlp .= 'SetPlayMode <NewPlayMode> (allowed NewPlayMode = "NORMAL", "REPEAT_ONE", "REPEAT_ALL", "RANDOM")' . "\n";
- $hlp .= 'Stop' . "\n";
- $hlp .= 'X_DLNA_GetBytePositionInfo' . "\n";
- $hlp .= '' . "\n";
- $hlp .= 'Available RenderingControl actions:' . "\n";
- $hlp .= '' . "\n";
- $hlp .= 'GetMute' . "\n";
- $hlp .= 'GetVolume' . "\n";
- $hlp .= 'SetMute <DesiredMute> (allowed DesiredMute = 0 or 1)' . "\n";
- $hlp .= 'SetVolume <DesiredVolume> (allowed DesiredVolume = 1 to 100)' . "\n";
- return $hlp;
-}
-
-
-#### General UPnP Functions ####
-
-#### AVTransport Actions ####
-
-function _actionGetCurrentTransportActions() {
- $action = 'GetCurrentTransportActions';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionGetDeviceCapabilities() {
- $action = 'GetDeviceCapabilities';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionGetMediaInfo() {
- $action = 'GetMediaInfo';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionGetPositionInfo() {
- $action = 'GetPositionInfo';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionGetTransportInfo() {
- $action = 'GetTransportInfo';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionGetTransportSettings() {
- $action = 'GetTransportSettings';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionNext() {
- $action = 'Next';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionPause() {
- $action = 'Pause';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionPlay($prmSpeed = 1) {
- $action = 'Play';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args .= '<Speed>' . $prmSpeed . '</Speed>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionPrevious() {
- $action = 'Previous';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionSeek($prmSeekMode, $prmSeekTarget) {
- # SeekModes: "X_DLNA_REL_BYTE" = Bytes Integer, "REL_TIME" = hh:mm:ss, "TRACK_NR" = Track Integer
- $action = 'Seek';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args = '<SeekMode>' . $prmSeekMode . '</SeekMode>' . "\r\n";
- $args = '<SeekTarget>' . $prmSeekTarget . '</SeekTarget>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionSetAVTransportURI($prmURI = '', $prmMetaData = '') {
- $action = 'SetAVTransportURI';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args .= '<CurrentURI>' . $prmURI . '</CurrentURI>' . "\r\n";
- #$args .= '<CurrentURIMetaData />'. "\r\n";
- $args .= '<CurrentURIMetaData>' . htmlentities($prmMetaData) . '</CurrentURIMetaData>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionSetPlayMode($prmNewPlayMode) {
- #allowed NewPlayMode = "NORMAL", "REPEAT_ONE", "REPEAT_ALL", "RANDOM"
- $action = 'SetPlayMode';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args .= '<NewPlayMode>' . $prmNewPlayMode . '</NewPlayMode>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionStop() {
- $action = 'Stop';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-function _actionX_DLNA_GetBytePositionInfo($prmTrackSize) {
- $action = 'X_DLNA_GetBytePositionInfo';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args = '<TrackSize>' . $prmTrackSize . '</TrackSize>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'AVTransport');
-}
-
-#### END AVTransport Actions ####
-
-
-#### RenderingControl Actions ####
-
-function _actionGetMute($prmChannel = 'Master') {
- # allowed Channel = "Master", "LF", "RF"
- $action = 'GetMute';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args .= '<Channel>' . $prmChannel . '</Channel>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'RenderingControl');
-}
-
-function _actionGetVolume($prmChannel = 'Master') {
- $action = 'GetVolume';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args .= '<Channel>' . $prmChannel . '</Channel>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'RenderingControl');
-}
-
-function _actionSetMute($prmDesiredMute = 1, $prmChannel = 'Master' ) {
- # allowed DesiredMute = 0 or 1
- $action = 'SetMute';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args .= '<Channel>' . $prmChannel . '</Channel>' . "\r\n";
- $args .= '<DesiredMute>' . $prmDesiredMute . '</DesiredMute>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'RenderingControl');
-}
-
-function _actionSetVolume($prmDesiredVolume = 1, $prmChannel = 'Master' ) {
- # allowed DesiredVolume = 1 to 100
- $action = 'SetVolume';
- $args = '<InstanceID>0</InstanceID>' . "\r\n";
- $args .= '<Channel>' . $prmChannel . '</Channel>' . "\r\n";
- $args .= '<DesiredVolume>' . $prmDesiredVolume . '</DesiredVolume>' . "\r\n";
- $result = _sendUPnPCommand($action, $args, 'RenderingControl');
-}
-
-#### END RenderingControl Actions ####
-
-
-function _sendUPnPCommand($prmAction, $prmArguments, $prmService) {
-
- $wdtvPort = _getPort();
- $wdtvIP = _getIP();
-
- $soap ='<?xml version="1.0" encoding="utf-8"?>' . "\r\n";
- $soap .='<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' . "\r\n";
- $soap .=' <s:Body>' . "\r\n";
- $soap .=' <u:' . $prmAction . ' xmlns:u="urn:schemas-upnp-org:service:' . $prmService . ':1">' . "\r\n";
- $soap .= $prmArguments;
- $soap .=' </u:' . $prmAction . '>' . "\r\n";
- $soap .=' </s:Body>' . "\r\n";
- $soap .='</s:Envelope>' . "\r\n";
-
- $hdr ='POST /MediaRenderer_' . $prmService . '/control HTTP/1.0' . "\r\n";
- $hdr .='SOAPACTION: "urn:schemas-upnp-org:service:' . $prmService . ':1#' . $prmAction . '"' . "\r\n";
- $hdr .='CONTENT-TYPE: text/xml ; charset="utf-8"' . "\r\n";
- $hdr .='HOST: 127.0.0.1:' . $wdtvPort . "\r\n";
- $hdr .='Connection: close' . "\r\n";
- $hdr .='Content-Length: ' . strlen($soap) . "\r\n";
- $hdr .='' . "\r\n";
-
- $msg = $hdr . $soap;
-
- $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
- socket_bind($sock, $wdtvIP);
- socket_connect($sock, '127.0.0.1', $wdtvPort);
- socket_write($sock, $msg);
- $reply = "";
- do {
- $recv = "";
- $recv = socket_read($sock, '1400');
- if($recv != "") {
- $reply .= $recv;
- }
- } while($recv != "");
- socket_close($sock);
- $tmpArr = explode("\r\n\r\n", $reply, 2);
- $result = _parseUPnPResponse($tmpArr[1]);
- #print_r($result);
- _printArray($result);
-}
-
-function _parseUPnPResponse($prmResponseXML) {
- $doc = new DOMDocument();
- $doc->preserveWhiteSpace = false;
- $doc->formatOutput = true;
- $doc->loadXML($prmResponseXML);
- $respItems = $doc->getElementsByTagName('Body')->item(0)->childNodes->item(0)->childNodes;
- $arrResponse = array();
- foreach ($respItems as $item) {
- $arrResponse[$item->nodeName] = $item->nodeValue;
- }
- return $arrResponse;
-}
-
-function _printArray($prmArray) {
- foreach($prmArray as $key => $value) {
- echo '[' . $key . '] => ' . $value . "\n";
- }
-}
-
-function _getPort() {
- # get the listening port of DMARender
- $result = exec('lsof -a -i4 -sTCP:LISTEN -c DMARender -F n');
- if ( preg_match('/n\*:(\d*)$/', $result, $matches) ) {
- return (int)$matches[1];
- } else {
- return null;
- }
-} # end function
-
-function _getIP() {
- # get our LAN IP
- $result = exec('ipaddr show dev eth0 | grep inet');
- if ( preg_match('/inet ([^\/]*)\//', $result, $matches) ) {
- return $matches[1];
- } else {
- return null;
- }
-} # end function
-
-?>
-
diff --git a/scripts/upnp.sh b/scripts/upnp.sh
deleted file mode 100755
index f4317bc..0000000
--- a/scripts/upnp.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-# small upnp player in shell script, for WDLXTV
-# this is supposed to work faster than the upnp-cmd
-# needed to lower latency of operation in hdsync.app.bin
-
-# (C) 2011 by Jaromil - GNU GPL v3
-
-if [ -z $1 ]; then
- echo "usage: $0 [command]"
- echo "commands: load filename, play, stop, pause"
- exit 0
-fi
-
-HOST=127.0.0.1
-
-# detect UPNP port
-UPNPPORT="`lsof -a -i4 -sTCP:LISTEN -c DMARender -F n | awk -v FS=':' '/^n/ {print $2}'`"
-if ! [ $UPNPPORT ]; then
- echo "error: no UPNP daemon found."
- exit 1
-else
- echo "UPNP daemon found listening on port $UPNPPORT"
-fi
-PORT=$UPNPPORT
-
-
-send_message() {
- if [ -z $1 ]; then
- echo "error: send_message"
- return
- fi
- action="$1"
- message="$2"
- smsg="<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:$action xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID>$message</u:$action></s:Body></s:Envelope>"
- wget -O - -q --post-data="$smsg" \
- $HOST:$PORT/MediaRenderer_AVTransport/control \
- --header="SOAPACTION: \"urn:schemas-upnp-org:service:AVTransport:1#$action\"" \
- --bind-address=127.0.0.1
- echo
-}
-
-# make cmd case insensitive
-cmd="`echo $1 | tr '[:upper:]' '[:lower:]'`"
-
-case $cmd in
-
- load)
- file="$2"
- # if ! [ -r "$file" ]; then
- # echo "file not found: $file"
- # echo "operation aborted."; exit 1
- # fi
- uri="file://$file"
- dirName="`dirname "$file"`"
- fileName="`basename "$file"`"
- fileSize="`stat -c%s "$file"`"
-
- meta="<DIDL-Lite xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\"><item id=\"2$file\" parentID=\"2$parentDir\" restricted=\"0\"><dc:title>$fileName</dc:title><dc:date></dc:date><upnp:class>object.item.imageItem</upnp:class><dc:creator></dc:creator><upnp:genre></upnp:genre><upnp:artist></upnp:artist><upnp:album></upnp:album><res protocolInfo=\"file-get:*:*:*:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000\" protection=\"\" tokenType=\"0\" bitrate=\"0\" duration=\"\" size=\"$fileSize\" colorDepth=\"0\" ifoFileURI=\"\" resolution=\"\">$uri</res></item></DIDL-Lite>"
-
- msg="<CurrentURI>$uri</CurrentURI><CurrentURIMetaData>$meta</CurrentURIMetaData>"
-
-# send_message SetAVTransportURI "$msg"
-
- upnp-cmd SetAVTransportURI "$uri" "$meta"
- # allowed NewPlayMode = "NORMAL", "REPEAT_ONE", "REPEAT_ALL", "RANDOM"
- upnp-cmd SetPlayMode REPEAT_ONE
- ;;
-
- mode)
- mode="$2"
- msg="<NewPlayMode>$mode</NewPlayMode>"
- send_message SetPlayMode "$msg"
- ;;
-
- play)
-# msg="<Speed>1</Speed>"
-# send_message Play "$msg"
-
- upnp-cmd Play
- ;;
-
- stop)
- upnp-cmd Stop
- ;;
-
- pause)
-# send_message Pause ""
- upnp-cmd Pause
- ;;
-
- *)
- echo "unrecognized command: $cmd"
- exit 1
- ;;
-
-esac
-
-#echo "command $cmd executed succesfully"
-
diff --git a/scripts/watchdog.sh b/scripts/watchdog.sh
deleted file mode 100755
index df8a07b..0000000
--- a/scripts/watchdog.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2011 Michael van Rosmalen <mvanrosmalen@zya.nl>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-PATH=/usr/bin:/bin:/usr/sbin:/sbin
-
-. $APPROOT/bin/utils-sync.sh
-. $USBROOT/hdsync.conf
-
-watchdogtimer=`expr $WATCHDOGTIMER + 30` #timeout in seconds, movielength + some
-timer=0
-
-echo "`date +%T` watchdog started, timeout is $watchdogtimer"
-
-# loop continuously
-while [ true ]; do
-
- sleep 5
- timer=`expr $timer + 5`
-
- # check the state of the video
- state=`$AV -s localhost -p $UPNPPORT get 2>&1| awk '/^TInfo:/ {print $2}'`
-
- if [ "$state" != $laststate ]; then
- echo "`date +%T` watchdog timer reset after state change to $state"
- timer=0 # reset timer
- fi
-
- if [ $timer -gt $watchdogtimer ]; then
- echo "`date +%T` watchdog timer exceeded, trying to resolve"
- $AV -s localhost -p $UPNPPORT stop
- sleep 5
- $AV -s localhost -p $UPNPPORT stop
- timer=`expr $watchdogtimer - 60`
- fi
-laststate="$state"
-
-done
diff --git a/src/0mq/Makefile.am b/src/0mq/Makefile.am
index e1a0f00..1b8b5fa 100644
--- a/src/0mq/Makefile.am
+++ b/src/0mq/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/include
+INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/src/include
noinst_LTLIBRARIES = libzmq.la
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
new file mode 100644
index 0000000..3df0ff2
--- /dev/null
+++ b/src/include/Makefile.am
@@ -0,0 +1,4 @@
+SUBDIRS = impl pgm
+
+noinst_HEADERS = zmq.h zmq_utils.h
+
diff --git a/src/include/impl/Makefile.am b/src/include/impl/Makefile.am
new file mode 100644
index 0000000..9f35014
--- /dev/null
+++ b/src/include/impl/Makefile.am
@@ -0,0 +1,13 @@
+
+noinst_HEADERS = checksum.h engine.h errno.h features.h fixed.h \
+ framework.h galois.h getifaddrs.h getnetbyname.h \
+ getnodeaddr.h get_nprocs.h getprotobyname.h \
+ hashtable.h histogram.h i18n.h indextoaddr.h \
+ indextoname.h inet_network.h ip.h list.h math.h md5.h \
+ mem.h messages.h nametoindex.h net.h notify.h \
+ packet_parse.h packet_test.h pgmMIB_columns.h \
+ pgmMIB_enums.h pgmMIB.h processor.h queue.h rand.h \
+ rate_control.h receiver.h reed_solomon.h rwspinlock.h \
+ rxw.h security.h slist.h sn.h sockaddr.h socket.h \
+ source.h sqn_list.h string.h thread.h ticket.h time.h \
+ timer.h tsi.h txw.h wsastrerror.h
diff --git a/src/include/pgm/Makefile.am b/src/include/pgm/Makefile.am
new file mode 100644
index 0000000..5a4b7c3
--- /dev/null
+++ b/src/include/pgm/Makefile.am
@@ -0,0 +1,7 @@
+SUBDIRS = ip
+
+NOINST_HEADERS = atomic.h backtrace.h engine.h error.h gsi.h http.h \
+ if.h in.h list.h log.h macros.h mem.h messages.h \
+ msgv.h packet.h pgm.h pgm.hh pgm_socket.hh retypes.h \
+ signal.h skbuff.h snmp.h socket.h time.h tsi.h types.h \
+ untypes.h version.h winint.h wininttypes.h zinttypes.h
diff --git a/src/include/pgm/ip/Makefile.am b/src/include/pgm/ip/Makefile.am
new file mode 100644
index 0000000..60d7478
--- /dev/null
+++ b/src/include/pgm/ip/Makefile.am
@@ -0,0 +1,2 @@
+
+NOINST_HEADERS = pgm_endpoint.hh pgm.hh
diff --git a/src/pgm/Makefile.am b/src/pgm/Makefile.am
index 9c957ad..2796eb4 100644
--- a/src/pgm/Makefile.am
+++ b/src/pgm/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/include
+INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/src/include
AM_CFLAGS = -std=gnu99 -D_REENTRANT -D_GNU_SOURCE -D__need_IOV_MAX \
-DCONFIG_16BIT_CHECKSUM -DCONFIG_HAVE_PROC -DCONFIG_HAVE_BACKTRACE \
diff --git a/src/uuid/Makefile.am b/src/uuid/Makefile.am
index b1e9cd3..e77ddf5 100644
--- a/src/uuid/Makefile.am
+++ b/src/uuid/Makefile.am
@@ -1,5 +1,5 @@
-INCLUDES = -I$(top_srcdir)/src
+INCLUDES = -I$(top_builddir)/src
AM_CFLAGS = $(CFLAGS)
@@ -19,4 +19,4 @@ libuuid_la_SOURCES = \
unparse.c \
uuid_time.c
-noinst_HEADERS = uuidd.h uuidP.h
+noinst_HEADERS = uuidd.h uuid.h uuidP.h