1 From ec171eae6aad8bbf51fdf52c97446db6418c96a1 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Chwia=C5=82a?= <rchwiala@gmail.com>
3 Date: Sat, 17 Jan 2015 15:55:52 +0100
4 Subject: [PATCH] platinum Changes to external subtitles over UPnP works
6 Added custom data to resources field - needed to add some attributes to res.
7 Added new struct PLK_SecResource - needed by Somasung devices. It's not specialized struct (just general one), because I can't find any "sec" specification.
9 .../Source/Devices/MediaServer/PltDidl.cpp | 1 +
10 .../Source/Devices/MediaServer/PltMediaItem.cpp | 41 +++++++++++++++++++++-
11 .../Source/Devices/MediaServer/PltMediaItem.h | 12 +++++++
12 3 files changed, 53 insertions(+), 1 deletion(-)
14 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
15 index 7b853c8..b58aa50 100644
16 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
17 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
18 @@ -48,6 +48,7 @@ const char* didl_header = "<DIDL-Lite xmlns=\"urn:schemas-upnp-org:metad
19 " xmlns:dc=\"http://purl.org/dc/elements/1.1/\""
20 " xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\""
21 " xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\""
22 + " xmlns:sec=\"http://www.sec.co.kr/\""
23 " xmlns:xbmc=\"urn:schemas-xbmc-org:metadata-1-0/\">";
24 const char* didl_footer = "</DIDL-Lite>";
25 const char* didl_namespace_dc = "http://purl.org/dc/elements/1.1/";
26 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
27 index 4db2d45..f937df2 100644
28 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
29 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
30 @@ -528,12 +528,51 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
32 didl += " protocolInfo=\"";
33 PLT_Didl::AppendXmlEscape(didl, m_Resources[i].m_ProtocolInfo.ToString());
36 + /* adding custom data */
37 + NPT_List<NPT_Map<NPT_String, NPT_String>::Entry*>::Iterator entry = m_Resources[i].m_CustomData.GetEntries().GetFirstItem();
41 + PLT_Didl::AppendXmlEscape(didl, (*entry)->GetKey());
43 + PLT_Didl::AppendXmlEscape(didl, (*entry)->GetValue());
50 PLT_Didl::AppendXmlEscape(didl, m_Resources[i].m_Uri);
55 + //sec resources related
56 + for (NPT_Cardinal i = 0; i < m_SecResources.GetItemCount(); i++) {
58 + PLT_Didl::AppendXmlEscape(didl, m_SecResources[i].name);
60 + NPT_List<NPT_Map<NPT_String, NPT_String>::Entry*>::Iterator entry = m_SecResources[i].attributes.GetEntries().GetFirstItem();
64 + PLT_Didl::AppendXmlEscape(didl, (*entry)->GetKey());
66 + PLT_Didl::AppendXmlEscape(didl, (*entry)->GetValue());
73 + PLT_Didl::AppendXmlEscape(didl, m_SecResources[i].value);
76 + PLT_Didl::AppendXmlEscape(didl, m_SecResources[i].name);
81 if ((mask & PLT_FILTER_MASK_XBMC_DATEADDED) && !m_XbmcInfo.date_added.IsEmpty()) {
82 didl += "<xbmc:dateadded>";
83 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
84 index deb4961..6461b81 100644
85 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
86 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
87 @@ -172,6 +172,12 @@ typedef struct {
88 NPT_String unique_identifier;
93 + NPT_Map<NPT_String, NPT_String> attributes;
97 /*----------------------------------------------------------------------
98 | PLT_MediaItemResource
99 +---------------------------------------------------------------------*/
100 @@ -192,6 +198,9 @@ public:
101 NPT_UInt32 m_NbAudioChannels;
102 NPT_String m_Resolution;
103 NPT_UInt32 m_ColorDepth;
104 + /* to add custom data to resource, that are not standard one, or are only
105 + proper for some type of devices (UPnP)*/
106 + NPT_Map<NPT_String, NPT_String> m_CustomData;
109 /*----------------------------------------------------------------------
110 @@ -250,6 +259,9 @@ public:
111 /* resources related */
112 NPT_Array<PLT_MediaItemResource> m_Resources;
114 + /* sec resources related */
115 + NPT_Array<PLT_SecResource> m_SecResources;
118 PLT_XbmcInfo m_XbmcInfo;