mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Moved EXT protocol base port setting from the command line switch to the setup menu entry.
This commit is contained in:
parent
987696a35b
commit
0670667e9b
49
README
49
README
@ -55,7 +55,11 @@ Setup menu:
|
||||
- TS buffer prefill ratio [%] = 0 Defines prefill ratio for transport
|
||||
stream ringbuffer before data is
|
||||
transferred to VDR.
|
||||
The valid range: 0...40
|
||||
Valid range: 0...40
|
||||
- EXT protocol base port = 4321 Defines base port used in EXT protocol.
|
||||
The port range is defined by the number
|
||||
of IPTV devices (max. 8).
|
||||
Valid range: 0...65527
|
||||
- Use section filtering = 1 Defines whether section filtering shall
|
||||
be used.
|
||||
Valid range: 0...1
|
||||
@ -118,26 +122,30 @@ Configuration:
|
||||
|
||||
External streaming:
|
||||
|
||||
- Starting from version 0.0.2 IPTV plugin features support for external
|
||||
streaming applications. What this means in short is that with proper helper
|
||||
applications and configuration the plugin is able to display streams not
|
||||
originally in MPEG1/2 TS format.
|
||||
- Starting from version 0.0.2 IPTV plugin features a support for external
|
||||
streaming applications. With proper helper applications and configuration
|
||||
the IPTV plugin is now able to display not only MPEG1/2 transport streams
|
||||
but also other formats like MP3 radio streams.
|
||||
|
||||
- To add an externally received channel, add an EXT entry to channels.conf.
|
||||
Specify a script name as the location parameter. This script is executed
|
||||
from plugin configuration directory when VDR tunes to the specified
|
||||
channel. The port parameter in channels.conf is passed to the script and
|
||||
can be used to select for example between different URLs.
|
||||
- To watch an externally received channel add an EXT entry to channels.conf
|
||||
and specify a script name and parameter. The specified script is executed
|
||||
from plugin configuration directory when VDR tunes to the channel. The
|
||||
specified script parameter is passed to the script and it can be used to
|
||||
select for example between different URLs.
|
||||
|
||||
- When EXT channel is opened IPTV plugin opens an UDP listening port on the
|
||||
local host. The script executing is then responsible for supplying IPTV
|
||||
plugin with MPEG2 TS data in UDP format to the opened port. The data will
|
||||
then be processed by VDR as usual. The opened listening port can be
|
||||
specified in plugin configuration.
|
||||
- When an EXT channel is opened the IPTV plugin opens an UDP listening port
|
||||
on the localhost. The external script is responsible for supplying IPTV
|
||||
plugin with MPEG2 TS data in UDP/RTP format to the listening port. The
|
||||
data will be processed in VDR like a normal DVB broadcast. The listening
|
||||
base port can be specified in the plugin configuration menu.
|
||||
|
||||
- Each IPTV device is having a different listen port. The port number is
|
||||
specified as a base port number plus IPTV device index minus one. Maximum
|
||||
8 IPTV devices can be used.
|
||||
|
||||
- IPTV plugin includes an example script which uses VLC media player for
|
||||
receiving streams, transcoding and handing the result to IPTV plugin. IPTV
|
||||
was tested with VLC version 0.8.6c
|
||||
receiving streams, transcoding and handing the result to IPTV plugin. The
|
||||
plugin was tested with VLC version 0.8.6c.
|
||||
|
||||
Notes:
|
||||
|
||||
@ -148,13 +156,6 @@ Notes:
|
||||
- The following section filters are recommended to be disabled:
|
||||
"NIT (0x40)", "SDT (0x42)", "TDT (0x70)"
|
||||
|
||||
- The EXT protocol listens UDP packets from localhost. The default listen
|
||||
port base number is 4321 and it can be configured via a commandline
|
||||
switch. The port range is defined by the number of IPTV devices (max. 8).
|
||||
|
||||
- The EXT protocol scripts must be located in the config directory of the
|
||||
plugin.
|
||||
|
||||
Acknowledgements:
|
||||
|
||||
- The IPTV section filtering code is derived from Linux kernel.
|
||||
|
6
config.c
6
config.c
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: config.c,v 1.17 2007/10/19 22:54:03 rahrenbe Exp $
|
||||
* $Id: config.c,v 1.18 2007/10/20 17:26:46 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@ -14,10 +14,10 @@ cIptvConfig::cIptvConfig(void)
|
||||
: readBufferTsCount(48),
|
||||
tsBufferSize(2),
|
||||
tsBufferPrefillRatio(0),
|
||||
extProtocolBasePort(4321),
|
||||
useBytes(1),
|
||||
sectionFiltering(1),
|
||||
sidScanning(1),
|
||||
extListenPortBase(4321)
|
||||
sidScanning(1)
|
||||
{
|
||||
for (unsigned int i = 0; i < sizeof(disabledFilters); ++i)
|
||||
disabledFilters[i] = -1;
|
||||
|
8
config.h
8
config.h
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: config.h,v 1.15 2007/10/19 22:54:03 rahrenbe Exp $
|
||||
* $Id: config.h,v 1.16 2007/10/20 17:26:46 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#ifndef __IPTV_CONFIG_H
|
||||
@ -19,10 +19,10 @@ private:
|
||||
unsigned int readBufferTsCount;
|
||||
unsigned int tsBufferSize;
|
||||
unsigned int tsBufferPrefillRatio;
|
||||
unsigned int extProtocolBasePort;
|
||||
unsigned int useBytes;
|
||||
unsigned int sectionFiltering;
|
||||
unsigned int sidScanning;
|
||||
unsigned int extListenPortBase;
|
||||
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
||||
char configDirectory[255];
|
||||
|
||||
@ -31,19 +31,19 @@ public:
|
||||
unsigned int GetReadBufferTsCount(void) { return readBufferTsCount; }
|
||||
unsigned int GetTsBufferSize(void) { return tsBufferSize; }
|
||||
unsigned int GetTsBufferPrefillRatio(void) { return tsBufferPrefillRatio; }
|
||||
unsigned int GetExtProtocolBasePort(void) { return extProtocolBasePort; }
|
||||
unsigned int GetUseBytes(void) { return useBytes; }
|
||||
unsigned int GetSectionFiltering(void) { return sectionFiltering; }
|
||||
unsigned int GetSidScanning(void) { return sidScanning; }
|
||||
unsigned int GetExtListenPortBase(void) { return extListenPortBase; }
|
||||
const char *GetConfigDirectory(void) { return configDirectory; }
|
||||
unsigned int GetDisabledFiltersCount(void);
|
||||
int GetDisabledFilters(unsigned int Index);
|
||||
void SetTsBufferSize(unsigned int Size) { tsBufferSize = Size; }
|
||||
void SetTsBufferPrefillRatio(unsigned int Ratio) { tsBufferPrefillRatio = Ratio; }
|
||||
void SetExtProtocolBasePort(unsigned int PortNumber) { extProtocolBasePort = PortNumber; }
|
||||
void SetUseBytes(unsigned int On) { useBytes = On; }
|
||||
void SetSectionFiltering(unsigned int On) { sectionFiltering = On; }
|
||||
void SetSidScanning(unsigned int On) { sidScanning = On; }
|
||||
void SetExtListenPortBase(unsigned int PortNumber) { extListenPortBase = PortNumber; }
|
||||
void SetDisabledFilters(unsigned int Index, int Number);
|
||||
void SetConfigDirectory(const char *directoryP);
|
||||
};
|
||||
|
13
iptv.c
13
iptv.c
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: iptv.c,v 1.23 2007/10/19 22:54:03 rahrenbe Exp $
|
||||
* $Id: iptv.c,v 1.24 2007/10/20 17:26:46 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
@ -66,8 +66,7 @@ const char *cPluginIptv::CommandLineHelp(void)
|
||||
{
|
||||
debug("cPluginIptv::CommandLineHelp()\n");
|
||||
// Return a string that describes all known command line options.
|
||||
return " -d <num>, --devices=<number> number of devices to be created\n"
|
||||
" -p <port>,--port=<port> base port number for EXT protocol UDP streaming\n";
|
||||
return " -d <num>, --devices=<number> number of devices to be created\n";
|
||||
}
|
||||
|
||||
bool cPluginIptv::ProcessArgs(int argc, char *argv[])
|
||||
@ -76,19 +75,15 @@ bool cPluginIptv::ProcessArgs(int argc, char *argv[])
|
||||
// Implement command line argument processing here if applicable.
|
||||
static const struct option long_options[] = {
|
||||
{ "devices", required_argument, NULL, 'd' },
|
||||
{ "port", required_argument, NULL, 'p' },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
int c;
|
||||
while ((c = getopt_long(argc, argv, "d:p:", long_options, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "d:", long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'd':
|
||||
deviceCount = atoi(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
IptvConfig.SetExtListenPortBase(atoi(optarg));
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -183,6 +178,8 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
|
||||
IptvConfig.SetTsBufferSize(atoi(Value));
|
||||
else if (!strcasecmp(Name, "TsBufferPrefill"))
|
||||
IptvConfig.SetTsBufferPrefillRatio(atoi(Value));
|
||||
else if (!strcasecmp(Name, "ExtProtocolBasePort"))
|
||||
IptvConfig.SetExtProtocolBasePort(atoi(Value));
|
||||
else if (!strcasecmp(Name, "SectionFiltering"))
|
||||
IptvConfig.SetSectionFiltering(atoi(Value));
|
||||
else if (!strcasecmp(Name, "SidScanning"))
|
||||
|
@ -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-19 23:10+0300\n"
|
||||
"POT-Creation-Date: 2007-10-20 19:43+0300\n"
|
||||
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
|
||||
"Last-Translator: Rolf Ahrenberg\n"
|
||||
"Language-Team: <vdr@linuxtv.org>\n"
|
||||
@ -108,6 +108,9 @@ msgstr "TS-puskurin koko [MB]"
|
||||
msgid "TS buffer prefill ratio [%]"
|
||||
msgstr "TS-puskurin esitäyttöaste [%]"
|
||||
|
||||
msgid "EXT protocol base port"
|
||||
msgstr "EXT-protokollan perusportti"
|
||||
|
||||
msgid "Use section filtering"
|
||||
msgstr "Käytä sektioiden suodatusta"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: protocolext.c,v 1.11 2007/10/20 11:36:21 ajhseppa Exp $
|
||||
* $Id: protocolext.c,v 1.12 2007/10/20 17:26:46 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#include <sys/wait.h>
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
cIptvProtocolExt::cIptvProtocolExt()
|
||||
: pid(-1),
|
||||
listenPort(IptvConfig.GetExtListenPortBase()),
|
||||
listenPort(IptvConfig.GetExtProtocolBasePort()),
|
||||
scriptParameter(0),
|
||||
socketDesc(-1),
|
||||
readBufferLen(TS_SIZE * IptvConfig.GetReadBufferTsCount())
|
||||
@ -297,7 +297,7 @@ bool cIptvProtocolExt::Set(const char* Location, const int Parameter, const int
|
||||
}
|
||||
scriptParameter = Parameter;
|
||||
// Update listen port
|
||||
listenPort = IptvConfig.GetExtListenPortBase() + Index;
|
||||
listenPort = IptvConfig.GetExtProtocolBasePort() + Index;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
6
setup.c
6
setup.c
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: setup.c,v 1.39 2007/10/19 22:54:03 rahrenbe Exp $
|
||||
* $Id: setup.c,v 1.40 2007/10/20 17:26:46 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -593,6 +593,7 @@ cIptvPluginSetup::cIptvPluginSetup()
|
||||
debug("cIptvPluginSetup::cIptvPluginSetup()\n");
|
||||
tsBufferSize = IptvConfig.GetTsBufferSize();
|
||||
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
|
||||
extProtocolBasePort = IptvConfig.GetExtProtocolBasePort();
|
||||
sectionFiltering = IptvConfig.GetSectionFiltering();
|
||||
sidScanning = IptvConfig.GetSidScanning();
|
||||
numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
|
||||
@ -612,6 +613,7 @@ void cIptvPluginSetup::Setup(void)
|
||||
Clear();
|
||||
Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 1, 4));
|
||||
Add(new cMenuEditIntItem( tr("TS buffer prefill ratio [%]"), &tsBufferPrefill, 0, 40));
|
||||
Add(new cMenuEditIntItem( tr("EXT protocol base port"), &extProtocolBasePort, 0, 0xFFF7));
|
||||
Add(new cMenuEditBoolItem(tr("Use section filtering"), §ionFiltering));
|
||||
if (sectionFiltering) {
|
||||
Add(new cMenuEditBoolItem(tr("Scan Sid automatically"), &sidScanning));
|
||||
@ -685,12 +687,14 @@ void cIptvPluginSetup::Store(void)
|
||||
// Store values into setup.conf
|
||||
SetupStore("TsBufferSize", tsBufferSize);
|
||||
SetupStore("TsBufferPrefill", tsBufferPrefill);
|
||||
SetupStore("ExtProtocolBasePort", extProtocolBasePort);
|
||||
SetupStore("SectionFiltering", sectionFiltering);
|
||||
SetupStore("SidScanning", sidScanning);
|
||||
StoreFilters("DisabledFilters", disabledFilterIndexes);
|
||||
// Update global config
|
||||
IptvConfig.SetTsBufferSize(tsBufferSize);
|
||||
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
|
||||
IptvConfig.SetExtProtocolBasePort(extProtocolBasePort);
|
||||
IptvConfig.SetSectionFiltering(sectionFiltering);
|
||||
IptvConfig.SetSidScanning(sidScanning);
|
||||
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
|
||||
|
3
setup.h
3
setup.h
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: setup.h,v 1.15 2007/10/09 16:37:16 rahrenbe Exp $
|
||||
* $Id: setup.h,v 1.16 2007/10/20 17:26:46 rahrenbe Exp $
|
||||
*/
|
||||
|
||||
#ifndef __IPTV_SETUP_H
|
||||
@ -17,6 +17,7 @@ class cIptvPluginSetup : public cMenuSetupPage
|
||||
private:
|
||||
int tsBufferSize;
|
||||
int tsBufferPrefill;
|
||||
int extProtocolBasePort;
|
||||
int sectionFiltering;
|
||||
int sidScanning;
|
||||
int numDisabledFilters;
|
||||
|
Loading…
Reference in New Issue
Block a user