Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / lib / libUPnP / patches / 0040-platinum-add-resume-playerstate.patch
blob2b3387727c06c2572d48ee28eeefcc237f265e78
1 From 12839cbecd96ac0980e7a75a6e1e841688514b18 Mon Sep 17 00:00:00 2001
2 From: phate89 <phates89@gmail.com>
3 Date: Mon, 12 Dec 2016 17:40:10 +0100
4 Subject: [PATCH 1/1] platinum: add resume playerstate
6 ---
7 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp | 2 ++
8 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h | 2 ++
9 .../Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 10 ++++++++++
10 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h | 1 +
11 .../Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h | 2 +-
12 xbmc/network/upnp/UPnP.cpp | 7 ++++++-
13 6 files changed, 22 insertions(+), 2 deletions(-)
15 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
16 index b1ba66f..37d36dd 100644
17 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
18 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
19 @@ -163,6 +163,8 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
20 mask |= PLT_FILTER_MASK_EPISODE_COUNT;
21 } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_EPISODE_SEASON, len, true) == 0) {
22 mask |= PLT_FILTER_MASK_EPISODE_SEASON;
23 + } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_LASTPLAYERSTATE, len, true) == 0) {
24 + mask |= PLT_FILTER_MASK_XBMC_LASTPLAYERSTATE;
25 } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_DATEADDED, len, true) == 0) {
26 mask |= PLT_FILTER_MASK_XBMC_DATEADDED;
27 } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_RATING, len, true) == 0) {
28 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
29 index 1705f9c..b74ed0f 100644
30 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
31 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
32 @@ -102,6 +102,7 @@
33 #define PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER NPT_UINT64_C(0x0001000000000000)
34 #define PLT_FILTER_MASK_XBMC_COUNTRY NPT_UINT64_C(0x0002000000000000)
35 #define PLT_FILTER_MASK_XBMC_USERRATING NPT_UINT64_C(0x0004000000000000)
36 +#define PLT_FILTER_MASK_XBMC_LASTPLAYERSTATE NPT_UINT64_C(0x0008000000000000)
38 #define PLT_FILTER_FIELD_TITLE "dc:title"
39 #define PLT_FILTER_FIELD_CREATOR "dc:creator"
40 @@ -147,6 +148,7 @@
41 #define PLT_FILTER_FIELD_EPISODE_COUNT "upnp:episodeCount"
42 #define PLT_FILTER_FIELD_EPISODE_SEASON "upnp:episodeSeason"
44 +#define PLT_FILTER_FIELD_XBMC_LASTPLAYERSTATE "xbmc:lastPlayerState"
45 #define PLT_FILTER_FIELD_XBMC_DATEADDED "xbmc:dateadded"
46 #define PLT_FILTER_FIELD_XBMC_RATING "xbmc:rating"
47 #define PLT_FILTER_FIELD_XBMC_VOTES "xbmc:votes"
48 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
49 index 96839e4..5324dcb 100644
50 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
51 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
52 @@ -256,6 +256,7 @@ PLT_MediaObject::Reset()
54 m_Resources.Clear();
56 + m_XbmcInfo.last_playerstate = "";
57 m_XbmcInfo.date_added = "";
58 m_XbmcInfo.rating = 0.0f;
59 m_XbmcInfo.votes = 0;
60 @@ -625,6 +626,13 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
61 didl += "</xbmc:userrating>";
64 + // xbmc last playback state
65 + if (mask & PLT_FILTER_MASK_XBMC_LASTPLAYERSTATE && !m_XbmcInfo.last_playerstate.IsEmpty()) {
66 + didl += "<xbmc:lastPlayerState>";
67 + PLT_Didl::AppendXmlEscape(didl, m_XbmcInfo.last_playerstate);
68 + didl += "</xbmc:lastPlayerState>";
69 + }
71 // class is required
72 didl += "<upnp:class";
73 if (!m_ObjectClass.friendly_name.IsEmpty()) {
74 @@ -825,6 +833,8 @@ PLT_MediaObject::FromDidl(NPT_XmlElementNode* entry)
75 m_Resources.Add(resource);
78 + PLT_XmlHelper::GetChildText(entry, "lastPlayerState", m_XbmcInfo.last_playerstate, didl_namespace_xbmc, 2048);
80 PLT_XmlHelper::GetChildText(entry, "dateadded", m_XbmcInfo.date_added, didl_namespace_xbmc, 256);
81 // parse date and make sure it's valid
82 for (int format=0; format<=NPT_DateTime::FORMAT_RFC_1036; format++) {
83 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
84 index 5712b9a..6502297 100644
85 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
86 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
87 @@ -165,6 +165,7 @@ public:
90 typedef struct {
91 + NPT_String last_playerstate;
92 NPT_String date_added;
93 NPT_Float rating;
94 NPT_Int32 votes;
95 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
96 index e52fb5a..1493a50 100644
97 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
98 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
99 @@ -70,7 +70,7 @@ typedef struct PLT_CapabilitiesData {
100 typedef NPT_Reference<PLT_CapabilitiesData> PLT_CapabilitiesDataReference;
102 // explicitely specify res otherwise WMP won't return a URL!
103 -#define PLT_DEFAULT_FILTER "dc:date,dc:description,upnp:longDescription,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:rating,upnp:lastPlaybackPosition,upnp:lastPlaybackTime,upnp:playbackCount,upnp:originalTrackNumber,upnp:episodeNumber,upnp:programTitle,upnp:seriesTitle,upnp:album,upnp:artist,upnp:author,upnp:director,dc:publisher,searchable,childCount,dc:title,dc:creator,upnp:actor,res@resolution,upnp:episodeCount,upnp:episodeSeason,xbmc:dateadded,xbmc:rating,xbmc:votes,xbmc:artwork,xbmc:uniqueidentifier,xbmc:country,xbmc:userrating"
104 +#define PLT_DEFAULT_FILTER "dc:date,dc:description,upnp:longDescription,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:rating,upnp:lastPlaybackPosition,upnp:lastPlaybackTime,upnp:playbackCount,upnp:originalTrackNumber,upnp:episodeNumber,upnp:programTitle,upnp:seriesTitle,upnp:album,upnp:artist,upnp:author,upnp:director,dc:publisher,searchable,childCount,dc:title,dc:creator,upnp:actor,res@resolution,upnp:episodeCount,upnp:episodeSeason,xbmc:lastPlayerState,xbmc:dateadded,xbmc:rating,xbmc:votes,xbmc:artwork,xbmc:uniqueidentifier,xbmc:country,xbmc:userrating"
106 /*----------------------------------------------------------------------
107 | PLT_MediaContainerListener