Added EXT protocol listen port to channels.conf.

This commit is contained in:
Rolf Ahrenberg 2007-10-16 22:13:44 +00:00
parent d69901ffb6
commit f9252cc925
5 changed files with 19 additions and 23 deletions

3
README
View File

@ -95,6 +95,7 @@ Configuration:
- channels.conf
TV4;IPTV:4:IPTV|EXT|/video/iptvradio.sh|4321:P:0:0:680:0:0:4:0:0:0
TV3;IPTV:3:IPTV|FILE|/media/video.ts|5:P:0:514:670:2321:0:3:0:0:0
TV2;IPTV:2:IPTV|HTTP|127.0.0.1/TS/2|3000:P:0:513:660:2321:0:2:0:0:0
TV1;IPTV:1:IPTV|UDP|127.0.0.1|1234:P:0:512:650:2321:0:1:0:0:0
@ -102,7 +103,7 @@ Configuration:
| | | | | Source type ("P")
| | | | IP Port Number or File delay (ms)
| | | IP Address or File Location
| | Protocol ("UDP", "HTTP", "FILE")
| | Protocol ("UDP", "HTTP", "FILE", "EXT")
| Plugin ID ("IPTV")
Unique enumeration

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2007-10-16 00:00+0300\n"
"POT-Creation-Date: 2007-10-17 00:19+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n"
@ -57,12 +57,12 @@ msgstr "Protokolla"
msgid "Delay (ms)"
msgstr "Viive (ms)"
msgid "Address"
msgstr "Osoite"
msgid "Port"
msgstr "Portti"
msgid "Address"
msgstr "Osoite"
msgid "Nid"
msgstr "Verkko-ID"

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: protocolext.c,v 1.2 2007/10/16 20:03:59 ajhseppa Exp $
* $Id: protocolext.c,v 1.3 2007/10/16 22:13:44 rahrenbe Exp $
*/
#include <sys/types.h>
@ -21,7 +21,6 @@
cIptvProtocolExt::cIptvProtocolExt()
: listenPort(4321),
streamPort(1234),
socketDesc(-1),
readBufferLen(TS_SIZE * IptvConfig.GetReadBufferTsCount()),
isActive(false)
@ -46,7 +45,7 @@ cIptvProtocolExt::~cIptvProtocolExt()
free(readBuffer);
}
bool cIptvProtocolExt::OpenSocket(const int Port)
bool cIptvProtocolExt::OpenSocket(void)
{
debug("cIptvProtocolExt::OpenSocket()\n");
// Bind to the socket if it is not active already
@ -172,11 +171,10 @@ bool cIptvProtocolExt::Open(void)
return false;
// Create the listening socket
OpenSocket(streamPort);
OpenSocket();
if (!isActive) {
char* cmd = NULL;
asprintf(&cmd, "%s/%s start", cPlugin::ConfigDirectory("iptv"),
streamAddr);
asprintf(&cmd, "%s start", streamAddr);
int retval = SystemExec(cmd);
free(cmd);
if (!retval)
@ -192,8 +190,7 @@ bool cIptvProtocolExt::Close(void)
CloseSocket();
if (isActive) {
char* cmd = NULL;
asprintf(&cmd, "%s/%s stop",
cPlugin::ConfigDirectory("iptv"), streamAddr);
asprintf(&cmd, "%s stop", streamAddr);
int retval = SystemExec(cmd);
free(cmd);
if (!retval)
@ -209,17 +206,13 @@ bool cIptvProtocolExt::Set(const char* Address, const int Port)
if (!isempty(Address)) {
// Update stream address and port
streamAddr = strcpyrealloc(streamAddr, Address);
streamPort = Port;
listenPort = Port;
}
#if 0 // Are these needed or not?
Close();
Open();
#endif
return true;
}
cString cIptvProtocolExt::GetInformation(void)
{
//debug("cIptvProtocolExt::GetInformation()");
return cString::sprintf("ext://%s:%d", streamAddr, streamPort);
return cString::sprintf("ext://%s:%d", streamAddr, listenPort);
}

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: protocolext.h,v 1.1 2007/10/15 20:06:38 ajhseppa Exp $
* $Id: protocolext.h,v 1.2 2007/10/16 22:13:44 rahrenbe Exp $
*/
#ifndef __IPTV_PROTOCOLEXT_H
@ -17,7 +17,6 @@ private:
char* listenAddr;
int listenPort;
char* streamAddr;
int streamPort;
int socketDesc;
unsigned char* readBuffer;
unsigned int readBufferLen;
@ -25,7 +24,7 @@ private:
bool isActive;
private:
bool OpenSocket(const int Port);
bool OpenSocket(void);
void CloseSocket(void);
public:

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: setup.c,v 1.34 2007/10/15 21:03:45 rahrenbe Exp $
* $Id: setup.c,v 1.35 2007/10/16 22:13:44 rahrenbe Exp $
*/
#include <string.h>
@ -187,6 +187,9 @@ void cIptvMenuEditChannel::Setup(void)
Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.port, 0, 0xFFFF));
break;
case eProtocolEXT:
Add(new cMenuEditStrItem(trVDR("File"), data.location, sizeof(data.location), trVDR(FileNameChars)));
Add(new cMenuEditIntItem(tr("Port"), &data.port, 0, 0xFFFF));
break;
case eProtocolHTTP:
case eProtocolUDP:
default: