diff --git a/HISTORY b/HISTORY index 40ae535..0912eeb 100644 --- a/HISTORY +++ b/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. diff --git a/README b/README index 79a2a7d..9c3d748 100644 --- a/README +++ b/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 diff --git a/iptv.c b/iptv.c index 428d75f..0770527 100644 --- a/iptv.c +++ b/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 { diff --git a/po/de_DE.po b/po/de_DE.po index 1d8109d..ca0b6a7 100644 --- a/po/de_DE.po +++ b/po/de_DE.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: 2007-10-29 21:19+0100\n" "Last-Translator: Tobias Grimm \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" diff --git a/po/fi_FI.po b/po/fi_FI.po index 2250e30..2c01366 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.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: 2007-08-12 23:22+0300\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: \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" diff --git a/po/fr_FR.po b/po/fr_FR.po index 45fcdbd..ebeb678 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -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 \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" diff --git a/po/it_IT.po b/po/it_IT.po index 46a7f45..a4aad99 100644 --- a/po/it_IT.po +++ b/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 \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" diff --git a/po/nl_NL.po b/po/nl_NL.po index fca6c0f..a0bf8f4 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.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-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" diff --git a/po/ru_RU.po b/po/ru_RU.po index 6599a2f..f01df7a 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.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-03-16 12:14+0100\n" "Last-Translator: Alexander Gross \n" "Language-Team: Russian \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 "Сканировать пиды" diff --git a/sidscanner.c b/sidscanner.c index 6f2d6ca..8f4a110 100644 --- a/sidscanner.c +++ b/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); } } diff --git a/sidscanner.h b/sidscanner.h index 7cc024a..b4bb53e 100644 --- a/sidscanner.h +++ b/sidscanner.h @@ -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); diff --git a/source.c b/source.c index fd203c2..03b8a4f 100644 --- a/source.c +++ b/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;