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

Updated for vdr-1.7.13.

This commit is contained in:
Rolf Ahrenberg 2010-03-04 17:34:21 +02:00
parent 517547dc15
commit aa620a314c
30 changed files with 527 additions and 1554 deletions

13
HISTORY
View File

@ -1,5 +1,6 @@
==================================
VDR Plugin 'iptv' Revision History VDR Plugin 'iptv' Revision History
---------------------------------- ==================================
2007-10-14: Version 0.0.1 2007-10-14: Version 0.0.1
@ -117,7 +118,13 @@ VDR Plugin 'iptv' Revision History
- Modified sectionfilters to use socket pair instead of - Modified sectionfilters to use socket pair instead of
filesystem fifos. filesystem fifos.
2010-xx-xx: Version 0.3.2
- Updated patches. ==================================
VDR Plugin 'iptv' Revision History
==================================
2010-03-05: Version 0.4.0
- Updated for vdr-1.7.13.
Notice: channels.conf format has changed!
- Fixed argument corruption. - Fixed argument corruption.

View File

@ -31,6 +31,10 @@ VDRDIR = ../../..
LIBDIR = ../../lib LIBDIR = ../../lib
TMPDIR = /tmp TMPDIR = /tmp
### Make sure that necessary options are included:
include $(VDRDIR)/Make.global
### Allow user defined options to overwrite defaults: ### Allow user defined options to overwrite defaults:
-include $(VDRDIR)/Make.config -include $(VDRDIR)/Make.config
@ -61,7 +65,7 @@ all-redirect: all
OBJS = $(PLUGIN).o config.o setup.o device.o streamer.o protocoludp.o \ OBJS = $(PLUGIN).o config.o setup.o device.o streamer.o protocoludp.o \
protocolhttp.o protocolfile.o protocolext.o sectionfilter.o \ protocolhttp.o protocolfile.o protocolext.o sectionfilter.o \
sidscanner.o pidscanner.o statistics.o common.o socket.o sidscanner.o pidscanner.o statistics.o common.o socket.o source.o
### The main target: ### The main target:

48
README
View File

@ -44,7 +44,6 @@ cd /put/your/path/here/VDR/PLUGINS/src
tar -xzf /put/your/path/here/vdr-iptv-X.Y.Z.tgz tar -xzf /put/your/path/here/vdr-iptv-X.Y.Z.tgz
ln -s iptv-X.Y.Z iptv 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
cp sources.conf /path/to/vdrconf/ cp sources.conf /path/to/vdrconf/
cp -R PLUGINS/src/iptv/iptv /path/to/vdrconf/plugins/ cp -R PLUGINS/src/iptv/iptv /path/to/vdrconf/plugins/
make make
@ -77,29 +76,8 @@ Setup menu:
options which allow you to disable the options which allow you to disable the
individual section filters. individual section filters.
Valid range: 0...7 Valid range: 0...7
- [Red:Channels] Opens IPTV channel editor.
- [Blue:Info] Opens IPTV information/statistics menu. - [Blue:Info] Opens IPTV information/statistics menu.
Channel editor menu:
- Because of the different nature and content the VDR channel editor is not
best suited for editing of IPTV channels. Therefore an alternative editor
is provided which allows more IPTV centric editing of channel information.
An IPTV channel editor is accessible via "Setup -> Plugins -> IPTV" and
pressing the Red button. The channel editor is functionally similar to
VDR's built-in channel editor.
- Scan Sid: [yes|no] Defines whether service id shall be
scanned automatically. Service id is
used in channel identification and
EPG information is set according to it.
This option requires section filtering.
- Scan pids: [yes|no] Defines whether video and audio pids
shall be scanned automatically. This
option is useful with streams missing
correct PAT/PMT information.
Information menu: Information menu:
- [Red:General] Opens the general information page. - [Red:General] Opens the general information page.
@ -111,17 +89,20 @@ Configuration:
- channels.conf - channels.conf
TV4;IPTV:40:IPTV|S1P0|EXT|iptvstream.sh|0:P:0:0:680:0:0:4:0:0:0 TV4;IPTV:40:S=1|P=0|F=EXT|U=iptvstream.sh|A=0:I:0:0:680:0:0:4:0:0:0
TV3;IPTV:30:IPTV|S0P1|FILE|/video/stream.ts|5:P:0:514:670:2321:0:3:0:0:0 TV3;IPTV:30:S=0|P=1|F=FILE|U=/video/stream.ts|A=5:I:0:514:670:2321:0:3:0:0:0
TV2;IPTV:20:IPTV|S0P1|HTTP|127.0.0.1/TS/2|3000:P:0:513:660:2321:0:2:0:0:0 TV2;IPTV:20:S=0|P=1|F=HTTP|U=127.0.0.1/TS/2|A=3000:I:0:513:660:2321:0:2:0:0:0
TV1;IPTV:10:IPTV|S1P0|UDP|127.0.0.1|1234:P:0:512:650:2321:0:1:0:0:0 TV1;IPTV:10:S=1|P=0|F=UDP|U=127.0.0.1|A=1234:I:0:512:650:2321:0:1:0:0:0
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
| | | | | | Source type ("P") | | | | | | Source type ("I")
| | | | | IP Port Number, File delay (ms), Script parameter | | | | | Stream parameter (multicast port
| | | | IP Address, File location, Script location | | | | | number, HTTP port number, file delay
| | | Protocol ("UDP", "HTTP", "FILE", "EXT") | | | | | (ms), script parameter)
| | Parameters ("S" Sid scan, "P" Pid scan, "0" disable, "1" enable) | | | | Stream address (multicast address, URL, file
| Plugin ID ("IPTV") | | | | location, script location)
| | | Stream protocol ("UDP", "HTTP", "FILE", "EXT")
| | PID Scan ("0" disable, "1" enable)
| SID Scan ("0" disable, "1" enable)
Unique enumeration Unique enumeration
- UDP multicast rules for iptables firewall - UDP multicast rules for iptables firewall
@ -151,8 +132,7 @@ External streaming:
devices can be used simultaneously. devices can be used simultaneously.
- IPTV plugin includes an example script which uses VLC media player for - IPTV plugin includes an example script which uses VLC media player for
receiving streams, transcoding and handing the result to IPTV plugin. The receiving streams, transcoding and handing the result to IPTV plugin.
plugin was tested with VLC version 0.8.6c.
Notes: Notes:

View File

@ -20,16 +20,12 @@
#define error(x...) esyslog("ERROR: " x); #define error(x...) esyslog("ERROR: " x);
#endif #endif
#ifndef trNOOP #define ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
#define trNOOP(s) (s)
#endif
#ifndef trVDR
#define trVDR(s) tr(s)
#endif
#define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr" #define IPTV_DVR_FILENAME "/tmp/vdr-iptv%d.dvr"
#define IPTV_SOURCE_CHARACTER 'I'
#define IPTV_DEVICE_INFO_ALL 0 #define IPTV_DEVICE_INFO_ALL 0
#define IPTV_DEVICE_INFO_GENERAL 1 #define IPTV_DEVICE_INFO_GENERAL 1
#define IPTV_DEVICE_INFO_PIDS 2 #define IPTV_DEVICE_INFO_PIDS 2

100
device.c
View File

@ -6,6 +6,7 @@
*/ */
#include "config.h" #include "config.h"
#include "source.h"
#include "device.h" #include "device.h"
#define IPTV_MAX_DEVICES MAXDEVICES #define IPTV_MAX_DEVICES MAXDEVICES
@ -22,7 +23,7 @@ cIptvDevice::cIptvDevice(unsigned int Index)
sidScanEnabled(false), sidScanEnabled(false),
pidScanEnabled(false) pidScanEnabled(false)
{ {
unsigned int bufsize = MEGABYTE(IptvConfig.GetTsBufferSize()); unsigned int bufsize = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize());
bufsize -= (bufsize % TS_SIZE); bufsize -= (bufsize % TS_SIZE);
isyslog("creating IPTV device %d (CardIndex=%d)", deviceIndex, CardIndex()); isyslog("creating IPTV device %d (CardIndex=%d)", deviceIndex, CardIndex());
tsBuffer = new cRingBufferLinear(bufsize + 1, TS_SIZE, false, tsBuffer = new cRingBufferLinear(bufsize + 1, TS_SIZE, false,
@ -85,6 +86,7 @@ cIptvDevice::~cIptvDevice()
bool cIptvDevice::Initialize(unsigned int DeviceCount) bool cIptvDevice::Initialize(unsigned int DeviceCount)
{ {
debug("cIptvDevice::Initialize(): DeviceCount=%d\n", DeviceCount); debug("cIptvDevice::Initialize(): DeviceCount=%d\n", DeviceCount);
new cIptvSourceParam(IPTV_SOURCE_CHARACTER, "IPTV");
if (DeviceCount > IPTV_MAX_DEVICES) if (DeviceCount > IPTV_MAX_DEVICES)
DeviceCount = IPTV_MAX_DEVICES; DeviceCount = IPTV_MAX_DEVICES;
for (unsigned int i = 0; i < DeviceCount; ++i) for (unsigned int i = 0; i < DeviceCount; ++i)
@ -176,73 +178,16 @@ cString cIptvDevice::GetInformation(unsigned int Page)
return info; return info;
} }
cString cIptvDevice::GetChannelSettings(const char *IptvParam, int *Parameter, int *SidScan, int *PidScan, cIptvProtocolIf* *Protocol)
{
debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
char *tag = NULL;
char *proto = NULL;
char *loc = NULL;
if (sscanf(IptvParam, "%a[^|]|S%dP%d|%a[^|]|%a[^|]|%u", &tag, SidScan, PidScan, &proto, &loc, Parameter) == 6) {
cString tagstr(tag, true);
cString protostr(proto, true);
cString locstr(loc, true);
// check if IPTV tag
if (strncasecmp(*tagstr, "IPTV", 4) == 0) {
// check if protocol is supported and update the pointer
if (strncasecmp(*protostr, "UDP", 3) == 0)
*Protocol = pUdpProtocol;
else if (strncasecmp(*protostr, "HTTP", 4) == 0)
*Protocol = pHttpProtocol;
else if (strncasecmp(*protostr, "FILE", 4) == 0)
*Protocol = pFileProtocol;
else if (strncasecmp(*protostr, "EXT", 3) == 0)
*Protocol = pExtProtocol;
else
return NULL;
// return location
return locstr;
}
}
else if (sscanf(IptvParam, "%a[^|]|P%dS%d|%a[^|]|%a[^|]|%u", &tag, PidScan, SidScan, &proto, &loc, Parameter) == 6) {
cString tagstr(tag, true);
cString protostr(proto, true);
cString locstr(loc, true);
// check if IPTV tag
if (strncasecmp(*tagstr, "IPTV", 4) == 0) {
// check if protocol is supported and update the pointer
if (strncasecmp(*protostr, "UDP", 3) == 0)
*Protocol = pUdpProtocol;
else if (strncasecmp(*protostr, "HTTP", 4) == 0)
*Protocol = pHttpProtocol;
else if (strncasecmp(*protostr, "FILE", 4) == 0)
*Protocol = pFileProtocol;
else if (strncasecmp(*protostr, "EXT", 3) == 0)
*Protocol = pExtProtocol;
else
return NULL;
// return location
return locstr;
}
}
return NULL;
}
bool cIptvDevice::ProvidesIptv(const char *Param) const
{
debug("cIptvDevice::ProvidesIptv(%d)\n", deviceIndex);
return (strncasecmp(Param, "IPTV", 4) == 0);
}
bool cIptvDevice::ProvidesSource(int Source) const bool cIptvDevice::ProvidesSource(int Source) const
{ {
debug("cIptvDevice::ProvidesSource(%d)\n", deviceIndex); debug("cIptvDevice::ProvidesSource(%d)\n", deviceIndex);
return (cSource::IsPlug(Source)); return ((Source & cSource::st_Mask) == (IPTV_SOURCE_CHARACTER << 24));
} }
bool cIptvDevice::ProvidesTransponder(const cChannel *Channel) const bool cIptvDevice::ProvidesTransponder(const cChannel *Channel) const
{ {
debug("cIptvDevice::ProvidesTransponder(%d)\n", deviceIndex); debug("cIptvDevice::ProvidesTransponder(%d)\n", deviceIndex);
return (ProvidesSource(Channel->Source()) && ProvidesIptv(Channel->PluginParam())); return (ProvidesSource(Channel->Source()));
} }
bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
@ -265,19 +210,36 @@ int cIptvDevice::NumProvidedSystems(void) const
bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
{ {
int parameter, sidscan, pidscan;
cString location;
cIptvProtocolIf *protocol; cIptvProtocolIf *protocol;
cIptvTransponderParameters itp(Channel->Parameters());
debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex); debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex);
location = GetChannelSettings(Channel->PluginParam(), &parameter, &sidscan, &pidscan, &protocol);
if (isempty(location)) { if (isempty(itp.Address())) {
error("Unrecognized IPTV channel settings: %s", Channel->PluginParam()); error("Unrecognized IPTV address: %s", Channel->Parameters());
return false; return false;
} }
sidScanEnabled = sidscan ? true : false; switch (itp.Protocol()) {
pidScanEnabled = pidscan ? true : false; case cIptvTransponderParameters::eProtocolUDP:
if (pIptvStreamer->Set(location, parameter, deviceIndex, protocol)) { protocol = pUdpProtocol;
break;
case cIptvTransponderParameters::eProtocolHTTP:
protocol = pHttpProtocol;
break;
case cIptvTransponderParameters::eProtocolFILE:
protocol = pFileProtocol;
break;
case cIptvTransponderParameters::eProtocolEXT:
protocol = pExtProtocol;
break;
default:
error("Unrecognized IPTV protocol: %s", Channel->Parameters());
return false;
break;
}
sidScanEnabled = itp.SidScan() ? true : false;
pidScanEnabled = itp.PidScan() ? true : false;
if (pIptvStreamer->Set(itp.Address(), itp.Parameter(), deviceIndex, protocol)) {
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering()) if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
pSidScanner->SetChannel(Channel); pSidScanner->SetChannel(Channel);
if (pidScanEnabled && pPidScanner) if (pidScanEnabled && pPidScanner)
@ -391,7 +353,7 @@ void cIptvDevice::ResetBuffering(void)
{ {
debug("cIptvDevice::ResetBuffering(%d)\n", deviceIndex); debug("cIptvDevice::ResetBuffering(%d)\n", deviceIndex);
// pad prefill to multiple of TS_SIZE // pad prefill to multiple of TS_SIZE
tsBufferPrefill = MEGABYTE(IptvConfig.GetTsBufferSize()) * tsBufferPrefill = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize()) *
IptvConfig.GetTsBufferPrefillRatio() / 100; IptvConfig.GetTsBufferPrefillRatio() / 100;
tsBufferPrefill -= (tsBufferPrefill % TS_SIZE); tsBufferPrefill -= (tsBufferPrefill % TS_SIZE);
} }

View File

@ -69,8 +69,6 @@ private:
// for channel parsing & buffering // for channel parsing & buffering
private: private:
cString GetChannelSettings(const char *IptvParam, int *Parameter, int *SidScan, int *PidScan, cIptvProtocolIf* *Protocol);
bool ProvidesIptv(const char *Param) const;
void ResetBuffering(void); void ResetBuffering(void);
bool IsBuffering(void); bool IsBuffering(void);
bool DeleteFilter(unsigned int Index); bool DeleteFilter(unsigned int Index);

10
iptv.c
View File

@ -12,15 +12,11 @@
#include "setup.h" #include "setup.h"
#include "device.h" #include "device.h"
#ifndef PLUGINPARAMPATCHVERSNUM #if defined(APIVERSNUM) && APIVERSNUM < 10713
#error "You must apply the pluginparam patch for VDR!" #error "VDR-1.7.13 API version or greater is required!"
#endif #endif
#if defined(APIVERSNUM) && APIVERSNUM < 10600 static const char VERSION[] = "0.4.0";
#error "VDR-1.6.0 API version or greater is required!"
#endif
static const char VERSION[] = "0.3.2";
static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
class cPluginIptv : public cPlugin { class cPluginIptv : public cPlugin {

View File

@ -8,12 +8,12 @@ set -e
# The script originates from Peter Holik # The script originates from Peter Holik
# #
# Example channels.conf entries: # Example channels.conf entries:
# Energy;IPTV:50:IPTV|S0P0|EXT|png.sh|1:P:0:256:257:0:0:3:0:0:0 # Energy;IPTV:50:S=0|P=0|F=EXT|U=png.sh|A=1:I:0:256:257:0:0:3:0:0:0
# Temperature;IPTV:60:IPTV|S0P0|EXT|png.sh|2:P:0:256:257:0:0:3:0:0:0 # Temperature;IPTV:60:S=0|P=0|EXT|U=png.sh|A=2:I:0:256:257:0:0:3:0:0:0
# Temperature Week;IPTV:70:IPTV|S0P0|EXT|png.sh|3:P:0:256:257:0:0:3:0:0:0 # Temperature Week;IPTV:70:S=0|P=0|EXT|U=png.sh|A=3:I:0:256:257:0:0:3:0:0:0
# Server Temperature;IPTV:80:IPTV|S0P0|EXT|png.sh|4:P:0:256:257:0:0:3:0:0:0 # Server Temperature;IPTV:80:S=0|P=0|EXT|U=png.sh|A=4:I:0:256:257:0:0:3:0:0:0
# Server Temperature Week;IPTV:90:IPTV|S0P0|EXT|png.sh|5:P:0:256:257:0:0:3:0:0:0 # Server Temperature Week;IPTV:90:S=0|P=0|EXT|U=png.sh|A=5:I:0:256:257:0:0:3:0:0:0
# Traffic;IPTV:100:IPTV|S0P0|EXT|png.sh|6:P:0:256:257:0:0:3:0:0:0 # Traffic;IPTV:100:S=0|P=0|EXT|U=png.sh|A=6:I:0:256:257:0:0:3:0:0:0
# #
# webcam.sh is free software; you can redistribute it and/or modify # webcam.sh is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@ -7,7 +7,7 @@
# http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin # http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin
# #
# An example channels.conf entry: # An example channels.conf entry:
# internetradio;IPTV:2:IPTV|S0P0|EXT|internetradio.sh|0:P:0:0:256:0:0:2:0:0:0 # internetradio;IPTV:2:S=0|P=0|F=EXT|U=internetradio.sh|A=0:P:0:0:256:0:0:2:0:0:0
# #
# internetradio.sh is free software; you can redistribute it and/or modify # internetradio.sh is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@ -7,7 +7,7 @@
# http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin # http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin
# #
# An example channels.conf entry: # An example channels.conf entry:
# linein;IPTV:5:IPTV|S0P0|EXT|linein.sh|0:P:27500:0:256:0:0:5:5:5:0 # linein;IPTV:5:S=0|P=0|F=EXT|U=linein.sh|A=0:I:27500:0:256:0:0:5:5:5:0
# #
# linein.sh is free software; you can redistribute it and/or modify # linein.sh is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@ -52,7 +52,7 @@ lookup_channel_and_pids()
[ ! -e "$CHANNELS_CONF" ] && \ [ ! -e "$CHANNELS_CONF" ] && \
exit_with_error "channels.conf not found ($CHANNELS_CONF)" exit_with_error "channels.conf not found ($CHANNELS_CONF)"
local CHANNEL_RECORD=`grep "[:]IPTV[|][SP][10][SP][10][|]EXT[|]vlc2iptv[|]$PARAMETER[:]" $CHANNELS_CONF` local CHANNEL_RECORD=`grep "[:]S=[10][|]P=[10][|]F=EXT[|]U=vlc2iptv[|]A=$PARAMETER[:]I" $CHANNELS_CONF`
[ -z "$CHANNEL_RECORD" ] && \ [ -z "$CHANNEL_RECORD" ] && \
exit_with_error "no iptv channel with parameter $PARAMETER found" exit_with_error "no iptv channel with parameter $PARAMETER found"

View File

@ -7,7 +7,7 @@
# http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin # http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin
# #
# An example channels.conf entry: # An example channels.conf entry:
# webcam;IPTV:3:IPTV|S0P0|EXT|webcam.sh|0:P:0:256:257:0:0:3:0:0:0 # webcam;IPTV:3:S=0|P=0|F=EXT|U=webcam.sh|A=0:I:0:256:257:0:0:3:0:0:0
# #
# webcam.sh is free software; you can redistribute it and/or modify # webcam.sh is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@ -1,11 +0,0 @@
diff -Nru vdr-1.6.0-vanilla/pat.c vdr-1.6.0-disable-ca-updates/pat.c
--- vdr-1.6.0-vanilla/pat.c 2008-02-08 15:48:31.000000000 +0200
+++ vdr-1.6.0-disable-ca-updates/pat.c 2009-03-07 14:56:42.000000000 +0200
@@ -440,6 +440,7 @@
}
if (Setup.UpdateChannels >= 2) {
Channel->SetPids(Vpid, Vpid ? Ppid : 0, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
+ if (!Channel->IsPlug())
Channel->SetCaIds(CaDescriptors->CaIds());
}
Channel->SetCaDescriptors(CaDescriptorHandler.AddCaDescriptors(CaDescriptors));

View File

@ -1,12 +0,0 @@
diff -Nru vdr-1.6.0-vanilla/eitscan.c vdr-1.6.0-disable_eitscan/eitscan.c
--- vdr-1.6.0-vanilla/eitscan.c 2006-01-07 16:10:17.000000000 +0200
+++ vdr-1.6.0-disable_eitscan/eitscan.c 2009-06-17 16:04:23.000000000 +0300
@@ -146,7 +146,7 @@
if (Device) {
for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) {
const cChannel *Channel = ScanData->GetChannel();
- if (Channel) {
+ if (Channel && !Channel->IsPlug()) {
if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= CA_ENCRYPTED_MIN) {
if (Device->ProvidesTransponder(Channel)) {
if (!Device->Receiving()) {

View File

@ -1,287 +0,0 @@
diff -Nru vdr-1.6.0-vanilla/channels.c vdr-1.6.0-pluginparam/channels.c
--- vdr-1.6.0-vanilla/channels.c 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/channels.c 2008-03-27 22:06:47.000000000 +0200
@@ -166,6 +166,7 @@
shortName = strdup("");
provider = strdup("");
portalName = strdup("");
+ pluginParam = strdup("");
memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
inversion = INVERSION_AUTO;
bandwidth = BANDWIDTH_AUTO;
@@ -187,6 +188,7 @@
shortName = NULL;
provider = NULL;
portalName = NULL;
+ pluginParam = NULL;
schedule = NULL;
linkChannels = NULL;
refChannel = NULL;
@@ -215,6 +217,7 @@
free(shortName);
free(provider);
free(portalName);
+ free(pluginParam);
}
cChannel& cChannel::operator= (const cChannel &Channel)
@@ -223,6 +226,7 @@
shortName = strcpyrealloc(shortName, Channel.shortName);
provider = strcpyrealloc(provider, Channel.provider);
portalName = strcpyrealloc(portalName, Channel.portalName);
+ pluginParam = strcpyrealloc(pluginParam, Channel.pluginParam);
memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__);
return *this;
}
@@ -280,9 +284,26 @@
transmission = Channel->transmission;
guard = Channel->guard;
hierarchy = Channel->hierarchy;
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, Channel->pluginParam);
}
}
+bool cChannel::SetPlugTransponderData(int Source, int Frequency, const char *PluginParam)
+{
+ if (source != Source || frequency != Frequency || (strcmp(pluginParam, PluginParam) != 0)) {
+ if (Number()) {
+ dsyslog("changing transponder data of channel %d from %s:%d:%s to %s:%d:%s", Number(), *cSource::ToString(source), frequency, pluginParam, *cSource::ToString(Source), Frequency, PluginParam);
+ modification |= CHANNELMOD_TRANSP;
+ Channels.SetModified();
+ }
+ source = Source;
+ frequency = Frequency;
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
+ schedule = NULL;
+ }
+ return true;
+}
+
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH)
{
// Workarounds for broadcaster stupidity:
@@ -407,6 +428,18 @@
}
}
+void cChannel::SetPluginParam(const char *PluginParam)
+{
+ if (!isempty(PluginParam) && strcmp(pluginParam, PluginParam) != 0) {
+ if (Number()) {
+ dsyslog("changing plugin parameters of channel %d from '%s' to '%s'", Number(), pluginParam, PluginParam);
+ modification |= CHANNELMOD_TRANSP;
+ Channels.SetModified();
+ }
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
+ }
+}
+
#define STRDIFF 0x01
#define VALDIFF 0x02
@@ -593,7 +626,7 @@
if (isdigit(type))
type = 'S';
#define ST(s) if (strchr(s, type))
- char buffer[64];
+ char buffer[256];
char *q = buffer;
*q = 0;
ST(" S ") q += sprintf(q, "%c", polarization);
@@ -605,6 +638,7 @@
ST(" T") q += PrintParameter(q, 'T', MapToUser(transmission, TransmissionValues));
ST(" T") q += PrintParameter(q, 'G', MapToUser(guard, GuardValues));
ST(" T") q += PrintParameter(q, 'Y', MapToUser(hierarchy, HierarchyValues));
+ ST("P ") snprintf(buffer, sizeof(buffer), "%s", pluginParam);
return buffer;
}
@@ -626,7 +660,7 @@
bool cChannel::StringToParameters(const char *s)
{
- while (s && *s) {
+ while (s && *s && !IsPlug()) {
switch (toupper(*s)) {
case 'B': s = ParseParameter(s, bandwidth, BandwidthValues); break;
case 'C': s = ParseParameter(s, coderateH, CoderateValues); break;
@@ -736,7 +770,7 @@
dpids[0] = 0;
ok = false;
if (parambuf && sourcebuf && vpidbuf && apidbuf) {
- ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0;
+ ok = ((source = cSource::FromString(sourcebuf)) >= 0) && StringToParameters(parambuf);
char *p = strchr(vpidbuf, '+');
if (p)
@@ -827,6 +861,7 @@
shortName = strcpyrealloc(shortName, p);
}
name = strcpyrealloc(name, namebuf);
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, parambuf);
free(parambuf);
free(sourcebuf);
diff -Nru vdr-1.6.0-vanilla/channels.h vdr-1.6.0-pluginparam/channels.h
--- vdr-1.6.0-vanilla/channels.h 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/channels.h 2008-03-27 22:06:47.000000000 +0200
@@ -114,6 +114,7 @@
char *shortName;
char *provider;
char *portalName;
+ char *pluginParam;
int __BeginData__;
int frequency; // MHz
int source;
@@ -165,6 +166,7 @@
int Frequency(void) const { return frequency; } ///< Returns the actual frequency, as given in 'channels.conf'
int Transponder(void) const; ///< Returns the transponder frequency in MHz, plus the polarization in case of sat
static int Transponder(int Frequency, char Polarization); ///< builds the transponder from the given Frequency and Polarization
+ const char *PluginParam(void) const { return pluginParam; }
int Source(void) const { return source; }
int Srate(void) const { return srate; }
int Vpid(void) const { return vpid; }
@@ -199,6 +201,7 @@
int Hierarchy(void) const { return hierarchy; }
const cLinkChannels* LinkChannels(void) const { return linkChannels; }
const cChannel *RefChannel(void) const { return refChannel; }
+ bool IsPlug(void) const { return cSource::IsPlug(source); }
bool IsCable(void) const { return cSource::IsCable(source); }
bool IsSat(void) const { return cSource::IsSat(source); }
bool IsTerr(void) const { return cSource::IsTerr(source); }
@@ -206,12 +209,14 @@
bool HasTimer(void) const;
int Modification(int Mask = CHANNELMOD_ALL);
void CopyTransponderData(const cChannel *Channel);
+ bool SetPlugTransponderData(int Source, int Frequency, const char *PluginParam);
bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH);
bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH);
bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission);
void SetId(int Nid, int Tid, int Sid, int Rid = 0);
void SetName(const char *Name, const char *ShortName, const char *Provider);
void SetPortalName(const char *PortalName);
+ void SetPluginParam(const char *PluginParam);
void SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
void SetCaIds(const int *CaIds); // list must be zero-terminated
void SetCaDescriptors(int Level);
diff -Nru vdr-1.6.0-vanilla/config.h vdr-1.6.0-pluginparam/config.h
--- vdr-1.6.0-vanilla/config.h 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/config.h 2008-03-27 22:06:47.000000000 +0200
@@ -30,6 +30,8 @@
#define APIVERSION "1.6.0"
#define APIVERSNUM 10600 // Version * 10000 + Major * 100 + Minor
+#define PLUGINPARAMPATCHVERSNUM 1
+
// When loading plugins, VDR searches them by their APIVERSION, which
// may be smaller than VDRVERSION in case there have been no changes to
// VDR header files since the last APIVERSION. This allows compiled
diff -Nru vdr-1.6.0-vanilla/menu.c vdr-1.6.0-pluginparam/menu.c
--- vdr-1.6.0-vanilla/menu.c 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/menu.c 2008-03-27 22:06:47.000000000 +0200
@@ -253,6 +253,7 @@
cChannel *channel;
cChannel data;
char name[256];
+ char pluginParam[256];
void Setup(void);
public:
cMenuEditChannel(cChannel *Channel, bool New = false);
@@ -285,6 +286,7 @@
// Parameters for all types of sources:
strn0cpy(name, data.name, sizeof(name));
+ strn0cpy(pluginParam, data.pluginParam, sizeof(pluginParam));
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name)));
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
@@ -315,6 +317,7 @@
ST(" T") Add(new cMenuEditMapItem( tr("Transmission"), &data.transmission, TransmissionValues));
ST(" T") Add(new cMenuEditMapItem( tr("Guard"), &data.guard, GuardValues));
ST(" T") Add(new cMenuEditMapItem( tr("Hierarchy"), &data.hierarchy, HierarchyValues, tr("none")));
+ ST("P ") Add(new cMenuEditStrItem( tr("Parameters"), pluginParam, sizeof(pluginParam), tr(FileNameChars)));
SetCurrent(Get(current));
Display();
@@ -329,6 +332,7 @@
if (Key == kOk) {
if (Channels.HasUniqueChannelID(&data, channel)) {
data.name = strcpyrealloc(data.name, name);
+ data.pluginParam = strcpyrealloc(data.pluginParam, pluginParam);
if (channel) {
*channel = data;
isyslog("edited channel %d %s", channel->Number(), *data.ToText());
diff -Nru vdr-1.6.0-vanilla/po/fi_FI.po vdr-1.6.0-pluginparam/po/fi_FI.po
--- vdr-1.6.0-vanilla/po/fi_FI.po 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/po/fi_FI.po 2008-03-27 22:06:47.000000000 +0200
@@ -1001,3 +1001,6 @@
#, c-format
msgid "VDR will shut down in %s minutes"
msgstr "VDR sammuu %s minuutin kuluttua"
+
+msgid "Parameters"
+msgstr "Parametrit"
diff -Nru vdr-1.6.0-vanilla/po/fr_FR.po vdr-1.6.0-pluginparam/po/fr_FR.po
--- vdr-1.6.0-vanilla/po/fr_FR.po 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/po/fr_FR.po 2008-03-27 22:06:47.000000000 +0200
@@ -1004,3 +1004,6 @@
#, c-format
msgid "VDR will shut down in %s minutes"
msgstr "VDR s'arrêtera dans %s minutes"
+
+msgid "Parameters"
+msgstr "Paramètres"
diff -Nru vdr-1.6.0-vanilla/sources.c vdr-1.6.0-pluginparam/sources.c
--- vdr-1.6.0-vanilla/sources.c 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/sources.c 2008-03-27 22:06:47.000000000 +0200
@@ -37,6 +37,7 @@
char buffer[16];
char *q = buffer;
switch (Code & st_Mask) {
+ case stPlug: *q++ = 'P'; break;
case stCable: *q++ = 'C'; break;
case stSat: *q++ = 'S';
{
@@ -56,6 +57,7 @@
{
int type = stNone;
switch (toupper(*s)) {
+ case 'P': type = stPlug; break;
case 'C': type = stCable; break;
case 'S': type = stSat; break;
case 'T': type = stTerr; break;
diff -Nru vdr-1.6.0-vanilla/sources.conf vdr-1.6.0-pluginparam/sources.conf
--- vdr-1.6.0-vanilla/sources.conf 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/sources.conf 2008-03-27 22:06:47.000000000 +0200
@@ -188,3 +188,7 @@
# Terrestrial
T Terrestrial
+
+# Plugin
+
+P Plugin
diff -Nru vdr-1.6.0-vanilla/sources.h vdr-1.6.0-pluginparam/sources.h
--- vdr-1.6.0-vanilla/sources.h 2008-03-27 21:43:25.000000000 +0200
+++ vdr-1.6.0-pluginparam/sources.h 2008-03-27 22:06:47.000000000 +0200
@@ -16,10 +16,11 @@
public:
enum eSourceType {
stNone = 0x0000,
+ stPlug = 0x2000,
stCable = 0x4000,
stSat = 0x8000,
stTerr = 0xC000,
- st_Mask = 0xC000,
+ st_Mask = 0xE000,
st_Neg = 0x0800,
st_Pos = 0x07FF,
};
@@ -35,6 +36,7 @@
static cString ToString(int Code);
static int FromString(const char *s);
static int FromData(eSourceType SourceType, int Position = 0, bool East = false);
+ static bool IsPlug(int Code) { return (Code & st_Mask) == stPlug; }
static bool IsCable(int Code) { return (Code & st_Mask) == stCable; }
static bool IsSat(int Code) { return (Code & st_Mask) == stSat; }
static bool IsTerr(int Code) { return (Code & st_Mask) == stTerr; }

View File

@ -1,287 +0,0 @@
diff -Nru vdr-1.7.12-vanilla/channels.c vdr-1.7.12-pluginparam/channels.c
--- vdr-1.7.12-vanilla/channels.c 2010-02-01 11:45:39.000000000 +0200
+++ vdr-1.7.12-pluginparam/channels.c 2010-02-01 13:52:56.000000000 +0200
@@ -188,6 +188,7 @@
shortName = strdup("");
provider = strdup("");
portalName = strdup("");
+ pluginParam = strdup("");
memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
inversion = INVERSION_AUTO;
bandwidth = 8000000;
@@ -211,6 +212,7 @@
shortName = NULL;
provider = NULL;
portalName = NULL;
+ pluginParam = NULL;
schedule = NULL;
linkChannels = NULL;
refChannel = NULL;
@@ -239,6 +241,7 @@
free(shortName);
free(provider);
free(portalName);
+ free(pluginParam);
}
cChannel& cChannel::operator= (const cChannel &Channel)
@@ -247,6 +250,7 @@
shortName = strcpyrealloc(shortName, Channel.shortName);
provider = strcpyrealloc(provider, Channel.provider);
portalName = strcpyrealloc(portalName, Channel.portalName);
+ pluginParam = strcpyrealloc(pluginParam, Channel.pluginParam);
memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__);
return *this;
}
@@ -307,9 +311,26 @@
guard = Channel->guard;
hierarchy = Channel->hierarchy;
rollOff = Channel->rollOff;
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, Channel->pluginParam);
}
}
+bool cChannel::SetPlugTransponderData(int Source, int Frequency, const char *PluginParam)
+{
+ if (source != Source || frequency != Frequency || (strcmp(pluginParam, PluginParam) != 0)) {
+ if (Number()) {
+ dsyslog("changing transponder data of channel %d from %s:%d:%s to %s:%d:%s", Number(), *cSource::ToString(source), frequency, pluginParam, *cSource::ToString(Source), Frequency, PluginParam);
+ modification |= CHANNELMOD_TRANSP;
+ Channels.SetModified();
+ }
+ source = Source;
+ frequency = Frequency;
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
+ schedule = NULL;
+ }
+ return true;
+}
+
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, int Modulation, int System, int RollOff)
{
// Workarounds for broadcaster stupidity:
@@ -439,6 +460,18 @@
}
}
+void cChannel::SetPluginParam(const char *PluginParam)
+{
+ if (!isempty(PluginParam) && strcmp(pluginParam, PluginParam) != 0) {
+ if (Number()) {
+ dsyslog("changing plugin parameters of channel %d from '%s' to '%s'", Number(), pluginParam, PluginParam);
+ modification |= CHANNELMOD_TRANSP;
+ Channels.SetModified();
+ }
+ pluginParam = strcpyrealloc(pluginParam, PluginParam);
+ }
+}
+
#define STRDIFF 0x01
#define VALDIFF 0x02
@@ -652,7 +685,7 @@
if (isdigit(type))
type = 'S';
#define ST(s) if (strchr(s, type))
- char buffer[64];
+ char buffer[256];
char *q = buffer;
*q = 0;
ST(" S ") q += sprintf(q, "%c", polarization);
@@ -666,6 +699,7 @@
ST(" S ") q += PrintParameter(q, 'S', MapToUser(system, SystemValues));
ST(" T") q += PrintParameter(q, 'T', MapToUser(transmission, TransmissionValues));
ST(" T") q += PrintParameter(q, 'Y', MapToUser(hierarchy, HierarchyValues));
+ ST("P ") snprintf(buffer, sizeof(buffer), "%s", pluginParam);
return buffer;
}
@@ -694,7 +728,7 @@
bool cChannel::StringToParameters(const char *s)
{
- while (s && *s) {
+ while (s && *s && !IsPlug()) {
switch (toupper(*s)) {
case 'A': s = SkipDigits(s); break; // for compatibility with the "multiproto" approach - may be removed in future versions
case 'B': s = ParseParameter(s, bandwidth, BandwidthValues); break;
@@ -814,7 +848,7 @@
dpids[0] = 0;
ok = false;
if (parambuf && sourcebuf && vpidbuf && apidbuf) {
- ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0;
+ ok = ((source = cSource::FromString(sourcebuf)) >= 0) && StringToParameters(parambuf);
char *p;
if ((p = strchr(vpidbuf, '=')) != NULL) {
@@ -911,6 +945,7 @@
shortName = strcpyrealloc(shortName, p);
}
name = strcpyrealloc(name, namebuf);
+ if (IsPlug()) pluginParam = strcpyrealloc(pluginParam, parambuf);
free(parambuf);
free(sourcebuf);
diff -Nru vdr-1.7.12-vanilla/channels.h vdr-1.7.12-pluginparam/channels.h
--- vdr-1.7.12-vanilla/channels.h 2010-02-01 11:45:39.000000000 +0200
+++ vdr-1.7.12-pluginparam/channels.h 2010-02-01 13:52:56.000000000 +0200
@@ -116,6 +116,7 @@
char *shortName;
char *provider;
char *portalName;
+ char *pluginParam;
int __BeginData__;
int frequency; // MHz
int source;
@@ -174,6 +175,7 @@
int Frequency(void) const { return frequency; } ///< Returns the actual frequency, as given in 'channels.conf'
int Transponder(void) const; ///< Returns the transponder frequency in MHz, plus the polarization in case of sat
static int Transponder(int Frequency, char Polarization); ///< builds the transponder from the given Frequency and Polarization
+ const char *PluginParam(void) const { return pluginParam; }
int Source(void) const { return source; }
int Srate(void) const { return srate; }
int Vpid(void) const { return vpid; }
@@ -214,6 +216,7 @@
int RollOff(void) const { return rollOff; }
const cLinkChannels* LinkChannels(void) const { return linkChannels; }
const cChannel *RefChannel(void) const { return refChannel; }
+ bool IsPlug(void) const { return cSource::IsPlug(source); }
bool IsCable(void) const { return cSource::IsCable(source); }
bool IsSat(void) const { return cSource::IsSat(source); }
bool IsTerr(void) const { return cSource::IsTerr(source); }
@@ -221,12 +224,14 @@
bool HasTimer(void) const;
int Modification(int Mask = CHANNELMOD_ALL);
void CopyTransponderData(const cChannel *Channel);
+ bool SetPlugTransponderData(int Source, int Frequency, const char *PluginParam);
bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, int Modulation, int System, int RollOff);
bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH);
bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission);
void SetId(int Nid, int Tid, int Sid, int Rid = 0);
void SetName(const char *Name, const char *ShortName, const char *Provider);
void SetPortalName(const char *PortalName);
+ void SetPluginParam(const char *PluginParam);
void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
void SetCaIds(const int *CaIds); // list must be zero-terminated
void SetCaDescriptors(int Level);
diff -Nru vdr-1.7.12-vanilla/config.h vdr-1.7.12-pluginparam/config.h
--- vdr-1.7.12-vanilla/config.h 2010-02-01 11:45:39.000000000 +0200
+++ vdr-1.7.12-pluginparam/config.h 2010-02-01 13:52:56.000000000 +0200
@@ -30,6 +30,8 @@
#define APIVERSION "1.7.12"
#define APIVERSNUM 10712 // Version * 10000 + Major * 100 + Minor
+#define PLUGINPARAMPATCHVERSNUM 1
+
// When loading plugins, VDR searches them by their APIVERSION, which
// may be smaller than VDRVERSION in case there have been no changes to
// VDR header files since the last APIVERSION. This allows compiled
diff -Nru vdr-1.7.12-vanilla/menu.c vdr-1.7.12-pluginparam/menu.c
--- vdr-1.7.12-vanilla/menu.c 2010-02-01 11:45:39.000000000 +0200
+++ vdr-1.7.12-pluginparam/menu.c 2010-02-01 13:52:56.000000000 +0200
@@ -190,6 +190,7 @@
cChannel *channel;
cChannel data;
char name[256];
+ char pluginParam[256];
void Setup(void);
public:
cMenuEditChannel(cChannel *Channel, bool New = false);
@@ -222,6 +223,7 @@
// Parameters for all types of sources:
strn0cpy(name, data.name, sizeof(name));
+ strn0cpy(pluginParam, data.pluginParam, sizeof(pluginParam));
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name)));
Add(new cMenuEditSrcItem( tr("Source"), &data.source));
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
@@ -254,6 +256,7 @@
ST(" T") Add(new cMenuEditMapItem( tr("Guard"), &data.guard, GuardValues));
ST(" T") Add(new cMenuEditMapItem( tr("Hierarchy"), &data.hierarchy, HierarchyValues));
ST(" S ") Add(new cMenuEditMapItem( tr("Rolloff"), &data.rollOff, RollOffValues));
+ ST("P ") Add(new cMenuEditStrItem( tr("Parameters"), pluginParam, sizeof(pluginParam), tr(FileNameChars)));
SetCurrent(Get(current));
Display();
@@ -268,6 +271,7 @@
if (Key == kOk) {
if (Channels.HasUniqueChannelID(&data, channel)) {
data.name = strcpyrealloc(data.name, name);
+ data.pluginParam = strcpyrealloc(data.pluginParam, pluginParam);
if (channel) {
*channel = data;
isyslog("edited channel %d %s", channel->Number(), *data.ToText());
diff -Nru vdr-1.7.12-vanilla/po/fi_FI.po vdr-1.7.12-pluginparam/po/fi_FI.po
--- vdr-1.7.12-vanilla/po/fi_FI.po 2010-02-01 11:45:40.000000000 +0200
+++ vdr-1.7.12-pluginparam/po/fi_FI.po 2010-02-01 13:52:56.000000000 +0200
@@ -1306,3 +1306,6 @@
#, c-format
msgid "VDR will shut down in %s minutes"
msgstr "VDR sammuu %s minuutin kuluttua"
+
+msgid "Parameters"
+msgstr "Parametrit"
diff -Nru vdr-1.7.12-vanilla/po/fr_FR.po vdr-1.7.12-pluginparam/po/fr_FR.po
--- vdr-1.7.12-vanilla/po/fr_FR.po 2010-02-01 11:45:40.000000000 +0200
+++ vdr-1.7.12-pluginparam/po/fr_FR.po 2010-02-01 13:52:56.000000000 +0200
@@ -1309,3 +1309,6 @@
#, c-format
msgid "VDR will shut down in %s minutes"
msgstr "VDR s'arrêtera dans %s minutes"
+
+msgid "Parameters"
+msgstr "Paramètres"
diff -Nru vdr-1.7.12-vanilla/sources.c vdr-1.7.12-pluginparam/sources.c
--- vdr-1.7.12-vanilla/sources.c 2010-02-01 11:45:40.000000000 +0200
+++ vdr-1.7.12-pluginparam/sources.c 2010-02-01 13:52:56.000000000 +0200
@@ -37,6 +37,7 @@
char buffer[16];
char *q = buffer;
switch (Code & st_Mask) {
+ case stPlug: *q++ = 'P'; break;
case stCable: *q++ = 'C'; break;
case stSat: *q++ = 'S';
{
@@ -56,6 +57,7 @@
{
int type = stNone;
switch (toupper(*s)) {
+ case 'P': type = stPlug; break;
case 'C': type = stCable; break;
case 'S': type = stSat; break;
case 'T': type = stTerr; break;
diff -Nru vdr-1.7.12-vanilla/sources.conf vdr-1.7.12-pluginparam/sources.conf
--- vdr-1.7.12-vanilla/sources.conf 2010-02-01 11:45:39.000000000 +0200
+++ vdr-1.7.12-pluginparam/sources.conf 2010-02-01 13:52:56.000000000 +0200
@@ -195,3 +195,7 @@
# Terrestrial
T Terrestrial
+
+# Plugin
+
+P Plugin
diff -Nru vdr-1.7.12-vanilla/sources.h vdr-1.7.12-pluginparam/sources.h
--- vdr-1.7.12-vanilla/sources.h 2010-02-01 11:45:39.000000000 +0200
+++ vdr-1.7.12-pluginparam/sources.h 2010-02-01 13:52:56.000000000 +0200
@@ -16,10 +16,11 @@
public:
enum eSourceType {
stNone = 0x0000,
+ stPlug = 0x2000,
stCable = 0x4000,
stSat = 0x8000,
stTerr = 0xC000,
- st_Mask = 0xC000,
+ st_Mask = 0xE000,
st_Neg = 0x0800,
st_Pos = 0x07FF,
};
@@ -35,6 +36,7 @@
static cString ToString(int Code);
static int FromString(const char *s);
static int FromData(eSourceType SourceType, int Position = 0, bool East = false);
+ static bool IsPlug(int Code) { return (Code & st_Mask) == stPlug; }
static bool IsCable(int Code) { return (Code & st_Mask) == stCable; }
static bool IsSat(int Code) { return (Code & st_Mask) == stSat; }
static bool IsTerr(int Code) { return (Code & st_Mask) == stTerr; }

View File

@ -1,6 +1,6 @@
diff -Nru vdr-1.7.12-vanilla/pat.c vdr-1.7.12-disable_ca_updates/pat.c diff -Nru vdr-1.7.13-vanilla/pat.c vdr-1.7.13-disable_ca_updates/pat.c
--- vdr-1.7.12-vanilla/pat.c 2010-02-01 11:45:40.000000000 +0200 --- vdr-1.7.13-vanilla/pat.c 2010-01-01 17:40:05.000000000 +0200
+++ vdr-1.7.12-disable_ca_updates/pat.c 2010-02-01 13:54:32.000000000 +0200 +++ vdr-1.7.13-disable_ca_updates/pat.c 2010-03-04 13:44:28.000000000 +0200
@@ -458,6 +458,7 @@ @@ -458,6 +458,7 @@
} }
if (Setup.UpdateChannels >= 2) { if (Setup.UpdateChannels >= 2) {

View File

@ -1,6 +1,6 @@
diff -Nru vdr-1.7.12-vanilla/eitscan.c vdr-1.7.12-disable_eitscan/eitscan.c diff -Nru vdr-1.7.13-vanilla/eitscan.c vdr-1.7.13-disable_eitscan/eitscan.c
--- vdr-1.7.12-vanilla/eitscan.c 2010-02-01 11:45:39.000000000 +0200 --- vdr-1.7.13-vanilla/eitscan.c 2010-02-07 14:12:05.000000000 +0200
+++ vdr-1.7.12-disable_eitscan/eitscan.c 2010-02-01 13:54:20.000000000 +0200 +++ vdr-1.7.13-disable_eitscan/eitscan.c 2010-03-04 13:44:17.000000000 +0200
@@ -146,7 +146,7 @@ @@ -146,7 +146,7 @@
if (Device) { if (Device) {
for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) { for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) {

View File

@ -33,7 +33,7 @@ cPidScanner::~cPidScanner()
void cPidScanner::SetChannel(const cChannel *Channel) void cPidScanner::SetChannel(const cChannel *Channel)
{ {
if (Channel) { if (Channel) {
debug("cPidScanner::SetChannel(): %s\n", Channel->PluginParam()); debug("cPidScanner::SetChannel(): %s\n", Channel->Parameters());
channel = *Channel; channel = *Channel;
} }
else { else {
@ -146,12 +146,8 @@ void cPidScanner::Process(const uint8_t* buf)
for (unsigned int i = 0; i < MAXSPIDS; ++i) for (unsigned int i = 0; i < MAXSPIDS; ++i)
Spids[i] = IptvChannel->Spid(i); Spids[i] = IptvChannel->Spid(i);
debug("cPidScanner::Process(): Vpid=0x%04X, Apid=0x%04X\n", Vpid, Apid); debug("cPidScanner::Process(): Vpid=0x%04X, Apid=0x%04X\n", Vpid, Apid);
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
int Vtype = IptvChannel->Vtype(); int Vtype = IptvChannel->Vtype();
IptvChannel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); IptvChannel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
#else
IptvChannel->SetPids(Vpid, Ppid, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
#endif
} }
Channels.Unlock(); Channels.Unlock();
process = false; process = false;

View File

@ -5,9 +5,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.2.5\n" "Project-Id-Version: iptv 0.4.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2009-03-06 22:15+0200\n" "POT-Creation-Date: 2010-03-04 16:42+0200\n"
"PO-Revision-Date: 2007-10-29 21:19+0100\n" "PO-Revision-Date: 2007-10-29 21:19+0100\n"
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n" "Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
"Language-Team: German\n" "Language-Team: German\n"
@ -40,60 +40,6 @@ msgstr "TDT (0x70)"
msgid "Experience the IPTV" msgid "Experience the IPTV"
msgstr "Erlebe IPTV" msgstr "Erlebe IPTV"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "DATEI"
msgid "EXT"
msgstr "EXT"
msgid "Protocol"
msgstr "Protokoll"
msgid "Delay (ms)"
msgstr "Verzögerung (ms)"
msgid "Script"
msgstr "Skript"
msgid "Parameter"
msgstr "Parameter"
msgid "Address"
msgstr "Adresse"
msgid "Port"
msgstr "Port"
msgid "Scan Sid"
msgstr "Scanne SID"
msgid "Scan pids"
msgstr "Scanne PIDS"
msgid "Vtype"
msgstr "Vtype"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Cannot find unique channel settings!"
msgstr "Kann eindeutige Kanaleinstellungen nicht finden!"
msgid "IPTV Channels"
msgstr "IPTV Kanäle"
msgid "IPTV Information" msgid "IPTV Information"
msgstr "IPTV Informationen" msgstr "IPTV Informationen"
@ -167,3 +113,30 @@ msgstr ""
msgid "Help" msgid "Help"
msgstr "Hilfe" msgstr "Hilfe"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "DATEI"
msgid "EXT"
msgstr "EXT"
msgid "Scan sid"
msgstr "Scanne SID"
msgid "Scan pids"
msgstr "Scanne PIDS"
msgid "Protocol"
msgstr "Protokoll"
msgid "Address"
msgstr "Adresse"
msgid "Parameter"
msgstr "Parameter"

View File

@ -5,9 +5,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.2.5\n" "Project-Id-Version: iptv 0.4.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2009-03-06 22:15+0200\n" "POT-Creation-Date: 2010-03-04 16:42+0200\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"
@ -39,60 +39,6 @@ msgstr "TDT (0x70)"
msgid "Experience the IPTV" msgid "Experience the IPTV"
msgstr "Koe IPTV:n ihmeellinen maailma" msgstr "Koe IPTV:n ihmeellinen maailma"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "FILE"
msgid "EXT"
msgstr "EXT"
msgid "Protocol"
msgstr "Protokolla"
msgid "Delay (ms)"
msgstr "Viive (ms)"
msgid "Script"
msgstr "Skripti"
msgid "Parameter"
msgstr "Parametri"
msgid "Address"
msgstr "Osoite"
msgid "Port"
msgstr "Portti"
msgid "Scan Sid"
msgstr "Etsi palvelu-ID"
msgid "Scan pids"
msgstr "Etsi pidit"
msgid "Vtype"
msgstr "Kuvatyyppi"
msgid "Nid"
msgstr "Verkko-ID"
msgid "Tid"
msgstr "Lähete-ID"
msgid "Rid"
msgstr "Radio-ID"
msgid "Cannot find unique channel settings!"
msgstr "Yksilöllisiä kanava-asetuksia ei löydetä!"
msgid "IPTV Channels"
msgstr "IPTV-kanavat"
msgid "IPTV Information" msgid "IPTV Information"
msgstr "IPTV-tiedot" msgstr "IPTV-tiedot"
@ -182,3 +128,30 @@ msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle
msgid "Help" msgid "Help"
msgstr "Opaste" msgstr "Opaste"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "FILE"
msgid "EXT"
msgstr "EXT"
msgid "Scan sid"
msgstr "Etsi palvelu-ID"
msgid "Scan pids"
msgstr "Etsi pidit"
msgid "Protocol"
msgstr "Protokolla"
msgid "Address"
msgstr "Osoite"
msgid "Parameter"
msgstr "Parametri"

View File

@ -6,9 +6,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.2.5\n" "Project-Id-Version: iptv 0.4.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2009-03-06 22:15+0200\n" "POT-Creation-Date: 2010-03-04 16:42+0200\n"
"PO-Revision-Date: 2008-01-26 13:14+0100\n" "PO-Revision-Date: 2008-01-26 13:14+0100\n"
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n" "Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
"Language-Team: French\n" "Language-Team: French\n"
@ -41,60 +41,6 @@ msgstr "TDT (0x70)"
msgid "Experience the IPTV" msgid "Experience the IPTV"
msgstr "L'expérience IPTV" msgstr "L'expérience IPTV"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "FICHIER"
msgid "EXT"
msgstr "EXT"
msgid "Protocol"
msgstr "Protocole"
msgid "Delay (ms)"
msgstr "Délai (ms)"
msgid "Script"
msgstr "Script"
msgid "Parameter"
msgstr "Paramètre"
msgid "Address"
msgstr "Adresse"
msgid "Port"
msgstr "Port"
msgid "Scan Sid"
msgstr "Scanne les SID"
msgid "Scan pids"
msgstr "Scanne les PID"
msgid "Vtype"
msgstr "Vtype"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Cannot find unique channel settings!"
msgstr "Impossible de trouver un paramètre de chaîne unique !"
msgid "IPTV Channels"
msgstr "Canal IPTV"
msgid "IPTV Information" msgid "IPTV Information"
msgstr "Information sur IPTV" msgstr "Information sur IPTV"
@ -184,3 +130,62 @@ msgstr "Définit les mauvais comportement qui doivent être désactivé."
msgid "Help" msgid "Help"
msgstr "Aide" msgstr "Aide"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "FICHIER"
msgid "EXT"
msgstr "EXT"
#, fuzzy
msgid "Scan sid"
msgstr "Scanne les SID"
msgid "Scan pids"
msgstr "Scanne les PID"
msgid "Protocol"
msgstr "Protocole"
msgid "Address"
msgstr "Adresse"
msgid "Parameter"
msgstr "Paramètre"
#, fuzzy
#~ msgid "File"
#~ msgstr "Filtres"
#~ msgid "Delay (ms)"
#~ msgstr "Délai (ms)"
#~ msgid "Script"
#~ msgstr "Script"
#~ msgid "Port"
#~ msgstr "Port"
#~ msgid "Vtype"
#~ msgstr "Vtype"
#~ msgid "Nid"
#~ msgstr "Nid"
#~ msgid "Tid"
#~ msgstr "Tid"
#~ msgid "Rid"
#~ msgstr "Rid"
#~ msgid "Cannot find unique channel settings!"
#~ msgstr "Impossible de trouver un paramètre de chaîne unique !"
#~ msgid "IPTV Channels"
#~ msgstr "Canal IPTV"

View File

@ -5,9 +5,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.2.5\n" "Project-Id-Version: iptv 0.4.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2009-03-06 22:15+0200\n" "POT-Creation-Date: 2010-03-04 16:42+0200\n"
"PO-Revision-Date: 2008-07-13 03:28+0100\n" "PO-Revision-Date: 2008-07-13 03:28+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
@ -40,60 +40,6 @@ msgstr "TDT (0x70)"
msgid "Experience the IPTV" msgid "Experience the IPTV"
msgstr "Scopri la IPTV" msgstr "Scopri la IPTV"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "FILE"
msgid "EXT"
msgstr "EXT"
msgid "Protocol"
msgstr "Protocollo"
msgid "Delay (ms)"
msgstr "Ritardo (ms)"
msgid "Script"
msgstr "Script"
msgid "Parameter"
msgstr "Parametro"
msgid "Address"
msgstr "Indirizzo"
msgid "Port"
msgstr "Porta"
msgid "Scan Sid"
msgstr "Scansione Sid"
msgid "Scan pids"
msgstr "Scansione Pids"
msgid "Vtype"
msgstr "Vtype"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Cannot find unique channel settings!"
msgstr "Impossibile trovare impostazioni canale unico!"
msgid "IPTV Channels"
msgstr "Canali IPTV"
msgid "IPTV Information" msgid "IPTV Information"
msgstr "Informazione IPTV" msgstr "Informazione IPTV"
@ -183,3 +129,30 @@ msgstr "Definisci un filtro corrotto che sarà messo nella lista nera."
msgid "Help" msgid "Help"
msgstr "Aiuto" msgstr "Aiuto"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "FILE"
msgid "EXT"
msgstr "EXT"
msgid "Scan sid"
msgstr "Scansione Sid"
msgid "Scan pids"
msgstr "Scansione Pids"
msgid "Protocol"
msgstr "Protocollo"
msgid "Address"
msgstr "Indirizzo"
msgid "Parameter"
msgstr "Parametro"

View File

@ -5,9 +5,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.2.5\n" "Project-Id-Version: iptv 0.4.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2009-03-06 22:15+0200\n" "POT-Creation-Date: 2010-03-04 16:42+0200\n"
"PO-Revision-Date: 2008-03-16 12:14+0100\n" "PO-Revision-Date: 2008-03-16 12:14+0100\n"
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n" "Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
"Language-Team: Russian <de@li.org>\n" "Language-Team: Russian <de@li.org>\n"
@ -41,60 +41,6 @@ msgstr "TDT (0x70)"
msgid "Experience the IPTV" msgid "Experience the IPTV"
msgstr "Попробуй IPTV" msgstr "Попробуй IPTV"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "ФАЙЛ"
msgid "EXT"
msgstr "EXT"
msgid "Protocol"
msgstr "Протокол"
msgid "Delay (ms)"
msgstr "Задержка (мс)"
msgid "Script"
msgstr "Скрипт"
msgid "Parameter"
msgstr "Параметр"
msgid "Address"
msgstr "Адрес"
msgid "Port"
msgstr "Порт"
msgid "Scan Sid"
msgstr "Сканировать SID"
msgid "Scan pids"
msgstr "Сканировать пиды"
msgid "Vtype"
msgstr "Vtype"
msgid "Nid"
msgstr "Nid"
msgid "Tid"
msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Cannot find unique channel settings!"
msgstr "Невозможно найти уникальные настройки канала!"
msgid "IPTV Channels"
msgstr "IPTV каналы"
msgid "IPTV Information" msgid "IPTV Information"
msgstr "IPTV информация" msgstr "IPTV информация"
@ -168,3 +114,30 @@ msgstr "Неправильно работающий фильтр, занести
msgid "Help" msgid "Help"
msgstr "Справка" msgstr "Справка"
msgid "UDP"
msgstr "UDP"
msgid "HTTP"
msgstr "HTTP"
msgid "FILE"
msgstr "ФАЙЛ"
msgid "EXT"
msgstr "EXT"
msgid "Scan sid"
msgstr "Сканировать SID"
msgid "Scan pids"
msgstr "Сканировать пиды"
msgid "Protocol"
msgstr "Протокол"
msgid "Address"
msgstr "Адрес"
msgid "Parameter"
msgstr "Параметр"

View File

@ -53,7 +53,7 @@ void cIptvProtocolExt::ExecuteScript(void)
// Execute the external script // Execute the external script
cString cmd = cString::sprintf("%s %d %d", *scriptFile, scriptParameter, socketPort); cString cmd = cString::sprintf("%s %d %d", *scriptFile, scriptParameter, socketPort);
debug("cIptvProtocolExt::ExecuteScript(child): %s\n", *cmd); debug("cIptvProtocolExt::ExecuteScript(child): %s\n", *cmd);
if (execl("/bin/sh", "sh", "-c", *cmd, NULL) == -1) { if (execl("/bin/sh", "sh", "-c", *cmd, (char *)NULL) == -1) {
error("Script execution failed: %s", *cmd); error("Script execution failed: %s", *cmd);
_exit(-1); _exit(-1);
} }

530
setup.c
View File

@ -5,10 +5,6 @@
* *
*/ */
#include <string.h>
#include <vdr/device.h>
#include <vdr/interface.h>
#include <vdr/status.h> #include <vdr/status.h>
#include <vdr/menu.h> #include <vdr/menu.h>
@ -17,521 +13,6 @@
#include "device.h" #include "device.h"
#include "setup.h" #include "setup.h"
// --- cIptvMenuEditChannel --------------------------------------------------
class cIptvMenuEditChannel : public cOsdMenu
{
private:
enum {
eProtocolUDP,
eProtocolHTTP,
eProtocolFILE,
eProtocolEXT,
eProtocolCount
};
struct tIptvChannel {
int frequency, source, protocol, parameter, vpid, ppid, vtype, tpid, sid, nid, tid, rid;
int apid[MAXAPIDS + 1], dpid[MAXDPIDS + 1], spid[MAXSPIDS + 1], caids[MAXCAIDS + 1];
int sidscan, pidscan;
char name[256], location[256];
} data;
cChannel *channel;
const char *protocols[eProtocolCount];
void Setup(void);
cString GetIptvSettings(const char *Param, int *Parameter, int *SidScan, int *PidScan, int *Protocol);
void GetChannelData(cChannel *Channel);
void SetChannelData(cChannel *Channel);
public:
cIptvMenuEditChannel(cChannel *Channel, bool New = false);
virtual eOSState ProcessKey(eKeys Key);
};
cIptvMenuEditChannel::cIptvMenuEditChannel(cChannel *Channel, bool New)
:cOsdMenu(trVDR("Edit channel"), 16)
{
protocols[eProtocolUDP] = tr("UDP");
protocols[eProtocolHTTP] = tr("HTTP");
protocols[eProtocolFILE] = tr("FILE");
protocols[eProtocolEXT] = tr("EXT");
channel = Channel;
GetChannelData(channel);
if (New) {
channel = NULL;
data.nid = 0;
data.tid = 0;
data.rid = 0;
}
Setup();
}
cString cIptvMenuEditChannel::GetIptvSettings(const char *Param, int *Parameter, int *SidScan, int *PidScan, int *Protocol)
{
char *tag = NULL;
char *proto = NULL;
char *loc = NULL;
if (sscanf(Param, "%a[^|]|S%dP%d|%a[^|]|%a[^|]|%d", &tag, SidScan, PidScan, &proto, &loc, Parameter) == 6) {
cString tagstr(tag, true);
cString protostr(proto, true);
cString locstr(loc, true);
// check if IPTV tag
if (strncasecmp(*tagstr, "IPTV", 4) == 0) {
// check if protocol is supported and update the pointer
if (strncasecmp(*protostr, "UDP", 3) == 0)
*Protocol = eProtocolUDP;
else if (strncasecmp(*protostr, "HTTP", 4) == 0)
*Protocol = eProtocolHTTP;
else if (strncasecmp(*protostr, "FILE", 4) == 0)
*Protocol = eProtocolFILE;
else if (strncasecmp(*protostr, "EXT", 3) == 0)
*Protocol = eProtocolEXT;
else
return NULL;
// return location
return locstr;
}
}
else if (sscanf(Param, "%a[^|]|P%dS%d|%a[^|]|%a[^|]|%d", &tag, PidScan, SidScan, &proto, &loc, Parameter) == 6) {
cString tagstr(tag, true);
cString protostr(proto, true);
cString locstr(loc, true);
// check if IPTV tag
if (strncasecmp(*tagstr, "IPTV", 4) == 0) {
// check if protocol is supported and update the pointer
if (strncasecmp(*protostr, "UDP", 3) == 0)
*Protocol = eProtocolUDP;
else if (strncasecmp(*protostr, "HTTP", 4) == 0)
*Protocol = eProtocolHTTP;
else if (strncasecmp(*protostr, "FILE", 4) == 0)
*Protocol = eProtocolFILE;
else if (strncasecmp(*protostr, "EXT", 3) == 0)
*Protocol = eProtocolEXT;
else
return NULL;
// return location
return locstr;
}
}
return NULL;
}
void cIptvMenuEditChannel::GetChannelData(cChannel *Channel)
{
if (Channel) {
int parameter, protocol, sidscan, pidscan;
data.frequency = Channel->Frequency();
data.source = Channel->Source();
data.vpid = Channel->Vpid();
data.ppid = Channel->Ppid();
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
data.vtype = Channel->Vtype();
#endif
data.tpid = Channel->Tpid();
for (unsigned int i = 0; i < ARRAY_SIZE(data.apid); ++i)
data.apid[i] = Channel->Apid(i);
for (unsigned int i = 0; i < ARRAY_SIZE(data.dpid); ++i)
data.dpid[i] = Channel->Dpid(i);
for (unsigned int i = 0; i < ARRAY_SIZE(data.spid); ++i)
data.spid[i] = Channel->Spid(i);
for (unsigned int i = 0; i < ARRAY_SIZE(data.caids); ++i)
data.caids[i] = Channel->Ca(i);
data.sid = Channel->Sid();
data.nid = Channel->Nid();
data.tid = Channel->Tid();
data.rid = Channel->Rid();
strn0cpy(data.name, Channel->Name(), sizeof(data.name));
strn0cpy(data.location, *GetIptvSettings(Channel->PluginParam(), &parameter, &sidscan, &pidscan, &protocol), sizeof(data.location));
data.sidscan = sidscan;
data.pidscan = pidscan;
data.protocol = protocol;
data.parameter = parameter;
}
else {
data.frequency = 1;
data.source = cSource::FromData(cSource::stPlug);
data.vpid = 0;
data.ppid = 0;
data.vtype = 0;
data.tpid = 0;
for (unsigned int i = 0; i < ARRAY_SIZE(data.apid); ++i)
data.apid[i] = 0;
for (unsigned int i = 0; i < ARRAY_SIZE(data.dpid); ++i)
data.dpid[i] = 0;
for (unsigned int i = 0; i < ARRAY_SIZE(data.spid); ++i)
data.spid[i] = 0;
for (unsigned int i = 0; i < ARRAY_SIZE(data.caids); ++i)
data.caids[i] = 0;
data.sid = 1;
data.nid = 0;
data.tid = 0;
data.rid = 0;
strn0cpy(data.name, "IPTV", sizeof(data.name));
strn0cpy(data.location, "127.0.0.1", sizeof(data.location));
data.sidscan = 0;
data.pidscan = 0;
data.protocol = eProtocolUDP;
data.parameter = 1234;
}
}
void cIptvMenuEditChannel::SetChannelData(cChannel *Channel)
{
if (Channel) {
cString param;
char alangs[MAXAPIDS][MAXLANGCODE2] = { "" };
char dlangs[MAXDPIDS][MAXLANGCODE2] = { "" };
switch (data.protocol) {
case eProtocolEXT:
param = cString::sprintf("IPTV|S%dP%d|EXT|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
break;
case eProtocolFILE:
param = cString::sprintf("IPTV|S%dP%d|FILE|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
break;
case eProtocolHTTP:
param = cString::sprintf("IPTV|S%dP%d|HTTP|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
break;
default:
case eProtocolUDP:
param = cString::sprintf("IPTV|S%dP%d|UDP|%s|%d", data.sidscan, data.pidscan, data.location, data.parameter);
break;
}
char slangs[MAXSPIDS][MAXLANGCODE2] = { "" };
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
Channel->SetPids(data.vpid, data.ppid, data.vtype, data.apid, alangs, data.dpid, dlangs, data.spid, slangs, data.tpid);
#else
Channel->SetPids(data.vpid, data.ppid, data.apid, alangs, data.dpid, dlangs, data.spid, slangs, data.tpid);
#endif
Channel->SetCaIds(data.caids);
Channel->SetId(data.nid, data.tid, data.sid, data.rid);
Channel->SetName(data.name, "", "IPTV");
Channel->SetPlugTransponderData(cSource::stPlug, data.frequency, param);
}
}
void cIptvMenuEditChannel::Setup(void)
{
int current = Current();
Clear();
// IPTV specific settings
Add(new cMenuEditStraItem(tr("Protocol"), &data.protocol,
eProtocolCount, protocols));
switch (data.protocol) {
case eProtocolFILE:
Add(new cMenuEditStrItem(trVDR("File"), data.location, sizeof(data.location)));
Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.parameter, 0, 0xFFFF));
break;
case eProtocolEXT:
Add(new cMenuEditStrItem(tr("Script"), data.location, sizeof(data.location)));
Add(new cMenuEditIntItem(tr("Parameter"), &data.parameter, 0, 0xFFFF));
break;
case eProtocolHTTP:
case eProtocolUDP:
default:
Add(new cMenuEditStrItem(tr("Address"), data.location, sizeof(data.location)));
Add(new cMenuEditIntItem(tr("Port"), &data.parameter, 0, 0xFFFF));
break;
}
cOsdItem *sidScanItem = new cMenuEditBoolItem(tr("Scan Sid"), &data.sidscan);
if (!IptvConfig.GetSectionFiltering())
sidScanItem->SetSelectable(false);
Add(sidScanItem);
Add(new cMenuEditBoolItem(tr("Scan pids"), &data.pidscan));
// Normal settings
Add(new cMenuEditStrItem(trVDR("Name"), data.name, sizeof(data.name)));
Add(new cMenuEditIntItem(trVDR("Frequency"), &data.frequency));
Add(new cMenuEditIntItem(trVDR("Vpid"), &data.vpid, 0, 0x1FFF));
#if defined(APIVERSNUM) && APIVERSNUM >= 10704
Add(new cMenuEditIntItem(tr ("Vtype"), &data.vtype, 0, 0xFF));
#endif
Add(new cMenuEditIntItem(trVDR("Ppid"), &data.ppid, 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("Apid1"), &data.apid[0], 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("Apid2"), &data.apid[1], 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("Dpid1"), &data.dpid[0], 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("Dpid2"), &data.dpid[1], 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("Spid1"), &data.spid[0], 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("Spid2"), &data.spid[1], 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("Tpid"), &data.tpid, 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("CA"), &data.caids[0], 0, 0xFFFF));
Add(new cMenuEditIntItem(trVDR("Sid"), &data.sid, 1, 0xFFFF));
Add(new cMenuEditIntItem(tr ("Nid"), &data.nid, 0, 0xFFFF));
Add(new cMenuEditIntItem(tr ("Tid"), &data.tid, 0, 0xFFFF));
Add(new cMenuEditIntItem(tr ("Rid"), &data.rid, 0, 0x1FFF));
SetCurrent(Get(current));
Display();
}
eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
{
int oldProtocol = data.protocol;
eOSState state = cOsdMenu::ProcessKey(Key);
if (state == osUnknown) {
if (Key == kOk) {
cChannel newchannel;
SetChannelData(&newchannel);
bool uniquityFailed = false;
bool firstIncrement = true;
// Search for identical channels as these will be ignored by vdr
for (cChannel *iteratorChannel = Channels.First(); iteratorChannel;
iteratorChannel = Channels.Next(iteratorChannel)) {
// This is one of the channels cause the uniquity check to fail
if (!iteratorChannel->GroupSep() && iteratorChannel != channel &&
iteratorChannel->GetChannelID() == newchannel.GetChannelID()) {
// See if it has unique Plugin param. If yes then increment
// the corresponding Rid until it is unique
if (strcmp(iteratorChannel->PluginParam(),
newchannel.PluginParam())) {
// If the channel RID is already at maximum, then fail the
// channel modification
if (iteratorChannel->Rid() >= 0x1FFF) {
debug("Cannot increment RID over maximum value\n");
uniquityFailed = true;
break;
}
debug("Incrementing conflicting channel RID\n");
iteratorChannel->SetId(iteratorChannel->Nid(),
iteratorChannel->Tid(),
iteratorChannel->Sid(),
firstIncrement ?
0 : iteratorChannel->Rid() + 1);
// Try zero Rid:s at first increment. Prevents them from
// creeping slowly towards their maximum value
firstIncrement = false;
// Re-set the search and start again
iteratorChannel = Channels.First();
continue;
// Cannot work around by incrementing rid because channels
// are actually copies of each other
}
else {
uniquityFailed = true;
break;
}
}
}
if (!uniquityFailed) {
if (channel) {
SetChannelData(channel);
isyslog("edited channel %d %s", channel->Number(), *channel->ToText());
state = osBack;
}
else {
channel = new cChannel;
SetChannelData(channel);
Channels.Add(channel);
Channels.ReNumber();
isyslog("added channel %d %s", channel->Number(), *channel->ToText());
state = osUser1;
}
Channels.SetModified(true);
}
else {
Skins.Message(mtError, tr("Cannot find unique channel settings!"));
state = osContinue;
}
}
}
if ((Key != kNone) && (data.protocol != oldProtocol)) {
switch (data.protocol) {
case eProtocolEXT:
strn0cpy(data.location, "iptvstream.sh", sizeof(data.location));
data.parameter = 0;
break;
case eProtocolFILE:
strn0cpy(data.location, "/video/stream.ts", sizeof(data.location));
data.parameter = 0;
break;
case eProtocolHTTP:
strn0cpy(data.location, "127.0.0.1/TS/1", sizeof(data.location));
data.parameter = 3000;
break;
default:
case eProtocolUDP:
strn0cpy(data.location, "127.0.0.1", sizeof(data.location));
data.parameter = 1234;
break;
}
Setup();
}
return state;
}
// --- cIptvMenuChannelItem --------------------------------------------------
class cIptvMenuChannelItem : public cOsdItem
{
private:
cChannel *channel;
public:
cIptvMenuChannelItem(cChannel *Channel);
virtual void Set(void);
cChannel *Channel(void) { return channel; }
};
cIptvMenuChannelItem::cIptvMenuChannelItem(cChannel *Channel)
{
channel = Channel;
Set();
}
void cIptvMenuChannelItem::Set(void)
{
SetText(cString::sprintf("%d\t%s", channel->Number(), channel->Name()));
}
// --- cIptvMenuChannels -----------------------------------------------------
class cIptvMenuChannels : public cOsdMenu
{
private:
void Setup(void);
cChannel *GetChannel(int Index) const;
void Propagate(void);
protected:
eOSState Edit(void);
eOSState New(void);
eOSState Delete(void);
eOSState Switch(void);
public:
cIptvMenuChannels();
~cIptvMenuChannels();
virtual eOSState ProcessKey(eKeys Key);
};
cIptvMenuChannels::cIptvMenuChannels(void)
:cOsdMenu(tr("IPTV Channels"), numdigits(Channels.MaxNumber()) + 1)
{
Setup();
Channels.IncBeingEdited();
}
cIptvMenuChannels::~cIptvMenuChannels()
{
Channels.DecBeingEdited();
}
void cIptvMenuChannels::Setup(void)
{
Clear();
for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
if (!channel->GroupSep() && channel->IsPlug() && !strncasecmp(channel->PluginParam(), "IPTV", 4)) {
cIptvMenuChannelItem *item = new cIptvMenuChannelItem(channel);
Add(item);
}
}
SetHelp(trVDR("Button$Edit"), trVDR("Button$New"), trVDR("Button$Delete"), NULL);
Display();
}
cChannel *cIptvMenuChannels::GetChannel(int Index) const
{
cIptvMenuChannelItem *p = dynamic_cast<cIptvMenuChannelItem *>(Get(Index));
return p ? (cChannel *)p->Channel() : NULL;
}
void cIptvMenuChannels::Propagate(void)
{
Channels.ReNumber();
for (cIptvMenuChannelItem *ci = dynamic_cast<cIptvMenuChannelItem *>(First()); ci; ci = dynamic_cast<cIptvMenuChannelItem *>(ci->Next()))
ci->Set();
Display();
Channels.SetModified(true);
}
eOSState cIptvMenuChannels::Switch(void)
{
if (HasSubMenu() || Count() == 0)
return osContinue;
cChannel *ch = GetChannel(Current());
if (ch)
return cDevice::PrimaryDevice()->SwitchChannel(ch, true) ? osEnd : osContinue;
return osEnd;
}
eOSState cIptvMenuChannels::Edit(void)
{
if (HasSubMenu() || Count() == 0)
return osContinue;
cChannel *ch = GetChannel(Current());
if (ch)
return AddSubMenu(new cIptvMenuEditChannel(ch));
return osContinue;
}
eOSState cIptvMenuChannels::New(void)
{
if (HasSubMenu())
return osContinue;
return AddSubMenu(new cIptvMenuEditChannel(GetChannel(Current()), true));
}
eOSState cIptvMenuChannels::Delete(void)
{
if (!HasSubMenu() && Count() > 0) {
int CurrentChannelNr = cDevice::CurrentChannel();
cChannel *CurrentChannel = Channels.GetByNumber(CurrentChannelNr);
int Index = Current();
cChannel *channel = GetChannel(Current());
int DeletedChannel = channel->Number();
// Check if there is a timer using this channel:
if (channel->HasTimer()) {
Skins.Message(mtError, trVDR("Channel is being used by a timer!"));
return osContinue;
}
if (Interface->Confirm(trVDR("Delete channel?"))) {
if (CurrentChannel && channel == CurrentChannel) {
int n = Channels.GetNextNormal(CurrentChannel->Index());
if (n < 0)
n = Channels.GetPrevNormal(CurrentChannel->Index());
CurrentChannel = Channels.Get(n);
CurrentChannelNr = 0; // triggers channel switch below
}
Channels.Del(channel);
cOsdMenu::Del(Index);
Propagate();
isyslog("channel %d deleted", DeletedChannel);
if (CurrentChannel && CurrentChannel->Number() != CurrentChannelNr) {
if (!cDevice::PrimaryDevice()->Replaying() || cDevice::PrimaryDevice()->Transferring())
Channels.SwitchTo(CurrentChannel->Number());
else
cDevice::SetCurrentChannel(CurrentChannel);
}
}
}
return osContinue;
}
eOSState cIptvMenuChannels::ProcessKey(eKeys Key)
{
eOSState state = cOsdMenu::ProcessKey(Key);
switch (state) {
case osUser1: {
cChannel *channel = Channels.Last();
if (channel) {
Add(new cIptvMenuChannelItem(channel), true);
return CloseSubMenu();
}
}
break;
default:
if (state == osUnknown) {
switch (Key) {
case kOk: return Switch();
case kRed: return Edit();
case kGreen: return New();
case kYellow: return Delete();
default: break;
}
}
}
return state;
}
// --- cIptvMenuInfo --------------------------------------------------------- // --- cIptvMenuInfo ---------------------------------------------------------
class cIptvMenuInfo : public cOsdMenu class cIptvMenuInfo : public cOsdMenu
@ -643,7 +124,7 @@ cIptvPluginSetup::cIptvPluginSetup()
disabledFilterNames[i] = tr(section_filter_table[i].description); disabledFilterNames[i] = tr(section_filter_table[i].description);
} }
Setup(); Setup();
SetHelp(trVDR("Channels"), NULL, NULL, trVDR("Button$Info")); SetHelp(NULL, NULL, NULL, trVDR("Button$Info"));
} }
void cIptvPluginSetup::Setup(void) void cIptvPluginSetup::Setup(void)
@ -680,14 +161,6 @@ void cIptvPluginSetup::Setup(void)
Display(); Display();
} }
eOSState cIptvPluginSetup::EditChannel(void)
{
debug("cIptvPluginSetup::EditChannel()\n");
if (HasSubMenu())
return osContinue;
return AddSubMenu(new cIptvMenuChannels());
}
eOSState cIptvPluginSetup::ShowInfo(void) eOSState cIptvPluginSetup::ShowInfo(void)
{ {
debug("cIptvPluginSetup::ShowInfo()\n"); debug("cIptvPluginSetup::ShowInfo()\n");
@ -704,7 +177,6 @@ eOSState cIptvPluginSetup::ProcessKey(eKeys Key)
if (state == osUnknown) { if (state == osUnknown) {
switch (Key) { switch (Key) {
case kRed: return EditChannel();
case kBlue: return ShowInfo(); case kBlue: return ShowInfo();
case kInfo: if (Current() < help.Size()) case kInfo: if (Current() < help.Size())
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), help[Current()])); return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), help[Current()]));

48
setup.h
View File

@ -9,8 +9,55 @@
#define __IPTV_SETUP_H #define __IPTV_SETUP_H
#include <vdr/menuitems.h> #include <vdr/menuitems.h>
#include <vdr/sourceparams.h>
#include "common.h" #include "common.h"
class cIptvTransponderParameters
{
friend class cIptvSourceParam;
private:
int sidscan;
int pidscan;
int protocol;
char address[MaxFileName];
int parameter;
public:
cIptvTransponderParameters(const char *Parameters = NULL);
int SidScan(void) const { return sidscan; }
int PidScan(void) const { return pidscan; }
int Protocol(void) const { return protocol; }
const char *Address(void) const { return address; }
int Parameter(void) const { return parameter; }
void SetSidScan(int SidScan) { sidscan = SidScan; }
void SetPidScan(int PidScan) { pidscan = PidScan; }
void SetProtocol(int Protocol) { protocol = Protocol; }
void SetAddress(const char *Address) { strncpy(address, Address, sizeof(address)); }
void SetParameter(int Parameter) { parameter = Parameter; }
cString ToString(char Type) const;
bool Parse(const char *s);
};
class cIptvSourceParam : public cSourceParam
{
private:
enum {
eProtocolUDP,
eProtocolHTTP,
eProtocolFILE,
eProtocolEXT,
eProtocolCount
};
int param;
cChannel data;
cIptvTransponderParameters itp;
const char *protocols[eProtocolCount];
public:
cIptvSourceParam(char Source, const char *Description);
virtual void SetData(cChannel *Channel);
virtual void GetData(cChannel *Channel);
virtual cOsdItem *GetOsdItem(void);
};
class cIptvPluginSetup : public cMenuSetupPage class cIptvPluginSetup : public cMenuSetupPage
{ {
private: private:
@ -23,7 +70,6 @@ private:
const char *disabledFilterNames[SECTION_FILTER_TABLE_SIZE]; const char *disabledFilterNames[SECTION_FILTER_TABLE_SIZE];
cVector<const char*> help; cVector<const char*> help;
eOSState EditChannel(void);
eOSState ShowInfo(void); eOSState ShowInfo(void);
void Setup(void); void Setup(void);
void StoreFilters(const char *Name, int *Values); void StoreFilters(const char *Name, int *Values);

View File

@ -26,7 +26,7 @@ void cSidScanner::SetStatus(bool On)
void cSidScanner::SetChannel(const cChannel *Channel) void cSidScanner::SetChannel(const cChannel *Channel)
{ {
if (Channel) { if (Channel) {
debug("cSidScanner::SetChannel(): %s\n", Channel->PluginParam()); debug("cSidScanner::SetChannel(): %s\n", Channel->Parameters());
channel = *Channel; channel = *Channel;
} }
else { else {

152
source.c Normal file
View File

@ -0,0 +1,152 @@
/*
* source.c: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#include "common.h"
#include "source.h"
// --- cIptvTransponderParameters --------------------------------------------
cIptvTransponderParameters::cIptvTransponderParameters(const char *Parameters)
: sidscan(0),
pidscan(0),
protocol(eProtocolUDP),
parameter(0)
{
debug("cIptvTransponderParameters::cIptvTransponderParameters(): Parameters=%s\n", Parameters);
memset(&address, 0, sizeof(address));
Parse(Parameters);
}
cString cIptvTransponderParameters::ToString(char Type) const
{
debug("cIptvTransponderParameters::ToString() Type=%c\n", Type);
const char *protocolstr;
switch (protocol) {
case eProtocolEXT:
protocolstr = "EXT";
break;
case eProtocolHTTP:
protocolstr = "HTTP";
break;
case eProtocolFILE:
protocolstr = "FILE";
break;
default:
case eProtocolUDP:
protocolstr = "UDP";
break;
}
return cString::sprintf("S=%d|P=%d|F=%s|U=%s|A=%d", sidscan, pidscan, protocolstr, address, parameter);
}
bool cIptvTransponderParameters::Parse(const char *s)
{
debug("cIptvTransponderParameters::Parse(): s=%s\n", s);
const char *delim = "|";
char *str = (char *)s;
char *saveptr = NULL;
char *token = NULL;
bool found_s = false;
bool found_p = false;
bool found_f = true;
bool found_u = false;
bool found_a = false;
while ((token = (char *)strtok_r(str, delim, &saveptr)) != NULL) {
char *data = token + 1;
if (data && (*data == '=')) {
++data;
switch (*token) {
case 'S':
sidscan = strtol(data, (char **)NULL, 10);
found_s = true;
break;
case 'P':
pidscan = strtol(data, (char **)NULL, 10);
found_p = true;
break;
case 'F':
if (strstr(data, "UDP"))
protocol = eProtocolUDP;
else if (strstr(data, "HTTP"))
protocol = eProtocolHTTP;
else if (strstr(data, "FILE"))
protocol = eProtocolFILE;
else if (strstr(data, "EXT"))
protocol = eProtocolEXT;
else
found_u = false;
break;
case 'U':
strn0cpy(address, data, sizeof(address));
found_u = true;
break;
case 'A':
parameter = strtol(data, (char **)NULL, 10);
found_a = true;
break;
default:
break;
}
}
str = NULL;
}
if (found_s && found_p && found_f && found_u && found_a)
return (true);
error("Invalid channel parameters: %s\n", s);
return (false);
}
// --- cIptvSourceParam ------------------------------------------------------
cIptvSourceParam::cIptvSourceParam(char Source, const char *Description)
: cSourceParam(Source, Description),
param(0)
{
debug("cIptvSourceParam::cIptvSourceParam(): Source=%c Description=%s\n", Source, Description);
protocols[cIptvTransponderParameters::eProtocolUDP] = tr("UDP");
protocols[cIptvTransponderParameters::eProtocolHTTP] = tr("HTTP");
protocols[cIptvTransponderParameters::eProtocolFILE] = tr("FILE");
protocols[cIptvTransponderParameters::eProtocolEXT] = tr("EXT");
}
void cIptvSourceParam::SetData(cChannel *Channel)
{
debug("cIptvSourceParam::SetData(): Channel=%s)\n", Channel->Parameters());
data = *Channel;
itp.Parse(data.Parameters());
param = 0;
}
void cIptvSourceParam::GetData(cChannel *Channel)
{
debug("cIptvSourceParam::GetData(): Channel=%s\n", Channel->Parameters());
data.SetTransponderData(Channel->Source(), Channel->Frequency(), data.Srate(), itp.ToString(Source()), true);
*Channel = data;
}
cOsdItem *cIptvSourceParam::GetOsdItem(void)
{
debug("cIptvSourceParam::GetOsdItem()\n");
switch (param++) {
case 0: return new cMenuEditBoolItem(tr("Scan sid"), &itp.sidscan);
case 1: return new cMenuEditBoolItem(tr("Scan pids"), &itp.pidscan);
case 2: return new cMenuEditStraItem(tr("Protocol"), &itp.protocol, ELEMENTS(protocols), protocols);
case 3: return new cMenuEditStrItem( tr("Address"), itp.address, sizeof(itp.address));
case 4: return new cMenuEditIntItem( tr("Parameter"), &itp.parameter, 0, 0xFFFF);
default: return NULL;
}
return NULL;
}

64
source.h Normal file
View File

@ -0,0 +1,64 @@
/*
* source.h: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __IPTV_SOURCE_H
#define __IPTV_SOURCE_H
#include <vdr/menuitems.h>
#include <vdr/sourceparams.h>
#include "common.h"
class cIptvTransponderParameters
{
friend class cIptvSourceParam;
private:
int sidscan;
int pidscan;
int protocol;
char address[MaxFileName];
int parameter;
public:
enum {
eProtocolUDP,
eProtocolHTTP,
eProtocolFILE,
eProtocolEXT,
eProtocolCount
};
cIptvTransponderParameters(const char *Parameters = NULL);
int SidScan(void) const { return sidscan; }
int PidScan(void) const { return pidscan; }
int Protocol(void) const { return protocol; }
const char *Address(void) const { return address; }
int Parameter(void) const { return parameter; }
void SetSidScan(int SidScan) { sidscan = SidScan; }
void SetPidScan(int PidScan) { pidscan = PidScan; }
void SetProtocol(int Protocol) { protocol = Protocol; }
void SetAddress(const char *Address) { strncpy(address, Address, sizeof(address)); }
void SetParameter(int Parameter) { parameter = Parameter; }
cString ToString(char Type) const;
bool Parse(const char *s);
};
class cIptvSourceParam : public cSourceParam
{
private:
int param;
cChannel data;
cIptvTransponderParameters itp;
const char *protocols[cIptvTransponderParameters::eProtocolCount];
public:
cIptvSourceParam(char Source, const char *Description);
virtual void SetData(cChannel *Channel);
virtual void GetData(cChannel *Channel);
virtual cOsdItem *GetOsdItem(void);
};
#endif // __IPTV_SOURCE_H