From bf820e507de314983686b58c6c47c204552398d3 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 23 Apr 2019 23:30:30 +0200 Subject: [PATCH] Implement PVR addon API v6.0.0 --- pvr.iptvsimple/addon.xml.in | 2 +- pvr.iptvsimple/changelog.txt | 2 ++ src/PVRIptvData.cpp | 7 +++---- src/PVRIptvData.h | 2 +- src/client.cpp | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index a5b6af016..92508902e 100644 --- a/pvr.iptvsimple/addon.xml.in +++ b/pvr.iptvsimple/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.iptvsimple/changelog.txt b/pvr.iptvsimple/changelog.txt index 6fa5db94a..387bbe953 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,5 @@ +v4.0.0 +- Update to PVR addon API v6.0.0 v3.5.7 - Correctly show build version in Kodi diff --git a/src/PVRIptvData.cpp b/src/PVRIptvData.cpp index a8376bf1a..2b546a13a 100644 --- a/src/PVRIptvData.cpp +++ b/src/PVRIptvData.cpp @@ -706,13 +706,13 @@ PVR_ERROR PVRIptvData::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHA return PVR_ERROR_NO_ERROR; } -PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd) +PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd) { P8PLATFORM::CLockObject lock(m_mutex); std::vector::iterator myChannel; for (myChannel = m_channels.begin(); myChannel < m_channels.end(); ++myChannel) { - if (myChannel->iUniqueId != (int) channel.iUniqueId) + if (myChannel->iUniqueId != iChannelUid) continue; if (iStart > m_iLastStart || iEnd > m_iLastEnd) @@ -745,7 +745,7 @@ PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL & tag.iUniqueBroadcastId = myTag->iBroadcastId; tag.strTitle = myTag->strTitle.c_str(); - tag.iUniqueChannelId = channel.iUniqueId; + tag.iUniqueChannelId = iChannelUid; tag.startTime = myTag->startTime + iShift; tag.endTime = myTag->endTime + iShift; tag.strPlotOutline = myTag->strPlotOutline.c_str(); @@ -771,7 +771,6 @@ PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL & } tag.iParentalRating = 0; /* not supported */ tag.iStarRating = 0; /* not supported */ - tag.bNotify = false; /* not supported */ tag.iSeriesNumber = 0; /* not supported */ tag.iEpisodeNumber = 0; /* not supported */ tag.iEpisodePartNumber = 0; /* not supported */ diff --git a/src/PVRIptvData.h b/src/PVRIptvData.h index 0523364b2..95d633481 100644 --- a/src/PVRIptvData.h +++ b/src/PVRIptvData.h @@ -95,7 +95,7 @@ class PVRIptvData : public P8PLATFORM::CThread virtual int GetChannelGroupsAmount(void); virtual PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio); virtual PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group); - virtual PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd); + virtual PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd); virtual void ReaplyChannelsLogos(const char * strNewPath); virtual void ReloadPlayList(const char * strNewPath); virtual void ReloadEPG(const char * strNewPath); diff --git a/src/client.cpp b/src/client.cpp index e959163dc..b3dc701af 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -309,10 +309,10 @@ PVR_ERROR GetDriveSpace(long long *iTotal, long long *iUsed) return PVR_ERROR_NO_ERROR; } -PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd) +PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd) { if (m_data) - return m_data->GetEPGForChannel(handle, channel, iStart, iEnd); + return m_data->GetEPGForChannel(handle, iChannelUid, iStart, iEnd); return PVR_ERROR_SERVER_ERROR; } @@ -415,6 +415,7 @@ long long SeekRecordedStream(long long iPosition, int iWhence /* = SEEK_SET */) long long LengthRecordedStream(void) { return 0; } void DemuxReset(void) {} void DemuxFlush(void) {} +void FillBuffer(bool mode) {} int ReadLiveStream(unsigned char *pBuffer, unsigned int iBufferSize) { return 0; } long long SeekLiveStream(long long iPosition, int iWhence /* = SEEK_SET */) { return -1; } long long LengthLiveStream(void) { return -1; } @@ -432,7 +433,6 @@ PVR_ERROR DeleteTimer(const PVR_TIMER &timer, bool bForceDelete) { return PVR_ER PVR_ERROR UpdateTimer(const PVR_TIMER &timer) { return PVR_ERROR_NOT_IMPLEMENTED; } void DemuxAbort(void) {} DemuxPacket* DemuxRead(void) { return NULL; } -bool IsTimeshifting(void) { return false; } bool IsRealTimeStream(void) { return true; } void PauseStream(bool bPaused) {} bool CanSeekStream(void) { return false; }