[vdr-plugin-vompserver] 01/03: Imported Upstream version 0.4.1

Tobias Grimm tiber-guest at moszumanska.debian.org
Mon Feb 9 22:57:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch master
in repository vdr-plugin-vompserver.

commit e6be9cfec3b6d4cee082a03bc155730b28a7dd18
Author: etobi <git at e-tobi.net>
Date:   Mon Feb 9 23:53:17 2015 +0100

    Imported Upstream version 0.4.1
---
 Makefile           | 43 +++++++------------------------------------
 bootpd.c           |  2 ++
 tftpclient.c       |  2 ++
 vompclient.h       |  6 +++---
 vompclientrrproc.c | 33 +++++++++++++++++++++++++++++++--
 vompclientrrproc.h |  3 ++-
 vompserver.c       |  2 +-
 7 files changed, 48 insertions(+), 43 deletions(-)

diff --git a/Makefile b/Makefile
index cb43aee..9c99e28 100644
--- a/Makefile
+++ b/Makefile
@@ -23,44 +23,23 @@ PLGCFG = $(call PKGCFG,plgcfg)
 #
 TMPDIR ?= /tmp
 
-# VOMP INSERT for older VDRs
-ifeq ($(VDRDIR),)
-  VDRDIR = ../../..
-endif
-ifeq ($(LIBDIR),)
-  LIBDIR = ../../lib
-endif
-
-APIVERSNUM = $(shell grep 'define APIVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
-DOOLDINSTALL =
-ifeq ($(shell test $(APIVERSNUM) -le 10734; echo $$?),0) # thanks streamdev
-DOOLDINSTALL = yes
-endif
-# end insert
-
 ### The compiler options:
 
 export CFLAGS   = $(call PKGCFG,cflags)
 export CXXFLAGS = $(call PKGCFG,cxxflags)
 
-# VOMP INSERT
-CFLAGS += -fPIC
-CXXFLAGS += -fPIC
-# end insert
-
 ### The version number of VDR's plugin API:
 
 APIVERSION = $(call PKGCFG,apiversion)
-# VOMP INSERT for older VDRs
-ifeq ($(APIVERSION),)
-  APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
-endif
-# end VOMP INSERT
 
 ### Allow user defined options to overwrite defaults:
 
 -include $(PLGCFG)
 
+# VOMP-INSERT
+-include .standalone
+# END-VOMP-INSERT
+
 ### The name of the distribution archive:
 
 ARCHIVE = $(PLUGIN)-$(VERSION)
@@ -77,14 +56,9 @@ INCLUDES +=
 DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
 
 # VOMP-INSERT
-INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
-
-DEFINES += -D_GNU_SOURCE -DVOMPSERVER
-DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-
+DEFINES += -DVOMPSERVER
 # END-VOMP-INSERT
 
-
 ### The object files (add further files here):
 
 OBJS = $(PLUGIN).o
@@ -156,14 +130,11 @@ objects: $(OBJS) $(OBJS2)
 allbase:
 	( if [ -f .standalone ] ; then ( rm -f .standalone; make clean ; make objects ) ; else exit 0 ;fi )
 standalonebase:
-	( if [ ! -f .standalone ] ; then ( make clean; echo "DEFINES+=-DVOMPSTANDALONE" > .standalone; echo "DEFINES+=-D_FILE_OFFSET_BITS=64" >> .standalone; make objectsstandalone ) ; else exit 0 ;fi )
+	( if [ ! -f .standalone ] ; then ( make clean; echo "DEFINES+=-DVOMPSTANDALONE" > .standalone; make objectsstandalone ) ; else exit 0 ;fi )
+
 
 $(SOFILE): objects
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(OBJS2) -o $@
-	@if [ -n "$(DOOLDINSTALL)" ]; then \
-cp $@ $(LIBDIR)/$@.$(APIVERSION) ; \
-echo "done manual copy"; \
-fi
 
 vompserver-standalone: objectsstandalone
 	$(CXX) $(CXXFLAGS) $(OBJS) -lpthread -o $@
diff --git a/bootpd.c b/bootpd.c
index 801c5ac..7366aaf 100644
--- a/bootpd.c
+++ b/bootpd.c
@@ -18,6 +18,8 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
+#include <linux/limits.h>
+
 #include "bootpd.h"
 
 //void dump(unsigned char* data, USHORT size);
diff --git a/tftpclient.c b/tftpclient.c
index 58d305f..a439cd1 100644
--- a/tftpclient.c
+++ b/tftpclient.c
@@ -18,6 +18,8 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
+#include <linux/limits.h>
+
 #include "tftpclient.h"
 
 TftpClient::TftpClient()
diff --git a/vompclient.h b/vompclient.h
index cab1599..4ec905e 100644
--- a/vompclient.h
+++ b/vompclient.h
@@ -78,9 +78,9 @@ class VompClient
 
   private:
     static int nr_clients;
-    void incClients();
-    void decClients();
-
+    static void incClients();
+    static void decClients();
+    
     static ULLONG ntohll(ULLONG a);
     static ULLONG htonll(ULLONG a);
     
diff --git a/vompclientrrproc.c b/vompclientrrproc.c
index 5884721..841d382 100644
--- a/vompclientrrproc.c
+++ b/vompclientrrproc.c
@@ -27,6 +27,7 @@
 #include <vdr/plugin.h>
 #include <vdr/timers.h>
 #include <vdr/menu.h>
+#include <vdr/remote.h>
 #include "recplayer.h"
 #include "mvpreceiver.h"
 #endif
@@ -42,7 +43,7 @@
 
 bool ResumeIDLock;
 
-ULONG VompClientRRProc::VOMP_PROTOCOL_VERSION = 0x00000200;
+ULONG VompClientRRProc::VOMP_PROTOCOL_VERSION = 0x00000300;
 // format is aabbccdd
 // cc is release protocol version, increase with every release, that changes protocol
 // dd is development protocol version, set to zero at every release, 
@@ -258,7 +259,10 @@ bool VompClientRRProc::processPacket()
     case 23:
       result = processDeleteTimer();
       break;
-#endif        
+    case 666:
+      result = processVDRShutdown();
+      break;
+#endif
     case VDR_GETMEDIALIST:
       result = processGetMediaList();
       break;
@@ -653,7 +657,11 @@ int VompClientRRProc::processGetLanguageContent()
 int VompClientRRProc::processGetRecordingsList()
 {
   int FreeMB;
+#if APIVERSNUM > 20101
+  int Percent = cVideoDirectory::VideoDiskSpace(&FreeMB);
+#else
   int Percent = VideoDiskSpace(&FreeMB);
+#endif
   int Total = (FreeMB / (100 - Percent)) * 100;
   
   resp->addULONG(Total);
@@ -795,16 +803,26 @@ int VompClientRRProc::processMoveRecording()
 
       log->log("RRProc", Log::DEBUG, "datedirname: %s", dateDirName);
       log->log("RRProc", Log::DEBUG, "titledirname: %s", titleDirName);
+#if APIVERSNUM > 20101
+      log->log("RRProc", Log::DEBUG, "viddir: %s", cVideoDirectory::Name());
+#else
       log->log("RRProc", Log::DEBUG, "viddir: %s", VideoDirectory);
+#endif
 
       char* newPathConv = new char[strlen(newPath)+1];
       strcpy(newPathConv, newPath);
       ExchangeChars(newPathConv, true);
       log->log("RRProc", Log::DEBUG, "EC: %s", newPathConv);
 
+#if APIVERSNUM > 20101
+      char* newContainer = new char[strlen(cVideoDirectory::Name()) + strlen(newPathConv) + strlen(titleDirName) + 1];
+      log->log("RRProc", Log::DEBUG, "l10: %i", strlen(cVideoDirectory::Name()) + strlen(newPathConv) + strlen(titleDirName) + 1);
+      sprintf(newContainer, "%s%s%s", cVideoDirectory::Name(), newPathConv, titleDirName);
+#else
       char* newContainer = new char[strlen(VideoDirectory) + strlen(newPathConv) + strlen(titleDirName) + 1];
       log->log("RRProc", Log::DEBUG, "l10: %i", strlen(VideoDirectory) + strlen(newPathConv) + strlen(titleDirName) + 1);
       sprintf(newContainer, "%s%s%s", VideoDirectory, newPathConv, titleDirName);
+#endif
       delete[] newPathConv;
 
       log->log("RRProc", Log::DEBUG, "%s", newContainer);
@@ -1938,6 +1956,17 @@ int VompClientRRProc::processGetMarks()
   return 1;
 }
 
+int VompClientRRProc::processVDRShutdown()
+{
+  log->log("RRProc", Log::DEBUG, "Trying to shutdown VDR");
+  VompClient::decClients(); // Temporarily make this client disappear
+  cRemote::Put(kPower);
+  VompClient::incClients();
+  resp->finalise();
+  x.tcp.sendPacket(resp->getPtr(), resp->getLen());
+  return 1;
+}
+  
 #endif // !VOMPSTANDALONE
 
 
diff --git a/vompclientrrproc.h b/vompclientrrproc.h
index 8e7bc7b..da6ef12 100644
--- a/vompclientrrproc.h
+++ b/vompclientrrproc.h
@@ -81,6 +81,7 @@ class VompClientRRProc : public Thread
     int processGetChannelPids();
     int processDeleteTimer();
     int processReScanRecording();           // FIXME obselete
+    int processVDRShutdown();
 #endif
     int processLogin();
     int processConfigSave();
@@ -93,7 +94,7 @@ class VompClientRRProc : public Thread
     int processGetLanguageList();
     int processGetLanguageContent();
     int processSetCharset();
-
+    
     void threadMethod();
 
     VompClient& x;
diff --git a/vompserver.c b/vompserver.c
index 9276795..b59a037 100644
--- a/vompserver.c
+++ b/vompserver.c
@@ -27,7 +27,7 @@
 #include "mvpserver.h"
 //#include "vompclient.h"
 
-static const char *VERSION        = "0.4.0";
+static const char *VERSION        = "0.4.1";
 static const char *DESCRIPTION    = "Vompserver plugin by Chris Tallon";
 static const char *MAINMENUENTRY  = "Vompserver";
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-vompserver.git



More information about the pkg-vdr-dvb-changes mailing list