Merge pull request #528 from stefansaraev/vdr-control

vdr-addon: add control plugin
This commit is contained in:
Stephan Raue 2012-04-26 13:54:37 -07:00
commit 2475443f9b
16 changed files with 327 additions and 1 deletions

View File

@ -0,0 +1,33 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# 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 2, 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 OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. config/options $1
CFLAGS="$CFLAGS -fPIC"
CXXFLAGS="$CXXFLAGS -fPIC"
LDFLAGS="$LDFLAGS -fPIC"
VDR_DIR=`basename $BUILD/vdr-[0-9]*`
cd $PKG_BUILD
PWD=`pwd`
make VDRDIR="$PWD/../$VDR_DIR" LIBDIR="." LOCALEDIR="./locale"

View File

@ -0,0 +1,37 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# 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 2, 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 OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
PKG_NAME="vdr-control"
PKG_VERSION="0.0.2a"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://ricomp.de/vdr/"
PKG_URL="http://ricomp.de/vdr/${PKG_NAME}-${PKG_VERSION}.tgz"
PKG_DEPENDS="vdr"
PKG_BUILD_DEPENDS="toolchain vdr"
PKG_PRIORITY="optional"
PKG_SECTION="multimedia"
PKG_SHORTDESC="vdr control plugin"
PKG_LONGDESC="vdr control plugin"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"

View File

@ -0,0 +1,20 @@
#!/bin/sh /usr/share/dpatch/dpatch-run
## Makefile-fPIC-fix patch
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Adds -fPIC to Makefile to fix potential FTBFS.
@DPATCH@
diff -urNad /usr/src/cvs/vdrdevel-plugin-rotor/Makefile vdrdevel-plugin-rotor/Makefile
--- /usr/src/cvs/vdrdevel-plugin-rotor/Makefile Sun May 16 15:48:12 2004
+++ vdrdevel-plugin-rotor/Makefile Sat Sep 11 00:28:18 2004
@@ -18,7 +18,7 @@
### The C++ compiler and options:
CXX ?= g++
-CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual
+CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual
### The directory environment:

View File

@ -0,0 +1,31 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_gateway.dpatch by Walter, dg9ep @ vdrportal.de
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fixes problems when ending a telnet session with ctrl-c
## DP: see: http://www.vdr-portal.de/board/thread.php?threadid=49680
@DPATCH@
diff -urNad vdr-plugin-control-0.0.2a~/gateway.c vdr-plugin-control-0.0.2a/gateway.c
--- vdr-plugin-control-0.0.2a~/gateway.c 2004-07-02 21:24:22.000000000 +0200
+++ vdr-plugin-control-0.0.2a/gateway.c 2007-04-12 22:51:16.000000000 +0200
@@ -36,7 +36,7 @@
_pTelnet (0),
_pFormatter (0)
{
- gl_CtrlGatewayCol.Add(this);
+// gl_CtrlGatewayCol.Add(this);
// if (! cKbdRemoteForControl::_pRemote)
// cKbdRemoteForControl::_pRemote = new cKbdRemoteForControl();
@@ -163,8 +163,8 @@
// UnprepareSocket();
- if (! _terminating)
- gl_CtrlGatewayCol.Del(this);
+// if (! _terminating)
+// gl_CtrlGatewayCol.Del(this);
conDSYSLOG("gateway thread ended (pid=%d)", getpid());
conLOG_GATEW("gateway thread ended (pid=%d)", getpid());

View File

@ -0,0 +1,35 @@
#!/bin/sh /usr/share/dpatch/dpatch-run
## control-1.3.18 patch - by Thomas Günther <tom@toms-cafe.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Changes for VDR >= 1.3.18.
@DPATCH@
--- control-0.0.2a/gateway.c
+++ control-0.0.2a/gateway.c
@@ -102,7 +102,12 @@
uint64 Command = 0;
uint i = 0;
+#if VDRVERSNUM >= 10318
+ cTimeMs timeout;
+ timeout.Set(100);
+#else
int t0 = time_ms();
+#endif
while (_active && i < sizeof(Command)) {
uchar ch;
@@ -131,7 +136,11 @@
// of their codes, so we'll need to wait some 100ms to see if
// there is more coming up - or whether this really is the 'ESC'
// key (if somebody knows how to clean this up, please let me know):
+#if VDRVERSNUM >= 10318
+ if (Command == 0x1B && !timeout.TimedOut())
+#else
if (Command == 0x1B && time_ms() - t0 < 100)
+#endif
continue;
if (Command) {

View File

@ -0,0 +1,73 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 93_control-0.0.2a-1.5.0.dpatch by Thomas Günther <tom@toms-cafe.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Changes for VDR >= 1.5.0 (applicable to VDR >= 1.4.5).
@DPATCH@
--- control-0.0.2a/gateway.c
+++ control-0.0.2a/gateway.c
@@ -100,7 +100,7 @@
if (_stack.poll(100)) {
- uint64 Command = 0;
+ uint64_t Command = 0;
uint i = 0;
int t0 = time_ms();
while (_active && i < sizeof(Command)) {
--- control-0.0.2a/keyboard.c
+++ control-0.0.2a/keyboard.c
@@ -18,7 +18,7 @@
struct tKbdMap {
eKbdFunc func;
- uint64 code;
+ uint64_t code;
};
@@ -117,7 +117,7 @@
-bool cCtrlKeyboard::intPut(uint64 Command, bool Repeat, bool Release) {
+bool cCtrlKeyboard::intPut(uint64_t Command, bool Repeat, bool Release) {
bool ret = cRemote::Put(Command, Repeat, Release);
conLOG_KEYB("%s cKbdRemoteForControl::intPut(0x%016LX)", ret ? "true" : "false", Command);
@@ -126,7 +126,7 @@
-bool cCtrlKeyboard::Put(uint64 Command, bool Repeat, bool Release) {
+bool cCtrlKeyboard::Put(uint64_t Command, bool Repeat, bool Release) {
if (! _pRemote)
_pRemote = new cCtrlKeyboard();
@@ -136,7 +136,7 @@
-int cCtrlKeyboard::MapCodeToFunc(uint64 Code) {
+int cCtrlKeyboard::MapCodeToFunc(uint64_t Code) {
for (const tKbdMap *p = keyboardKbdMap; p->func != kfNone; p++) {
if (p->code == Code)
--- control-0.0.2a/keyboard.h
+++ control-0.0.2a/keyboard.h
@@ -30,11 +30,11 @@
cCtrlKeyboard();
virtual ~cCtrlKeyboard();
- bool intPut(uint64 Command, bool Repeat, bool Release);
+ bool intPut(uint64_t Command, bool Repeat, bool Release);
public:
- static bool Put(uint64 Command, bool Repeat = false, bool Release = false);
- static int MapCodeToFunc(uint64 Code);
+ static bool Put(uint64_t Command, bool Repeat = false, bool Release = false);
+ static int MapCodeToFunc(uint64_t Code);
};

View File

@ -0,0 +1,28 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 94_gcc-4.4.dpatch by Tobias Grimm <etobi@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad vdr-plugin-control-0.0.2a~/formatter.c vdr-plugin-control-0.0.2a/formatter.c
--- vdr-plugin-control-0.0.2a~/formatter.c 2004-07-02 21:24:22.000000000 +0200
+++ vdr-plugin-control-0.0.2a/formatter.c 2009-11-11 22:07:56.000000000 +0100
@@ -165,7 +165,7 @@
if (Title) {
- char* t = strchr(Title, '\t');
+ const char* t = strchr(Title, '\t');
if (t) {
int size = t - Title;
@@ -300,7 +300,7 @@
for (;;) {
- char* t = strchr(text, '\t');
+ const char* t = strchr(text, '\t');
if (t) {
// Tab found - check if the tab can be used

View File

@ -0,0 +1,26 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# 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 2, 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 OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. config/options $1
cd $BUILD
mv control-${PKG_VERSION} ${PKG_NAME}-${PKG_VERSION}

View File

@ -36,6 +36,7 @@ mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config/plugins/live mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config/plugins/live
cp -PR $BUILD/vdr-live-*/live/* $ADDON_BUILD/$PKG_ADDON_ID/config/plugins/live cp -PR $BUILD/vdr-live-*/live/* $ADDON_BUILD/$PKG_ADDON_ID/config/plugins/live
cp $BUILD/rotorng-[0-9]*/examples/rotorng.conf $ADDON_BUILD/$PKG_ADDON_ID/config cp $BUILD/rotorng-[0-9]*/examples/rotorng.conf $ADDON_BUILD/$PKG_ADDON_ID/config
cp $PKG_DIR/config.plugins/remote.conf $ADDON_BUILD/$PKG_ADDON_ID/config
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/plugin mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/plugin
cp -PR $BUILD/vdr-plugin-xvdr-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin cp -PR $BUILD/vdr-plugin-xvdr-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin
@ -49,6 +50,7 @@ mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/plugin
cp -PR $BUILD/vdr-plugin-streamdev-*/client/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin cp -PR $BUILD/vdr-plugin-streamdev-*/client/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin
cp -PR $BUILD/vdr-live-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin cp -PR $BUILD/vdr-live-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin
cp -PR $BUILD/rotorng-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin cp -PR $BUILD/rotorng-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin
cp -PR $BUILD/vdr-control-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin
# ENABLED_PLUGINS="cardclient constcw sc-conax sc-cryptoworks sc-irdeto sc-nagra sc-seca sc-viaccess sc-videoguard2" # ENABLED_PLUGINS="cardclient constcw sc-conax sc-cryptoworks sc-irdeto sc-nagra sc-seca sc-viaccess sc-videoguard2"
# for plugin in $ENABLED_PLUGINS; do # for plugin in $ENABLED_PLUGINS; do

View File

@ -1,6 +1,7 @@
2.1.4 2.1.4
- added live plugin - added live plugin
- added rotorng plugin - added rotorng plugin
- added control plugin
2.1.3 2.1.3
- adjust for fontconfig 2.9.0 - adjust for fontconfig 2.9.0

View File

@ -0,0 +1,31 @@
KBD.Up 00000000001B5B41
KBD.Down 00000000001B5B42
KBD.Menu 000000000000006D
KBD.Ok 000000000000000D
KBD.Back 000000000000007F
KBD.Left 00000000001B5B44
KBD.Right 00000000001B5B43
KBD.Red 000000001B5B5B41
KBD.Green 000000001B5B5B42
KBD.Yellow 000000001B5B5B43
KBD.Blue 000000001B5B5B44
KBD.0 0000000000000030
KBD.1 0000000000000031
KBD.2 0000000000000032
KBD.3 0000000000000033
KBD.4 0000000000000034
KBD.5 0000000000000035
KBD.6 0000000000000036
KBD.7 0000000000000037
KBD.8 0000000000000038
KBD.9 0000000000000039
KBD.Info 0000000000000069
KBD.FastFwd 0000001B5B31377E
KBD.FastRew 000000001B5B5B45
KBD.Power 0000000000000070
KBD.Volume+ 0000001B5B32347E
KBD.Volume- 0000001B5B32337E
KBD.Mute 0000001B5B32317E
KBD.User7 0000001B5B31387E
KBD.User8 0000001B5B31397E
KBD.User9 0000001B5B32307E

View File

@ -10,6 +10,8 @@
<setting id="ENABLE_LIVE" value="false" /> <setting id="ENABLE_LIVE" value="false" />
<setting id="LIVE_IP" value="0.0.0.0" /> <setting id="LIVE_IP" value="0.0.0.0" />
<setting id="LIVE_PORT" value="8008" /> <setting id="LIVE_PORT" value="8008" />
<setting id="ENABLE_CONTROL" value="false" />
<setting id="CONTROL_PORT" value="2002" />
<setting id="ENABLE_ROTORNG" value="false" /> <setting id="ENABLE_ROTORNG" value="false" />
<setting id="SOFTCAM_PLUGIN" value="sc" /> <setting id="SOFTCAM_PLUGIN" value="sc" />
</settings> </settings>

View File

@ -27,7 +27,7 @@ PKG_LICENSE="GPL"
PKG_SITE="http://www.openelec.tv" PKG_SITE="http://www.openelec.tv"
PKG_URL="" PKG_URL=""
PKG_DEPENDS="" PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain attr libcap vdr vdr-plugin-xvdr vdr-iptv vdr-wirbelscan vdr-sc vdr-plugin-dvbapi vdr-dynamite vdr-plugin-streamdev vdr-live rotorng" PKG_BUILD_DEPENDS="toolchain attr libcap vdr vdr-plugin-xvdr vdr-iptv vdr-wirbelscan vdr-sc vdr-plugin-dvbapi vdr-dynamite vdr-plugin-streamdev vdr-live rotorng vdr-control"
PKG_PRIORITY="optional" PKG_PRIORITY="optional"
PKG_SECTION="service.multimedia" PKG_SECTION="service.multimedia"
PKG_SHORTDESC="vdr: A powerful DVB TV application" PKG_SHORTDESC="vdr: A powerful DVB TV application"

View File

@ -72,6 +72,9 @@ fi
if [ "$ENABLE_ROTORNG" == "true" ] ; then if [ "$ENABLE_ROTORNG" == "true" ] ; then
VDR_ARG="$VDR_ARG -P rotorng" VDR_ARG="$VDR_ARG -P rotorng"
fi fi
if [ "$ENABLE_CONTROL" == "true" ] ; then
VDR_ARG="$VDR_ARG -P 'control -p $CONTROL_PORT'"
fi
# dynamite must be LAST loaded plugin # dynamite must be LAST loaded plugin
if [ "$ENABLE_DYNAMITE" == "true" ] ; then if [ "$ENABLE_DYNAMITE" == "true" ] ; then
VDR_ARG="$VDR_ARG -P dynamite" VDR_ARG="$VDR_ARG -P dynamite"

View File

@ -13,6 +13,8 @@
<string id="1038">Enable plugin: live</string> <string id="1038">Enable plugin: live</string>
<string id="1039">live: listen on ip</string> <string id="1039">live: listen on ip</string>
<string id="1040">live: listen on port</string> <string id="1040">live: listen on port</string>
<string id="1042">Enable plugin: control</string>
<string id="1043">control: listen on port</string>
<string id="1041">Enable plugin: rotorng</string> <string id="1041">Enable plugin: rotorng</string>
<string id="1035">Enable plugin: dynamite</string> <string id="1035">Enable plugin: dynamite</string>
<string id="1036">Enable softcam</string> <string id="1036">Enable softcam</string>

View File

@ -16,6 +16,8 @@
<setting id="ENABLE_LIVE" type="bool" label="1038" default="false" /> <setting id="ENABLE_LIVE" type="bool" label="1038" default="false" />
<setting id="LIVE_IP" type="ipaddress" label="1039" values="" enable="!eq(-1,false)" default="0.0.0.0"/> <setting id="LIVE_IP" type="ipaddress" label="1039" values="" enable="!eq(-1,false)" default="0.0.0.0"/>
<setting id="LIVE_PORT" type="number" label="1040" values="" enable="!eq(-2,false)" default="8008"/> <setting id="LIVE_PORT" type="number" label="1040" values="" enable="!eq(-2,false)" default="8008"/>
<setting id="ENABLE_CONTROL" type="bool" label="1042" default="false" />
<setting id="CONTROL_PORT" type="number" label="1043" values="" enable="!eq(-1,false)" default="2002"/>
<setting id="ENABLE_ROTORNG" type="bool" label="1041" default="false" /> <setting id="ENABLE_ROTORNG" type="bool" label="1041" default="false" />
<setting id="ENABLE_DYNAMITE" type="bool" label="1035" default="true" /> <setting id="ENABLE_DYNAMITE" type="bool" label="1035" default="true" />
<setting type="sep" /> <setting type="sep" />