From patchwork Fri Jun 16 07:26:43 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aftab Ahmed X-Patchwork-Id: 12334 Received: from smtp-out3.blueyonder.co.uk ([195.188.213.6]) by www.linuxtv.org with esmtp (Exim 4.50) id 1Fr8jV-0006Wu-KV for vdr@linuxtv.org; Fri, 16 Jun 2006 09:27:09 +0200 Received: from [172.23.170.136] (helo=anti-virus01-07) by smtp-out3.blueyonder.co.uk with smtp (Exim 4.52) id 1Fr8j6-0008P3-5B for vdr@linuxtv.org; Fri, 16 Jun 2006 08:26:44 +0100 Received: from [82.45.36.144] (helo=tivo) by asmtp-out5.blueyonder.co.uk with esmtp (Exim 4.52) id 1Fr8j5-0003xm-Cg for vdr@linuxtv.org; Fri, 16 Jun 2006 08:26:43 +0100 Received: from [127.0.0.1] ([127.0.0.1]) (authenticated user Afmed@theaftab.lan) by tivo (Kerio MailServer 6.1.1) for vdr@linuxtv.org; Fri, 16 Jun 2006 08:26:44 +0100 Message-ID: <44925D33.8050303@theaftab.com> Date: Fri, 16 Jun 2006 08:26:43 +0100 From: Aftab Ahmed User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] streamdev-server for 1.4.1 References: <20060615210318.c0aa564d.gdh@acentral.co.uk> In-Reply-To: <20060615210318.c0aa564d.gdh@acentral.co.uk> X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2006 07:27:09 -0000 Status: O X-Status: X-Keywords: X-UID: 9803 Gavin Hamill wrote: >Sorry to bore you all with this old topic, but is there anyone who has a >working tarball of vdr-1.4.1/PLUGINS/src/streamdev they could send me? > >I've spent the last 20 minutes with Google trying to pick my way >through German wiki/forum posts without success :( > >If it contains support for the 'Extern' URL form to pipe the TS >through /root/externremux.sh, that'd be perfect! :) > >Cheers, >Gavin. > Ahhh some one else that wants to watch the foorball at work!! I used the attacted patch to make the current cvs work a few days ago. I am still using 1.4.0-3, but i doubt that should make a difference Aftab Index: i18n.c =================================================================== RCS file: /var/cvsroot/streamdev/i18n.c,v retrieving revision 1.3 diff -u -r1.3 i18n.c --- i18n.c 10 May 2005 21:02:24 -0000 1.3 +++ i18n.c 17 Apr 2006 16:29:10 -0000 @@ -807,5 +807,25 @@ "" // Russian #endif }, + { "Streaming TV", // English + "Streaming TV",// Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi + "", // Polski + "", // Español + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala +#if VDRVERSNUM >= 10300 + "" // Russian +#endif + }, { NULL } }; Index: streamdev-server.c =================================================================== RCS file: /var/cvsroot/streamdev/streamdev-server.c,v retrieving revision 1.2 diff -u -r1.2 streamdev-server.c --- streamdev-server.c 9 May 2005 20:22:29 -0000 1.2 +++ streamdev-server.c 17 Apr 2006 16:29:10 -0000 @@ -6,10 +6,12 @@ * $Id: streamdev-server.c,v 1.2 2005/05/09 20:22:29 lordjaxom Exp $ */ +#include #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,36 @@ return tr(DESCRIPTION); } +const char *cPluginStreamdevServer::CommandLineHelp(void) +{ + static char *help_str=0; + + free(help_str); // for easier orientation, this is column 80| + asprintf(&help_str," -r CMD, --remux=CMD use CMD to remux stream\n" + " (default: \"%s\")\n", + g_szRemuxScript + ); + return help_str; +} + +bool cPluginStreamdevServer::ProcessArgs(int argc, char *argv[]) +{ + static struct option long_options[] = { + { "remux", required_argument, NULL, 'r' }, + { NULL } + }; + + int c, option_index = 0; + while((c=getopt_long(argc,argv,"r:",long_options,&option_index))!=-1) { + switch (c) { + case 'r': g_szRemuxScript=optarg;break; + default: return false; + } + } + return true; +} + + bool cPluginStreamdevServer::Start(void) { i18n_name = Name(); @@ -55,9 +87,13 @@ cStreamdevServer::Destruct(); } -bool cPluginStreamdevServer::Active(void) +cString cPluginStreamdevServer::Active(void) { - return cStreamdevServer::Active(); + if(cStreamdevServer::Active()) + { + return tr("Streaming TV"); + } + return NULL; } const char *cPluginStreamdevServer::MainMenuEntry(void) Index: streamdev-server.h =================================================================== RCS file: /var/cvsroot/streamdev/streamdev-server.h,v retrieving revision 1.2 diff -u -r1.2 streamdev-server.h --- streamdev-server.h 9 May 2005 20:22:29 -0000 1.2 +++ streamdev-server.h 17 Apr 2006 16:29:10 -0000 @@ -21,11 +21,14 @@ virtual const char *Description(void); virtual bool Start(void); virtual void Stop(void); - virtual bool Active(void); + virtual cString Active(void); virtual const char *MainMenuEntry(void); virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *Name, const char *Value); + + virtual bool ProcessArgs(int argc, char *argv[]); + virtual const char *CommandLineHelp(void); }; #endif // VDR_STREAMDEVSERVER_H Index: remux/extern.c =================================================================== RCS file: /var/cvsroot/streamdev/remux/extern.c,v retrieving revision 1.1 diff -u -r1.1 extern.c --- remux/extern.c 12 Feb 2005 17:20:35 -0000 1.1 +++ remux/extern.c 17 Apr 2006 16:29:10 -0000 @@ -3,6 +3,9 @@ #include #include #include +#include + +const char *g_szRemuxScript = "externremux.sh"; class cTSExt: public cThread { private: @@ -10,7 +13,6 @@ bool m_Active; int m_Process; int m_Inpipe, m_Outpipe; - protected: virtual void Action(void); @@ -47,6 +49,7 @@ } if (m_Process == 0) { + // child process dup2(inpipe[0], STDIN_FILENO); close(inpipe[1]); @@ -57,9 +60,7 @@ 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"); + execl("/bin/sh", "sh", "-c", g_szRemuxScript, NULL); _exit(-1); } @@ -77,6 +78,7 @@ close(m_Outpipe); close(m_Inpipe); kill(m_Process, SIGTERM); + waitpid(m_Process, 0, 0); } void cTSExt::Action(void) Index: remux/extern.h =================================================================== RCS file: /var/cvsroot/streamdev/remux/extern.h,v retrieving revision 1.1 diff -u -r1.1 extern.h --- remux/extern.h 12 Feb 2005 17:20:35 -0000 1.1 +++ remux/extern.h 17 Apr 2006 16:29:10 -0000 @@ -4,6 +4,8 @@ #include "remux/tsremux.h" #include +extern const char *g_szRemuxScript; + class cTSExt; class cExternRemux: public cTSRemux {