Skip to content
Permalink
Browse files

kodi: fix pvr patches

  • Loading branch information...
arthur-liberman committed Apr 19, 2019
1 parent 01f74da commit a5974e41953f22e9580c983dc31c37507f2446c9
@@ -1,7 +1,7 @@
From 6b8c25cda88a3ac8134efe2c96b226e0c8164960 Mon Sep 17 00:00:00 2001
From bdf49cc540bd415052acf8338b2ff6c86c8bf406 Mon Sep 17 00:00:00 2001
From: Arthur Liberman <arthur_liberman@hotmail.com>
Date: Sun, 17 Feb 2019 01:01:59 +0200
Subject: [PATCH] add-hasarchive-and-isplayable-listitem-apis
Date: Fri, 19 Apr 2019 14:59:51 +0300
Subject: [PATCH 1/2] add-hasarchive-and-isplayable-listitem-apis

---
addons/skin.estouchy/media/epg_archive.png | Bin 0 -> 416 bytes
@@ -115,7 +115,7 @@ literal 0
HcmV?d00001

diff --git a/addons/skin.estuary/xml/Variables.xml b/addons/skin.estuary/xml/Variables.xml
index 3096dc8528..344fa85a23 100644
index e4963c6bd5..bcc352d10a 100644
--- a/addons/skin.estuary/xml/Variables.xml
+++ b/addons/skin.estuary/xml/Variables.xml
@@ -3,6 +3,7 @@
@@ -126,15 +126,15 @@ index 3096dc8528..344fa85a23 100644
</variable>
<variable name="AutoCompletionContentVar">
<value condition="System.HasAddon(plugin.program.autocompletion) + !System.HasHiddenInput">plugin://plugin.program.autocompletion?info=autocomplete&amp;&amp;id=$INFO[Control.GetLabel(312).index(1)]&amp;&amp;limit=9</value>
@@ -331,6 +332,7 @@
@@ -337,6 +338,7 @@
<value condition="ListItem.IsCollection">overlays/set.png</value>
<value condition="ListItem.IsPlaying">overlays/watched/OverlayPlaying-List.png</value>
<value condition="ListItem.IsResumable">overlays/watched/resume.png</value>
+ <value condition="ListItem.HasArchive">windows/pvr/archive.png</value>
<value condition="Integer.IsGreater(ListItem.Playcount,0)">$INFO[ListItem.Overlay]</value>
</variable>
<!-- Breadcrumbs -->
@@ -422,6 +424,7 @@
@@ -428,6 +430,7 @@
<value condition="ListItem.HasTimer + !ListItem.TimerIsActive">icons/pvr/PVR-HasTimerDisabled.png</value>
<value condition="ListItem.HasTimerSchedule">icons/pvr/PVR-HasTimerSchedule.png</value>
<value condition="ListItem.HasTimer">icons/pvr/PVR-HasTimer.png</value>
@@ -143,7 +143,7 @@ index 3096dc8528..344fa85a23 100644
<variable name="SeasonEpisodeLabel">
<value condition="String.IsEmpty(ListItem.EpisodeName)">$INFO[ListItem.Season,S]$INFO[ListItem.Episode,E]</value>
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index c9d76335f4..aab340d9b9 100644
index 683d0f71b5..d6a89155d9 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -3665,6 +3665,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
@@ -163,7 +163,7 @@ index c9d76335f4..aab340d9b9 100644
/// \table_row3{ <b>`ListItem.IsEncrypted`</b>,
/// \anchor ListItem_IsEncrypted
/// _boolean_,
@@ -5770,6 +5780,8 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB },
@@ -5776,6 +5786,8 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB },
{ "hastimerschedule", LISTITEM_HASTIMERSCHEDULE },
{ "hasrecording", LISTITEM_HASRECORDING },
{ "isrecording", LISTITEM_ISRECORDING },
@@ -173,7 +173,7 @@ index c9d76335f4..aab340d9b9 100644
{ "isencrypted", LISTITEM_ISENCRYPTED },
{ "progress", LISTITEM_PROGRESS },
diff --git a/xbmc/guilib/guiinfo/GUIInfoLabels.h b/xbmc/guilib/guiinfo/GUIInfoLabels.h
index d9a572e9a4..0c8db560da 100644
index 47c5831d29..4d82980c61 100644
--- a/xbmc/guilib/guiinfo/GUIInfoLabels.h
+++ b/xbmc/guilib/guiinfo/GUIInfoLabels.h
@@ -867,6 +867,8 @@
@@ -186,10 +186,10 @@ index d9a572e9a4..0c8db560da 100644
#define LISTITEM_END (LISTITEM_START + 2500)

diff --git a/xbmc/interfaces/json-rpc/schema/types.json b/xbmc/interfaces/json-rpc/schema/types.json
index d8afcfebf7..68d4a8f93a 100644
index 486e46fc1a..3c368c9058 100644
--- a/xbmc/interfaces/json-rpc/schema/types.json
+++ b/xbmc/interfaces/json-rpc/schema/types.json
@@ -954,7 +954,7 @@
@@ -977,7 +977,7 @@
"firstaired", "hastimer", "isactive", "parentalrating",
"wasactive", "thumbnail", "rating", "originaltitle", "cast",
"director", "writer", "year", "imdbnumber", "hastimerrule",
@@ -198,7 +198,7 @@ index d8afcfebf7..68d4a8f93a 100644
}
},
"PVR.Details.Broadcast": {
@@ -989,7 +989,8 @@
@@ -1012,7 +1012,8 @@
"hastimerrule": { "type": "boolean" },
"hasrecording": { "type": "boolean" },
"recording": { "type": "string" },
@@ -208,7 +208,7 @@ index d8afcfebf7..68d4a8f93a 100644
}
},
"PVR.Fields.Channel": {
@@ -997,7 +998,7 @@
@@ -1020,7 +1021,7 @@
"items": { "type": "string",
"enum": [ "thumbnail", "channeltype", "hidden", "locked", "channel", "lastplayed",
"broadcastnow", "broadcastnext", "uniqueid", "icon", "channelnumber",
@@ -217,7 +217,7 @@ index d8afcfebf7..68d4a8f93a 100644
}
},
"PVR.Details.Channel": {
@@ -1016,7 +1017,8 @@
@@ -1039,7 +1040,8 @@
"icon": { "type": "string" },
"channelnumber": { "type": "integer" },
"subchannelnumber": { "type": "integer" },
@@ -228,10 +228,10 @@ index d8afcfebf7..68d4a8f93a 100644
},
"PVR.Details.ChannelGroup": {
diff --git a/xbmc/pvr/PVRGUIInfo.cpp b/xbmc/pvr/PVRGUIInfo.cpp
index 710f8eb67b..8ca271d5e0 100644
index 7988e610c5..b48937cee1 100644
--- a/xbmc/pvr/PVRGUIInfo.cpp
+++ b/xbmc/pvr/PVRGUIInfo.cpp
@@ -1062,6 +1062,20 @@ bool CPVRGUIInfo::GetListItemAndPlayerBool(const CFileItem *item, const CGUIInfo
@@ -1107,6 +1107,20 @@ bool CPVRGUIInfo::GetListItemAndPlayerBool(const CFileItem *item, const CGUIInfo
{
switch (info.m_info)
{
@@ -253,18 +253,18 @@ index 710f8eb67b..8ca271d5e0 100644
if (item->IsPVRChannel())
{
diff --git a/xbmc/pvr/channels/PVRChannel.cpp b/xbmc/pvr/channels/PVRChannel.cpp
index 173100c0ea..9cb6b98e57 100644
index 3ddc457369..845c86029a 100644
--- a/xbmc/pvr/channels/PVRChannel.cpp
+++ b/xbmc/pvr/channels/PVRChannel.cpp
@@ -47,6 +47,7 @@ CPVRChannel::CPVRChannel(bool bRadio /* = false */)
@@ -46,6 +46,7 @@ CPVRChannel::CPVRChannel(bool bRadio /* = false */)
m_bIsLocked = false;
m_iLastWatched = 0;
m_bChanged = false;
+ m_bHasArchive = false;

m_iEpgId = -1;
m_bEPGCreated = false;
@@ -72,7 +73,17 @@ CPVRChannel::CPVRChannel(const PVR_CHANNEL &channel, unsigned int iClientId)
m_bEPGEnabled = true;
@@ -70,7 +71,17 @@ CPVRChannel::CPVRChannel(const PVR_CHANNEL &channel, unsigned int iClientId)
m_strChannelName = channel.strChannelName;
m_iUniqueId = channel.iUniqueId;
m_strClientChannelName = channel.strChannelName;
@@ -279,19 +279,19 @@ index 173100c0ea..9cb6b98e57 100644
+ {
+ m_strInputFormat = channel.strInputFormat;
+ m_bHasArchive = false;
+ }
+ }
m_iClientEncryptionSystem = channel.iEncryptionSystem;
m_iClientId = iClientId;
m_iLastWatched = 0;
@@ -116,6 +127,7 @@ void CPVRChannel::Serialize(CVariant& value) const
@@ -113,6 +124,7 @@ void CPVRChannel::Serialize(CVariant& value) const
epg->Serialize(value["broadcastnext"]);

value["isrecording"] = IsRecording();
value["isrecording"] = false; // compat
+ value["hasarchive"] = m_bHasArchive;
}

/********** XBMC related channel methods **********/
@@ -182,12 +194,14 @@ bool CPVRChannel::UpdateFromClient(const CPVRChannelPtr &channel)
@@ -176,12 +188,14 @@ bool CPVRChannel::UpdateFromClient(const CPVRChannelPtr &channel)
if (m_clientChannelNumber != channel->m_clientChannelNumber ||
m_strInputFormat != channel->InputFormat() ||
m_iClientEncryptionSystem != channel->EncryptionSystem() ||
@@ -307,8 +307,8 @@ index 173100c0ea..9cb6b98e57 100644

UpdateEncryptionName();
SetChanged();
@@ -304,6 +318,12 @@ bool CPVRChannel::HasRecording(void) const
return epgTag && epgTag->HasRecording();
@@ -299,6 +313,12 @@ void CPVRChannel::SetRadioRDSInfoTag(const std::shared_ptr<CPVRRadioRDSInfoTag>&
m_rdsTag = tag;
}

+bool CPVRChannel::HasArchive(void) const
@@ -321,12 +321,12 @@ index 173100c0ea..9cb6b98e57 100644
{
CSingleLock lock(m_critSection);
diff --git a/xbmc/pvr/channels/PVRChannel.h b/xbmc/pvr/channels/PVRChannel.h
index 243ef7a3af..1995d6ad21 100644
index cf040c3e58..6c6d5f288c 100644
--- a/xbmc/pvr/channels/PVRChannel.h
+++ b/xbmc/pvr/channels/PVRChannel.h
@@ -166,6 +166,11 @@ namespace PVR
@@ -150,6 +150,11 @@ namespace PVR
*/
bool HasRecording(void) const;
void SetRadioRDSInfoTag(const std::shared_ptr<CPVRRadioRDSInfoTag>& tag);

+ /*!
+ * @return True if this channel has a server-side back buffer, false otherwise
@@ -336,7 +336,7 @@ index 243ef7a3af..1995d6ad21 100644
/*!
* @return The path to the icon for this channel.
*/
@@ -457,6 +462,7 @@ namespace PVR
@@ -439,6 +444,7 @@ namespace PVR
time_t m_iLastWatched; /*!< last time channel has been watched */
bool m_bChanged; /*!< true if anything in this entry was changed that needs to be persisted */
CPVRChannelNumber m_channelNumber; /*!< the number this channel has in the currently selected channel group */
@@ -1,14 +1,45 @@
From c9c849f059f7a00c84d6e07316832ab51e1db5da Mon Sep 17 00:00:00 2001
From: Arthur Liberman <arthur_liberman@hotmail.com>
Date: Fri, 19 Apr 2019 15:00:49 +0300
Subject: [PATCH 2/2] add pvr archive support

---
xbmc/FileItem.cpp | 16 +++++
xbmc/FileItem.h | 2 +
.../VideoPlayer/DVDDemuxers/CMakeLists.txt | 2 +
.../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h | 4 +-
.../DVDDemuxers/DVDDemuxFFmpegArchive.cpp | 71 +++++++++++++++++++
.../DVDDemuxers/DVDDemuxFFmpegArchive.h | 24 +++++++
.../DVDDemuxers/DVDFactoryDemuxer.cpp | 12 ++++
.../DVDInputStreams/CMakeLists.txt | 2 +
.../DVDInputStreams/DVDFactoryInputStream.cpp | 17 ++++-
.../DVDInputStreams/DVDInputStream.h | 5 +-
.../DVDInputStreamFFmpegArchive.cpp | 69 ++++++++++++++++++
.../DVDInputStreamFFmpegArchive.h | 34 +++++++++
xbmc/pvr/PVRManager.cpp | 18 ++++-
13 files changed, 269 insertions(+), 7 deletions(-)
create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.cpp
create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.h
create mode 100644 xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.cpp
create mode 100644 xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.h

diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index 9ac946bde3..9612037aec 100644
index 2a423fcfc0..cab6a2d947 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -836,11 +836,21 @@ bool CFileItem::IsEPG() const
@@ -844,11 +844,27 @@ bool CFileItem::IsEPG() const
return HasEPGInfoTag();
}

+bool CFileItem::IsEPGWithArchive() const
+{
+ return (HasEPGInfoTag() && GetEPGInfoTag()->Channel()->HasArchive());
+ if (HasEPGInfoTag())
+ {
+ const std::shared_ptr<CPVRChannel> channel = CServiceBroker::GetPVRManager().ChannelGroups()->GetChannelForEpgTag(GetEPGInfoTag());
+ if (channel)
+ return channel->HasArchive();
+ }
+ return false;
+}
+
bool CFileItem::IsPVRChannel() const
@@ -25,7 +56,7 @@ index 9ac946bde3..9612037aec 100644
{
return HasPVRRecordingInfoTag();
diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h
index 59e673bc17..e8d2d92bfb 100644
index 1e94c0e49e..73326d7929 100644
--- a/xbmc/FileItem.h
+++ b/xbmc/FileItem.h
@@ -222,7 +222,9 @@ public:
@@ -59,7 +90,7 @@ index 48710f847c..90c6542dc5 100644
DVDDemuxVobsub.h
DVDFactoryDemuxer.h)
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h
index 3475f1a40b..eb12cb4276 100644
index f7374b438f..c665597e75 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h
@@ -76,7 +76,7 @@ public:
@@ -81,8 +112,9 @@ index 3475f1a40b..eb12cb4276 100644
unsigned int HLSSelectProgram();

diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.cpp
index e69de29bb2..b1ef0d8eb5 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.cpp
new file mode 100644
index 0000000000..b1ef0d8eb5
--- /dev/null
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.cpp
@@ -0,0 +1,71 @@
+/*
@@ -157,8 +189,9 @@ index e69de29bb2..b1ef0d8eb5 100644
+ m_currentPts += m_seekOffset;
+}
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.h
index e69de29bb2..12c9e4f725 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.h
new file mode 100644
index 0000000000..12c9e4f725
--- /dev/null
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpegArchive.h
@@ -0,0 +1,24 @@
+/*
@@ -236,7 +269,7 @@ index 5f60202bcb..a064f5e215 100644
DVDInputStreamMemory.h
DVDInputStreamNavigator.h
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp
index 7d3656af00..755ba9415d 100644
index ec6be71976..529879157b 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp
@@ -11,6 +11,7 @@
@@ -308,8 +341,9 @@ index 8dc39442c9..c514cd97c7 100644
virtual BitstreamStats GetBitstreamStats() const { return m_stats; }

diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.cpp
index e69de29bb2..5127655d0d 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.cpp
new file mode 100644
index 0000000000..5127655d0d
--- /dev/null
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.cpp
@@ -0,0 +1,69 @@
+/*
@@ -382,8 +416,9 @@ index e69de29bb2..5127655d0d 100644
+ return CDVDInputStream::IsStreamType(type) || type == DVDSTREAM_TYPE_PVR_ARCHIVE;
+}
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.h
index e69de29bb2..f85f5036bc 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.h
new file mode 100644
index 0000000000..f85f5036bc
--- /dev/null
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpegArchive.h
@@ -0,0 +1,34 @@
+/*
@@ -421,10 +456,10 @@ index e69de29bb2..f85f5036bc 100644
+ std::shared_ptr<PVR::CPVRClient> m_client;
+};
diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp
index 161b73ad8b..942b8f706e 100644
index df41b440e2..829afb5655 100644
--- a/xbmc/pvr/PVRManager.cpp
+++ b/xbmc/pvr/PVRManager.cpp
@@ -859,12 +859,24 @@ bool CPVRManager::FillStreamFileItem(CFileItem &fileItem)
@@ -955,12 +955,28 @@ bool CPVRManager::FillStreamFileItem(CFileItem &fileItem)
const CPVRClientPtr client = GetClient(fileItem);
if (client)
{
@@ -441,12 +476,19 @@ index 161b73ad8b..942b8f706e 100644
+ if (error == PVR_ERROR_NOT_IMPLEMENTED)
+ {
+ // PVR_ERROR_NOT_IMPLEMENTED is returned when Play EPG as Live TV is selected.
+ fileItem = CFileItem(fileItem.GetEPGInfoTag()->Channel());
+ return client->FillChannelStreamFileItem(fileItem) == PVR_ERROR_NO_ERROR;
+ const std::shared_ptr<CPVRChannel> channel = CServiceBroker::GetPVRManager().ChannelGroups()->GetChannelForEpgTag(fileItem.GetEPGInfoTag());
+ if (channel)
+ {
+ fileItem = CFileItem(channel);
+ return client->FillChannelStreamFileItem(fileItem) == PVR_ERROR_NO_ERROR;
+ }
+ }
+
+ return error == PVR_ERROR_NO_ERROR;
+ }
}
return false;
}
--
2.20.1.windows.1

0 comments on commit a5974e4

Please sign in to comment.
You can’t perform that action at this time.