summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmirl <schmirl>2007-02-19 12:08:16 +0000
committerschmirl <schmirl>2007-02-19 12:08:16 +0000
commite86d019878a4315cc5a75450d2753c543fbe5a1a (patch)
tree843d7abc57d2254cc892ec0df81639ce967c78e5
parente3a44184539067ff9be18a7d1458c6c349a6245a (diff)
downloadvdr-plugin-streamdev-e86d019878a4315cc5a75450d2753c543fbe5a1a.tar.gz
vdr-plugin-streamdev-e86d019878a4315cc5a75450d2753c543fbe5a1a.tar.bz2
Added commandline switch -r/--remux for specifying name of externremux script (thanks to Rolf Ahrenberg)
Modified Files: streamdev-server.c streamdev-server.h remux/extern.c remux/extern.h
-rw-r--r--remux/extern.c8
-rw-r--r--remux/extern.h2
-rw-r--r--streamdev-server.c31
-rw-r--r--streamdev-server.h4
4 files changed, 40 insertions, 5 deletions
diff --git a/remux/extern.c b/remux/extern.c
index b1857f8..ca1082e 100644
--- a/remux/extern.c
+++ b/remux/extern.c
@@ -6,6 +6,8 @@
#include <signal.h>
#include <unistd.h>
+const char *g_ExternRemux = "/root/externremux.sh";
+
class cTSExt: public cThread {
private:
cRingBufferLinear *m_ResultBuffer;
@@ -65,9 +67,9 @@ cTSExt::cTSExt(cRingBufferLinear *ResultBuffer):
for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
close(i); //close all dup'ed filedescriptors
- printf("starting externremux.sh\n");
- execl("/bin/sh", "sh", "-c", "/root/externremux.sh", NULL);
- printf("failed externremux.sh\n");
+ //printf("starting externremux.sh\n");
+ execl("/bin/sh", "sh", "-c", g_ExternRemux, NULL);
+ //printf("failed externremux.sh\n");
_exit(-1);
}
diff --git a/remux/extern.h b/remux/extern.h
index 9066680..ae055ac 100644
--- a/remux/extern.h
+++ b/remux/extern.h
@@ -4,6 +4,8 @@
#include "remux/tsremux.h"
#include <vdr/ringbuffer.h>
+extern const char *g_ExternRemux;
+
class cTSExt;
class cExternRemux: public cTSRemux {
diff --git a/streamdev-server.c b/streamdev-server.c
index 2d81652..af5f104 100644
--- a/streamdev-server.c
+++ b/streamdev-server.c
@@ -3,13 +3,15 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: streamdev-server.c,v 1.4 2006/11/24 11:45:36 schmirl Exp $
+ * $Id: streamdev-server.c,v 1.5 2007/02/19 12:08:16 schmirl Exp $
*/
+#include <getopt.h>
#include "streamdev-server.h"
#include "server/setup.h"
#include "server/server.h"
#include "server/suspend.h"
+#include "remux/extern.h"
#include "i18n.h"
const char *cPluginStreamdevServer::DESCRIPTION = "VDR Streaming Server";
@@ -27,6 +29,33 @@ const char *cPluginStreamdevServer::Description(void)
return tr(DESCRIPTION);
}
+const char *cPluginStreamdevServer::CommandLineHelp(void)
+{
+ // return a string that describes all known command line options.
+ return " -r <CMD>, --remux=<CMD> Define an external command for remuxing.\n";
+}
+
+bool cPluginStreamdevServer::ProcessArgs(int argc, char *argv[])
+{
+ // implement command line argument processing here if applicable.
+ static const struct option long_options[] = {
+ { "remux", required_argument, NULL, 'r' },
+ { NULL, 0, NULL, 0 }
+ };
+
+ int c;
+ while((c = getopt_long(argc, argv, "r:", long_options, NULL)) != -1) {
+ switch (c) {
+ case 'r':
+ g_ExternRemux = optarg;
+ break;
+ default:
+ return false;
+ }
+ }
+ return true;
+}
+
bool cPluginStreamdevServer::Start(void)
{
i18n_name = Name();
diff --git a/streamdev-server.h b/streamdev-server.h
index 09a2c42..8149e4b 100644
--- a/streamdev-server.h
+++ b/streamdev-server.h
@@ -1,5 +1,5 @@
/*
- * $Id: streamdev-server.h,v 1.3 2006/07/05 20:37:17 thomas Exp $
+ * $Id: streamdev-server.h,v 1.4 2007/02/19 12:08:16 schmirl Exp $
*/
#ifndef VDR_STREAMDEVSERVER_H
@@ -19,6 +19,8 @@ public:
virtual const char *Version(void) { return VERSION; }
virtual const char *Description(void);
+ virtual const char *CommandLineHelp(void);
+ virtual bool ProcessArgs(int argc, char *argv[]);
virtual bool Start(void);
virtual void Stop(void);
virtual cString Active(void);