mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Forced EXT script location only to plugin's config directory.
This commit is contained in:
parent
78b1c491f0
commit
1aeccbe51d
9
README
9
README
@ -42,6 +42,8 @@ ln -s iptv-X.Y.Z iptv
|
|||||||
cd /put/your/path/here/VDR
|
cd /put/your/path/here/VDR
|
||||||
patch -p1 < PLUGINS/src/iptv/patches/vdr-X.Y.Z-pluginparam.patch
|
patch -p1 < PLUGINS/src/iptv/patches/vdr-X.Y.Z-pluginparam.patch
|
||||||
cp sources.conf /path/to/vdrconf/
|
cp sources.conf /path/to/vdrconf/
|
||||||
|
mkdir -p /path/to/vdrconf/plugins/iptv
|
||||||
|
cp PLUGINS/src/iptv/examples/iptvstream.sh /path/to/vdrconf/plugins/iptv/
|
||||||
make
|
make
|
||||||
make plugins
|
make plugins
|
||||||
./vdr -P iptv
|
./vdr -P iptv
|
||||||
@ -95,8 +97,8 @@ Configuration:
|
|||||||
|
|
||||||
- channels.conf
|
- channels.conf
|
||||||
|
|
||||||
TV4;IPTV:4:IPTV|EXT|/video/iptvstream.sh|4321:P:0:0:680:0:0:4:0:0:0
|
TV4;IPTV:4:IPTV|EXT|iptvstream.sh|0: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|/video/stream.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
|
||||||
^ ^ ^ ^ ^ ^
|
^ ^ ^ ^ ^ ^
|
||||||
@ -128,6 +130,9 @@ Notes:
|
|||||||
port base number is 4321 and it can be configured via a commandline
|
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).
|
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:
|
Acknowledgements:
|
||||||
|
|
||||||
- The IPTV section filtering code is derived from Linux kernel.
|
- The IPTV section filtering code is derived from Linux kernel.
|
||||||
|
9
config.c
9
config.c
@ -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: config.c,v 1.16 2007/10/19 22:18:55 rahrenbe Exp $
|
* $Id: config.c,v 1.17 2007/10/19 22:54:03 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -21,6 +21,7 @@ cIptvConfig::cIptvConfig(void)
|
|||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < sizeof(disabledFilters); ++i)
|
for (unsigned int i = 0; i < sizeof(disabledFilters); ++i)
|
||||||
disabledFilters[i] = -1;
|
disabledFilters[i] = -1;
|
||||||
|
memset(configDirectory, '\0', sizeof(configDirectory));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int cIptvConfig::GetDisabledFiltersCount(void)
|
unsigned int cIptvConfig::GetDisabledFiltersCount(void)
|
||||||
@ -41,3 +42,9 @@ void cIptvConfig::SetDisabledFilters(unsigned int Index, int Number)
|
|||||||
if (Index < sizeof(disabledFilters))
|
if (Index < sizeof(disabledFilters))
|
||||||
disabledFilters[Index] = Number;
|
disabledFilters[Index] = Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cIptvConfig::SetConfigDirectory(const char *directoryP)
|
||||||
|
{
|
||||||
|
debug("cIptvConfig::SetConfigDirectory(%s)", directoryP);
|
||||||
|
strn0cpy(configDirectory, directoryP, sizeof(configDirectory));
|
||||||
|
}
|
||||||
|
7
config.h
7
config.h
@ -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: config.h,v 1.14 2007/10/19 22:18:55 rahrenbe Exp $
|
* $Id: config.h,v 1.15 2007/10/19 22:54:03 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_CONFIG_H
|
#ifndef __IPTV_CONFIG_H
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
class cIptvConfig
|
class cIptvConfig
|
||||||
{
|
{
|
||||||
protected:
|
private:
|
||||||
unsigned int readBufferTsCount;
|
unsigned int readBufferTsCount;
|
||||||
unsigned int tsBufferSize;
|
unsigned int tsBufferSize;
|
||||||
unsigned int tsBufferPrefillRatio;
|
unsigned int tsBufferPrefillRatio;
|
||||||
@ -24,6 +24,7 @@ protected:
|
|||||||
unsigned int sidScanning;
|
unsigned int sidScanning;
|
||||||
unsigned int extListenPortBase;
|
unsigned int extListenPortBase;
|
||||||
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
||||||
|
char configDirectory[255];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cIptvConfig();
|
cIptvConfig();
|
||||||
@ -34,6 +35,7 @@ public:
|
|||||||
unsigned int GetSectionFiltering(void) { return sectionFiltering; }
|
unsigned int GetSectionFiltering(void) { return sectionFiltering; }
|
||||||
unsigned int GetSidScanning(void) { return sidScanning; }
|
unsigned int GetSidScanning(void) { return sidScanning; }
|
||||||
unsigned int GetExtListenPortBase(void) { return extListenPortBase; }
|
unsigned int GetExtListenPortBase(void) { return extListenPortBase; }
|
||||||
|
const char *GetConfigDirectory(void) { return configDirectory; }
|
||||||
unsigned int GetDisabledFiltersCount(void);
|
unsigned int GetDisabledFiltersCount(void);
|
||||||
int GetDisabledFilters(unsigned int Index);
|
int GetDisabledFilters(unsigned int Index);
|
||||||
void SetTsBufferSize(unsigned int Size) { tsBufferSize = Size; }
|
void SetTsBufferSize(unsigned int Size) { tsBufferSize = Size; }
|
||||||
@ -43,6 +45,7 @@ public:
|
|||||||
void SetSidScanning(unsigned int On) { sidScanning = On; }
|
void SetSidScanning(unsigned int On) { sidScanning = On; }
|
||||||
void SetExtListenPortBase(unsigned int PortNumber) { extListenPortBase = PortNumber; }
|
void SetExtListenPortBase(unsigned int PortNumber) { extListenPortBase = PortNumber; }
|
||||||
void SetDisabledFilters(unsigned int Index, int Number);
|
void SetDisabledFilters(unsigned int Index, int Number);
|
||||||
|
void SetConfigDirectory(const char *directoryP);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern cIptvConfig IptvConfig;
|
extern cIptvConfig IptvConfig;
|
||||||
|
3
iptv.c
3
iptv.c
@ -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: iptv.c,v 1.22 2007/10/19 22:18:55 rahrenbe Exp $
|
* $Id: iptv.c,v 1.23 2007/10/19 22:54:03 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -100,6 +100,7 @@ bool cPluginIptv::Initialize(void)
|
|||||||
{
|
{
|
||||||
debug("cPluginIptv::Initialize()\n");
|
debug("cPluginIptv::Initialize()\n");
|
||||||
// Initialize any background activities the plugin shall perform.
|
// Initialize any background activities the plugin shall perform.
|
||||||
|
IptvConfig.SetConfigDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N));
|
||||||
return cIptvDevice::Initialize(deviceCount);
|
return cIptvDevice::Initialize(deviceCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.8 2007/10/19 22:18:55 rahrenbe Exp $
|
* $Id: protocolext.c,v 1.9 2007/10/19 22:54:03 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@ -273,12 +273,18 @@ bool cIptvProtocolExt::Set(const char* Location, const int Parameter, const int
|
|||||||
{
|
{
|
||||||
debug("cIptvProtocolExt::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
|
debug("cIptvProtocolExt::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
|
||||||
if (!isempty(Location)) {
|
if (!isempty(Location)) {
|
||||||
// Update script file and parameter
|
struct stat stbuf;
|
||||||
scriptFile = strcpyrealloc(scriptFile, Location);
|
// Update script file and parameter
|
||||||
scriptParameter = Parameter;
|
free(scriptFile);
|
||||||
// Update listen port
|
asprintf(&scriptFile, "%s/%s", IptvConfig.GetConfigDirectory(), Location);
|
||||||
listenPort = IptvConfig.GetExtListenPortBase() + Index;
|
if ((stat(scriptFile, &stbuf) != 0) || (strstr(scriptFile, "..") != 0)) {
|
||||||
}
|
error("ERROR: Non-existent script '%s'", scriptFile);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
scriptParameter = Parameter;
|
||||||
|
// Update listen port
|
||||||
|
listenPort = IptvConfig.GetExtListenPortBase() + Index;
|
||||||
|
}
|
||||||
return true;
|
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.
|
* See the README file for copyright information and how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: setup.c,v 1.38 2007/10/19 21:36:28 rahrenbe Exp $
|
* $Id: setup.c,v 1.39 2007/10/19 22:54:03 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -294,11 +294,11 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
|
|||||||
if ((Key != kNone) && (data.protocol != oldProtocol)) {
|
if ((Key != kNone) && (data.protocol != oldProtocol)) {
|
||||||
switch (data.protocol) {
|
switch (data.protocol) {
|
||||||
case eProtocolEXT:
|
case eProtocolEXT:
|
||||||
strn0cpy(data.location, "/video/iptvstream.sh", sizeof(data.location));
|
strn0cpy(data.location, "iptvstream.sh", sizeof(data.location));
|
||||||
data.parameter = 0;
|
data.parameter = 0;
|
||||||
break;
|
break;
|
||||||
case eProtocolFILE:
|
case eProtocolFILE:
|
||||||
strn0cpy(data.location, "/tmp/video.ts", sizeof(data.location));
|
strn0cpy(data.location, "/video/stream.ts", sizeof(data.location));
|
||||||
data.parameter = 0;
|
data.parameter = 0;
|
||||||
break;
|
break;
|
||||||
case eProtocolHTTP:
|
case eProtocolHTTP:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user