mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Renamed Sid scanner to section id scanner and added experimental Tid/Nid support into it.
This commit is contained in:
parent
170cb56263
commit
8a96e5b327
5
HISTORY
5
HISTORY
@ -141,3 +141,8 @@ VDR Plugin 'iptv' Revision History
|
||||
2010-06-06: Version 0.4.2
|
||||
|
||||
- Updated for vdr-1.7.15.
|
||||
|
||||
2010-xx-xx: Version 0.4.3
|
||||
|
||||
- Renamed Sid scanner to section id scanner and added
|
||||
experimental Tid/Nid support into it.
|
||||
|
4
README
4
README
@ -100,8 +100,8 @@ Configuration:
|
||||
| | | | Stream address (multicast address, URL, file
|
||||
| | | | location, script location)
|
||||
| | | Stream protocol ("UDP", "HTTP", "FILE", "EXT")
|
||||
| | PID Scan ("0" disable, "1" enable)
|
||||
| SID Scan ("0" disable, "1" enable)
|
||||
| | Pid scanner ("0" disable, "1" enable)
|
||||
| Section id (Sid/Nid/Tid) scanner ("0" disable, "1" enable)
|
||||
Unique enumeration
|
||||
|
||||
- UDP multicast rules for iptables firewall
|
||||
|
2
iptv.c
2
iptv.c
@ -16,7 +16,7 @@
|
||||
#error "VDR-1.7.15 API version or greater is required!"
|
||||
#endif
|
||||
|
||||
static const char VERSION[] = "0.4.2";
|
||||
static const char VERSION[] = "0.4.3";
|
||||
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
|
||||
|
||||
class cPluginIptv : public cPlugin {
|
||||
|
@ -5,9 +5,9 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: iptv 0.4.0\n"
|
||||
"Project-Id-Version: iptv 0.4.3\n"
|
||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||
"POT-Creation-Date: 2010-03-04 18:12+0200\n"
|
||||
"POT-Creation-Date: 2010-07-02 15:45+0300\n"
|
||||
"PO-Revision-Date: 2007-10-29 21:19+0100\n"
|
||||
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
|
||||
"Language-Team: German\n"
|
||||
@ -135,8 +135,8 @@ msgstr "Tid"
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
msgid "Scan sid"
|
||||
msgstr "Scanne SID"
|
||||
msgid "Scan section ids"
|
||||
msgstr "Scanne Section IDS"
|
||||
|
||||
msgid "Scan pids"
|
||||
msgstr "Scanne PIDS"
|
||||
|
@ -5,9 +5,9 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: iptv 0.4.0\n"
|
||||
"Project-Id-Version: iptv 0.4.3\n"
|
||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||
"POT-Creation-Date: 2010-03-04 18:12+0200\n"
|
||||
"POT-Creation-Date: 2010-07-02 15:45+0300\n"
|
||||
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
|
||||
"Last-Translator: Rolf Ahrenberg\n"
|
||||
"Language-Team: <vdr@linuxtv.org>\n"
|
||||
@ -150,8 +150,8 @@ msgstr "Lähete-ID"
|
||||
msgid "Rid"
|
||||
msgstr "Radio-ID"
|
||||
|
||||
msgid "Scan sid"
|
||||
msgstr "Etsi palvelu-ID"
|
||||
msgid "Scan section ids"
|
||||
msgstr "Etsi sektiotunnisteet"
|
||||
|
||||
msgid "Scan pids"
|
||||
msgstr "Etsi pidit"
|
||||
|
@ -6,9 +6,9 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: iptv 0.4.0\n"
|
||||
"Project-Id-Version: iptv 0.4.3\n"
|
||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||
"POT-Creation-Date: 2010-03-04 18:12+0200\n"
|
||||
"POT-Creation-Date: 2010-07-02 15:45+0300\n"
|
||||
"PO-Revision-Date: 2008-01-26 13:14+0100\n"
|
||||
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
|
||||
"Language-Team: French\n"
|
||||
@ -152,8 +152,8 @@ msgstr "Tid"
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
msgid "Scan sid"
|
||||
msgstr "Scanne les SID"
|
||||
msgid "Scan section ids"
|
||||
msgstr "Scanne les section ID"
|
||||
|
||||
msgid "Scan pids"
|
||||
msgstr "Scanne les PID"
|
||||
|
12
po/it_IT.po
12
po/it_IT.po
@ -5,9 +5,9 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: iptv 0.4.0\n"
|
||||
"Project-Id-Version: iptv 0.4.3\n"
|
||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||
"POT-Creation-Date: 2010-03-04 18:12+0200\n"
|
||||
"POT-Creation-Date: 2010-07-02 15:45+0300\n"
|
||||
"PO-Revision-Date: 2008-07-13 03:28+0100\n"
|
||||
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
|
||||
"Language-Team: Italian\n"
|
||||
@ -151,8 +151,9 @@ msgstr "Tid"
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
msgid "Scan sid"
|
||||
msgstr "Scansione Sid"
|
||||
#, fuzzy
|
||||
msgid "Scan section ids"
|
||||
msgstr "Scansione Pids"
|
||||
|
||||
msgid "Scan pids"
|
||||
msgstr "Scansione Pids"
|
||||
@ -165,3 +166,6 @@ msgstr "Indirizzo"
|
||||
|
||||
msgid "Parameter"
|
||||
msgstr "Parametro"
|
||||
|
||||
#~ msgid "Scan Sid/Nid/Tid"
|
||||
#~ msgstr "Scansione Sid/Nid/Tid"
|
||||
|
@ -5,9 +5,9 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: iptv 0.4.0\n"
|
||||
"Project-Id-Version: iptv 0.4.3\n"
|
||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||
"POT-Creation-Date: 2010-03-05 09:42+0100\n"
|
||||
"POT-Creation-Date: 2010-07-02 15:45+0300\n"
|
||||
"PO-Revision-Date: 2007-10-29 21:19+0100\n"
|
||||
"Last-Translator: Carel\n"
|
||||
"Language-Team: Dutch\n"
|
||||
@ -150,8 +150,8 @@ msgstr "Tid"
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
msgid "Scan sid"
|
||||
msgstr "Scan SID"
|
||||
msgid "Scan section ids"
|
||||
msgstr "Scan section IDS"
|
||||
|
||||
msgid "Scan pids"
|
||||
msgstr "Scan PIDS"
|
||||
|
@ -5,9 +5,9 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: iptv 0.4.0\n"
|
||||
"Project-Id-Version: iptv 0.4.3\n"
|
||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||
"POT-Creation-Date: 2010-03-04 18:12+0200\n"
|
||||
"POT-Creation-Date: 2010-07-02 15:45+0300\n"
|
||||
"PO-Revision-Date: 2008-03-16 12:14+0100\n"
|
||||
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
|
||||
"Language-Team: Russian <de@li.org>\n"
|
||||
@ -136,8 +136,8 @@ msgstr "Tid"
|
||||
msgid "Rid"
|
||||
msgstr "Rid"
|
||||
|
||||
msgid "Scan sid"
|
||||
msgstr "Сканировать SID"
|
||||
msgid "Scan section ids"
|
||||
msgstr "Сканировать section ids"
|
||||
|
||||
msgid "Scan pids"
|
||||
msgstr "Сканировать пиды"
|
||||
|
79
sidscanner.c
79
sidscanner.c
@ -14,7 +14,11 @@ cSidScanner::cSidScanner(void)
|
||||
{
|
||||
debug("cSidScanner::cSidScanner()\n");
|
||||
channel = cChannel();
|
||||
sidFound = false;
|
||||
nidFound = false;
|
||||
tidFound = false;
|
||||
Set(0x00, 0x00); // PAT
|
||||
Set(0x10, 0x40); // NIT
|
||||
}
|
||||
|
||||
void cSidScanner::SetStatus(bool On)
|
||||
@ -25,6 +29,9 @@ void cSidScanner::SetStatus(bool On)
|
||||
|
||||
void cSidScanner::SetChannel(const cChannel *Channel)
|
||||
{
|
||||
sidFound = false;
|
||||
nidFound = false;
|
||||
tidFound = false;
|
||||
if (Channel) {
|
||||
debug("cSidScanner::SetChannel(): %s\n", Channel->Parameters());
|
||||
channel = *Channel;
|
||||
@ -37,29 +44,59 @@ void cSidScanner::SetChannel(const cChannel *Channel)
|
||||
|
||||
void cSidScanner::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
|
||||
{
|
||||
int newSid = -1, newNid = -1, newTid = -1;
|
||||
|
||||
//debug("cSidScanner::Process()\n");
|
||||
if ((Pid == 0x00) && (Tid == 0x00) && channel.GetChannelID().Valid()) {
|
||||
debug("cSidScanner::Process(): Pid=%d Tid=%02X\n", Pid, Tid);
|
||||
SI::PAT pat(Data, false);
|
||||
if (!pat.CheckCRCAndParse())
|
||||
return;
|
||||
SI::PAT::Association assoc;
|
||||
for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) {
|
||||
if (!assoc.isNITPid()) {
|
||||
if (assoc.getServiceId() != channel.Sid()) {
|
||||
debug("cSidScanner::Process(): Sid=%d\n", assoc.getServiceId());
|
||||
if (!Channels.Lock(true, 10))
|
||||
return;
|
||||
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
|
||||
if (IptvChannel)
|
||||
IptvChannel->SetId(IptvChannel->Nid(), IptvChannel->Tid(),
|
||||
assoc.getServiceId(), IptvChannel->Rid());
|
||||
Channels.Unlock();
|
||||
if (channel.GetChannelID().Valid()) {
|
||||
if ((Pid == 0x00) && (Tid == 0x00)) {
|
||||
debug("cSidScanner::Process(): Pid=%d Tid=%02X\n", Pid, Tid);
|
||||
SI::PAT pat(Data, false);
|
||||
if (!pat.CheckCRCAndParse())
|
||||
return;
|
||||
SI::PAT::Association assoc;
|
||||
for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) {
|
||||
if (!assoc.isNITPid()) {
|
||||
if (assoc.getServiceId() != channel.Sid()) {
|
||||
debug("cSidScanner::Process(): Sid=%d\n", assoc.getServiceId());
|
||||
newSid = assoc.getServiceId();
|
||||
}
|
||||
sidFound = true;
|
||||
break;
|
||||
}
|
||||
SetChannel(NULL);
|
||||
SetStatus(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((Pid == 0x10) && (Tid == 0x40)) {
|
||||
debug("cSidScanner::Process(): Pid=%d Tid=%02X\n", Pid, Tid);
|
||||
SI::NIT nit(Data, false);
|
||||
if (!nit.CheckCRCAndParse())
|
||||
return;
|
||||
SI::NIT::TransportStream ts;
|
||||
for (SI::Loop::Iterator it; nit.transportStreamLoop.getNext(ts, it); ) {
|
||||
if (ts.getTransportStreamId() != channel.Tid()) {
|
||||
debug("cSidScanner::Process(): TSid=%d\n", ts.getTransportStreamId());
|
||||
newTid = ts.getTransportStreamId();
|
||||
}
|
||||
tidFound = true;
|
||||
break; // default to the first one
|
||||
}
|
||||
if (nit.getNetworkId() != channel.Nid()) {
|
||||
debug("cSidScanner::Process(): Nid=%d\n", ts.getTransportStreamId());
|
||||
newNid = nit.getNetworkId();
|
||||
}
|
||||
nidFound = true;
|
||||
}
|
||||
}
|
||||
if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) {
|
||||
if (!Channels.Lock(true, 10))
|
||||
return;
|
||||
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
|
||||
if (IptvChannel)
|
||||
IptvChannel->SetId((newNid < 0) ? IptvChannel->Nid() : newNid, (newTid < 0) ? IptvChannel->Tid() : newTid,
|
||||
(newSid < 0) ? IptvChannel->Sid() : newSid, IptvChannel->Rid());
|
||||
Channels.Unlock();
|
||||
}
|
||||
if (sidFound && nidFound && tidFound) {
|
||||
SetChannel(NULL);
|
||||
SetStatus(false);
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,9 @@
|
||||
class cSidScanner : public cFilter {
|
||||
private:
|
||||
cChannel channel;
|
||||
bool sidFound;
|
||||
bool nidFound;
|
||||
bool tidFound;
|
||||
|
||||
protected:
|
||||
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
||||
|
16
source.c
16
source.c
@ -160,14 +160,14 @@ cOsdItem *cIptvSourceParam::GetOsdItem(void)
|
||||
{
|
||||
debug("cIptvSourceParam::GetOsdItem()\n");
|
||||
switch (param++) {
|
||||
case 0: return new cMenuEditIntItem( tr("Nid"), &nid, 0);
|
||||
case 1: return new cMenuEditIntItem( tr("Tid"), &tid, 0);
|
||||
case 2: return new cMenuEditIntItem( tr("Rid"), &rid, 0);
|
||||
case 3: return new cMenuEditBoolItem(tr("Scan sid"), &itp.sidscan);
|
||||
case 4: return new cMenuEditBoolItem(tr("Scan pids"), &itp.pidscan);
|
||||
case 5: return new cMenuEditStraItem(tr("Protocol"), &itp.protocol, ELEMENTS(protocols), protocols);
|
||||
case 6: return new cMenuEditStrItem( tr("Address"), itp.address, sizeof(itp.address));
|
||||
case 7: return new cMenuEditIntItem( tr("Parameter"), &itp.parameter, 0, 0xFFFF);
|
||||
case 0: return new cMenuEditIntItem( tr("Nid"), &nid, 0);
|
||||
case 1: return new cMenuEditIntItem( tr("Tid"), &tid, 0);
|
||||
case 2: return new cMenuEditIntItem( tr("Rid"), &rid, 0);
|
||||
case 3: return new cMenuEditBoolItem(tr("Scan section ids"), &itp.sidscan);
|
||||
case 4: return new cMenuEditBoolItem(tr("Scan pids"), &itp.pidscan);
|
||||
case 5: return new cMenuEditStraItem(tr("Protocol"), &itp.protocol, ELEMENTS(protocols), protocols);
|
||||
case 6: return new cMenuEditStrItem( tr("Address"), itp.address, sizeof(itp.address));
|
||||
case 7: return new cMenuEditIntItem( tr("Parameter"), &itp.parameter, 0, 0xFFFF);
|
||||
default: return NULL;
|
||||
}
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user