diff --git a/HISTORY b/HISTORY index 8473423..3ae4817 100644 --- a/HISTORY +++ b/HISTORY @@ -225,3 +225,12 @@ VDR Plugin 'iptv' Revision History - Made devices to shutdown already in cPluginManager::Stop() to prevent possible crashes while VDR shutdown. + + +================================== +VDR Plugin 'iptv' Revision History +================================== + +2014-XX-XX: Version 2.1.0 + +- Added initial CAM support. diff --git a/device.c b/device.c index 9694396..4f9aa6c 100644 --- a/device.c +++ b/device.c @@ -409,39 +409,66 @@ unsigned int cIptvDevice::CheckData(void) return 0; } -bool cIptvDevice::GetTSPacket(uchar *&Data) +uchar *cIptvDevice::GetData(int *availableP) { //debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); if (isOpenDvrM && tsBufferM && !IsBuffering()) { - if (isPacketDeliveredM) { - tsBufferM->Del(TS_SIZE); - isPacketDeliveredM = false; - // Update buffer statistics - AddBufferStatistic(TS_SIZE, tsBufferM->Available()); - } - int Count = 0; - uchar *p = tsBufferM->Get(Count); - if (p && Count >= TS_SIZE) { + int count = 0; + if (isPacketDeliveredM) + SkipData(TS_SIZE); + uchar *p = tsBufferM->Get(count); + if (p && count >= TS_SIZE) { if (*p != TS_SYNC_BYTE) { - for (int i = 1; i < Count; i++) { + for (int i = 1; i < count; i++) { if (p[i] == TS_SYNC_BYTE) { - Count = i; + count = i; break; } } - tsBufferM->Del(Count); - error("Skipped %d bytes to sync on TS packet", Count); - return false; + tsBufferM->Del(count); + error("Skipped %d bytes to sync on TS packet", count); + return NULL; } isPacketDeliveredM = true; - Data = p; + if (availableP) + *availableP = count; // Update pid statistics AddPidStatistic(ts_pid(p), payload(p)); - return true; + return p; } } + return NULL; +} + +void cIptvDevice::SkipData(int countP) +{ + //debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); + tsBufferM->Del(countP); + isPacketDeliveredM = false; + // Update buffer statistics + AddBufferStatistic(countP, tsBufferM->Available()); +} + +bool cIptvDevice::GetTSPacket(uchar *&dataP) +{ + //debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); + if (tsBufferM) { + if (cCamSlot *cs = CamSlot()) { + if (cs->WantsTsData()) { + int available; + dataP = GetData(&available); + if (dataP) { + dataP = cs->Decrypt(dataP, available); + SkipData(available); + } + return true; + } + } + dataP = GetData(); + return true; + } // Reduce cpu load by preventing busylooping cCondWait::SleepMs(10); - Data = NULL; + dataP = NULL; return true; } diff --git a/device.h b/device.h index 6373962..a002a8e 100644 --- a/device.h +++ b/device.h @@ -96,6 +96,10 @@ protected: virtual bool SetChannelDevice(const cChannel *channelP, bool liveViewP); // for recording +private: + uchar *GetData(int *availableP = NULL); + void SkipData(int countP); + protected: virtual bool SetPid(cPidHandle *handleP, int typeP, bool onP); virtual bool OpenDvr(void); diff --git a/iptv.c b/iptv.c index c1ee373..5decf43 100644 --- a/iptv.c +++ b/iptv.c @@ -13,15 +13,15 @@ #include "device.h" #include "iptvservice.h" -#if defined(APIVERSNUM) && APIVERSNUM < 20000 -#error "VDR-2.0.0 API version or greater is required!" +#if defined(APIVERSNUM) && APIVERSNUM < 20104 +#error "VDR-2.1.4 API version or greater is required!" #endif #ifndef GITVERSION #define GITVERSION "" #endif - const char VERSION[] = "2.0.2" GITVERSION; + const char VERSION[] = "2.1.0" GITVERSION; 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 a4691ae..995917e 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.0.2\n" +"Project-Id-Version: vdr-iptv 2.1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2014-01-08 01:18+0200\n" diff --git a/po/fi_FI.po b/po/fi_FI.po index d01348f..7c583f9 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.0.2\n" +"Project-Id-Version: vdr-iptv 2.1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2014-01-08 01:18+0200\n" diff --git a/po/fr_FR.po b/po/fr_FR.po index 63f623e..61b8289 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.0.2\n" +"Project-Id-Version: vdr-iptv 2.1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2014-01-08 01:18+0200\n" diff --git a/po/it_IT.po b/po/it_IT.po index 52f6aae..bfb2fa4 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.0.2\n" +"Project-Id-Version: vdr-iptv 2.1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2014-01-08 01:18+0200\n" diff --git a/po/nl_NL.po b/po/nl_NL.po index 858f182..44a5eca 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.0.2\n" +"Project-Id-Version: vdr-iptv 2.1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2014-01-08 01:18+0200\n" diff --git a/po/ru_RU.po b/po/ru_RU.po index 02759cb..858fab1 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.0.2\n" +"Project-Id-Version: vdr-iptv 2.1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-08 01:18+0200\n" "PO-Revision-Date: 2014-01-08 01:18+0200\n"