1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

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 - 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 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 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 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") | | | | | Source type ("P")
| | | | IP Port Number or File delay (ms) | | | | IP Port Number or File delay (ms)
| | | IP Address or File Location | | | IP Address or File Location
| | Protocol ("UDP", "HTTP", "FILE") | | Protocol ("UDP", "HTTP", "FILE", "EXT")
| Plugin ID ("IPTV") | Plugin ID ("IPTV")
Unique enumeration Unique enumeration

View File

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

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * 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> #include <sys/types.h>
@ -21,7 +21,6 @@
cIptvProtocolExt::cIptvProtocolExt() cIptvProtocolExt::cIptvProtocolExt()
: listenPort(4321), : listenPort(4321),
streamPort(1234),
socketDesc(-1), socketDesc(-1),
readBufferLen(TS_SIZE * IptvConfig.GetReadBufferTsCount()), readBufferLen(TS_SIZE * IptvConfig.GetReadBufferTsCount()),
isActive(false) isActive(false)
@ -46,7 +45,7 @@ cIptvProtocolExt::~cIptvProtocolExt()
free(readBuffer); free(readBuffer);
} }
bool cIptvProtocolExt::OpenSocket(const int Port) bool cIptvProtocolExt::OpenSocket(void)
{ {
debug("cIptvProtocolExt::OpenSocket()\n"); debug("cIptvProtocolExt::OpenSocket()\n");
// Bind to the socket if it is not active already // Bind to the socket if it is not active already
@ -172,11 +171,10 @@ bool cIptvProtocolExt::Open(void)
return false; return false;
// Create the listening socket // Create the listening socket
OpenSocket(streamPort); OpenSocket();
if (!isActive) { if (!isActive) {
char* cmd = NULL; char* cmd = NULL;
asprintf(&cmd, "%s/%s start", cPlugin::ConfigDirectory("iptv"), asprintf(&cmd, "%s start", streamAddr);
streamAddr);
int retval = SystemExec(cmd); int retval = SystemExec(cmd);
free(cmd); free(cmd);
if (!retval) if (!retval)
@ -192,8 +190,7 @@ bool cIptvProtocolExt::Close(void)
CloseSocket(); CloseSocket();
if (isActive) { if (isActive) {
char* cmd = NULL; char* cmd = NULL;
asprintf(&cmd, "%s/%s stop", asprintf(&cmd, "%s stop", streamAddr);
cPlugin::ConfigDirectory("iptv"), streamAddr);
int retval = SystemExec(cmd); int retval = SystemExec(cmd);
free(cmd); free(cmd);
if (!retval) if (!retval)
@ -209,17 +206,13 @@ bool cIptvProtocolExt::Set(const char* Address, const int Port)
if (!isempty(Address)) { if (!isempty(Address)) {
// Update stream address and port // Update stream address and port
streamAddr = strcpyrealloc(streamAddr, Address); streamAddr = strcpyrealloc(streamAddr, Address);
streamPort = Port; listenPort = Port;
} }
#if 0 // Are these needed or not?
Close();
Open();
#endif
return true; return true;
} }
cString cIptvProtocolExt::GetInformation(void) cString cIptvProtocolExt::GetInformation(void)
{ {
//debug("cIptvProtocolExt::GetInformation()"); //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. * 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 #ifndef __IPTV_PROTOCOLEXT_H
@ -17,7 +17,6 @@ private:
char* listenAddr; char* listenAddr;
int listenPort; int listenPort;
char* streamAddr; char* streamAddr;
int streamPort;
int socketDesc; int socketDesc;
unsigned char* readBuffer; unsigned char* readBuffer;
unsigned int readBufferLen; unsigned int readBufferLen;
@ -25,7 +24,7 @@ private:
bool isActive; bool isActive;
private: private:
bool OpenSocket(const int Port); bool OpenSocket(void);
void CloseSocket(void); void CloseSocket(void);
public: public:

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * 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> #include <string.h>
@ -187,6 +187,9 @@ void cIptvMenuEditChannel::Setup(void)
Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.port, 0, 0xFFFF)); Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.port, 0, 0xFFFF));
break; break;
case eProtocolEXT: 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 eProtocolHTTP:
case eProtocolUDP: case eProtocolUDP:
default: default: