1 From 7f93296d158095f59169d12c4181af060f4b9884 Mon Sep 17 00:00:00 2001
2 From: Alasdair Campbell <alcoheca@gmail.com>
3 Date: Fri, 26 Oct 2012 12:30:04 +0100
4 Subject: [PATCH 14/24] platinum: switch to NPT_UInt64 for bitmask flags
7 .../Source/Devices/MediaServer/PltDidl.cpp | 6 +-
8 .../Platinum/Source/Devices/MediaServer/PltDidl.h | 68 +++++++++++-----------
9 .../Source/Devices/MediaServer/PltMediaItem.cpp | 6 +-
10 .../Source/Devices/MediaServer/PltMediaItem.h | 6 +-
11 .../Devices/MediaServer/PltSyncMediaBrowser.h | 2 +-
12 5 files changed, 44 insertions(+), 44 deletions(-)
14 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
15 index 6ad2ec4..6f72dda 100644
16 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
17 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
18 @@ -56,7 +56,7 @@ const char* didl_namespace_dlna = "urn:schemas-dlna-org:metadata-1-0/";
19 /*----------------------------------------------------------------------
20 | PLT_Didl::ConvertFilterToMask
21 +---------------------------------------------------------------------*/
24 PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
27 @@ -66,7 +66,7 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
28 // a given DIDL property (or set of properties).
29 // These fields are or start with: upnp:, @, res@, res, dc:, container@
31 - NPT_UInt32 mask = 0;
32 + NPT_UInt64 mask = 0;
33 const char* s = filter;
36 @@ -301,7 +301,7 @@ PLT_Didl::ParseTimeStamp(const NPT_String& timestamp, NPT_UInt32& seconds)
38 PLT_Didl::ToDidl(PLT_MediaObject& object, const NPT_String& filter, NPT_String& didl)
40 - NPT_UInt32 mask = ConvertFilterToMask(filter);
41 + NPT_UInt64 mask = ConvertFilterToMask(filter);
43 // Allocate enough space for the didl
45 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
46 index 8d9704f..29ce9ca 100644
47 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
48 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
50 /*----------------------------------------------------------------------
52 +---------------------------------------------------------------------*/
53 -#define PLT_FILTER_MASK_ALL 0xFFFFFFFF
54 +#define PLT_FILTER_MASK_ALL 0xFFFFFFFFFFFFFFFF
56 -#define PLT_FILTER_MASK_CREATOR 0x00000001
57 -#define PLT_FILTER_MASK_ARTIST 0x00000002
58 -#define PLT_FILTER_MASK_ALBUM 0x00000004
59 -#define PLT_FILTER_MASK_GENRE 0x00000008
60 -#define PLT_FILTER_MASK_ALBUMARTURI 0x00000010
61 -#define PLT_FILTER_MASK_DESCRIPTION 0x00000020
62 -#define PLT_FILTER_MASK_SEARCHABLE 0x00000040
63 -#define PLT_FILTER_MASK_CHILDCOUNT 0x00000080
64 -#define PLT_FILTER_MASK_ORIGINALTRACK 0x00000100
65 -#define PLT_FILTER_MASK_ACTOR 0x00000200
66 -#define PLT_FILTER_MASK_AUTHOR 0x00000400
67 -#define PLT_FILTER_MASK_DIRECTOR 0x00000800
68 -#define PLT_FILTER_MASK_DATE 0x00001000
69 -#define PLT_FILTER_MASK_PROGRAMTITLE 0x00002000
70 -#define PLT_FILTER_MASK_SERIESTITLE 0x00004000
71 -#define PLT_FILTER_MASK_EPISODE 0x00008000
72 -#define PLT_FILTER_MASK_TITLE 0x00010000
73 +#define PLT_FILTER_MASK_CREATOR 0x0000000000000001
74 +#define PLT_FILTER_MASK_ARTIST 0x0000000000000002
75 +#define PLT_FILTER_MASK_ALBUM 0x0000000000000004
76 +#define PLT_FILTER_MASK_GENRE 0x0000000000000008
77 +#define PLT_FILTER_MASK_ALBUMARTURI 0x0000000000000010
78 +#define PLT_FILTER_MASK_DESCRIPTION 0x0000000000000020
79 +#define PLT_FILTER_MASK_SEARCHABLE 0x0000000000000040
80 +#define PLT_FILTER_MASK_CHILDCOUNT 0x0000000000000080
81 +#define PLT_FILTER_MASK_ORIGINALTRACK 0x0000000000000100
82 +#define PLT_FILTER_MASK_ACTOR 0x0000000000000200
83 +#define PLT_FILTER_MASK_AUTHOR 0x0000000000000400
84 +#define PLT_FILTER_MASK_DIRECTOR 0x0000000000000800
85 +#define PLT_FILTER_MASK_DATE 0x0000000000001000
86 +#define PLT_FILTER_MASK_PROGRAMTITLE 0x0000000000002000
87 +#define PLT_FILTER_MASK_SERIESTITLE 0x0000000000004000
88 +#define PLT_FILTER_MASK_EPISODE 0x0000000000008000
89 +#define PLT_FILTER_MASK_TITLE 0x0000000000010000
91 -#define PLT_FILTER_MASK_RES 0x00020000
92 -#define PLT_FILTER_MASK_RES_DURATION 0x00040000
93 -#define PLT_FILTER_MASK_RES_SIZE 0x00080000
94 -#define PLT_FILTER_MASK_RES_PROTECTION 0x00100000
95 -#define PLT_FILTER_MASK_RES_RESOLUTION 0x00200000
96 -#define PLT_FILTER_MASK_RES_BITRATE 0x00400000
97 -#define PLT_FILTER_MASK_RES_BITSPERSAMPLE 0x00800000
98 -#define PLT_FILTER_MASK_RES_NRAUDIOCHANNELS 0x01000000
99 -#define PLT_FILTER_MASK_RES_SAMPLEFREQUENCY 0x02000000
100 +#define PLT_FILTER_MASK_RES 0x0000000000020000
101 +#define PLT_FILTER_MASK_RES_DURATION 0x0000000000040000
102 +#define PLT_FILTER_MASK_RES_SIZE 0x0000000000080000
103 +#define PLT_FILTER_MASK_RES_PROTECTION 0x0000000000100000
104 +#define PLT_FILTER_MASK_RES_RESOLUTION 0x0000000000200000
105 +#define PLT_FILTER_MASK_RES_BITRATE 0x0000000000400000
106 +#define PLT_FILTER_MASK_RES_BITSPERSAMPLE 0x0000000000800000
107 +#define PLT_FILTER_MASK_RES_NRAUDIOCHANNELS 0x0000000001000000
108 +#define PLT_FILTER_MASK_RES_SAMPLEFREQUENCY 0x0000000002000000
110 -#define PLT_FILTER_MASK_LONGDESCRIPTION 0x04000000
111 -#define PLT_FILTER_MASK_ICON 0x08000000
112 -#define PLT_FILTER_MASK_RATING 0x10000000
113 +#define PLT_FILTER_MASK_LONGDESCRIPTION 0x0000000004000000
114 +#define PLT_FILTER_MASK_ICON 0x0000000008000000
115 +#define PLT_FILTER_MASK_RATING 0x0000000010000000
117 -#define PLT_FILTER_MASK_TOC 0x20000000
118 -#define PLT_FILTER_MASK_SEARCHCLASS 0x40000000
119 -#define PLT_FILTER_MASK_REFID 0x80000000
120 +#define PLT_FILTER_MASK_TOC 0x0000000020000000
121 +#define PLT_FILTER_MASK_SEARCHCLASS 0x0000000040000000
122 +#define PLT_FILTER_MASK_REFID 0x0000000080000000
124 #define PLT_FILTER_FIELD_TITLE "dc:title"
125 #define PLT_FILTER_FIELD_CREATOR "dc:creator"
126 @@ -156,7 +156,7 @@ public:
130 - static NPT_UInt32 ConvertFilterToMask(const NPT_String& filter);
131 + static NPT_UInt64 ConvertFilterToMask(const NPT_String& filter);
134 #endif /* _PLT_DIDL_H_ */
135 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
136 index b10d75a..31bc16c 100644
137 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
138 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
139 @@ -215,7 +215,7 @@ PLT_MediaObject::ToDidl(const NPT_String& filter, NPT_String& didl)
140 | PLT_MediaObject::ToDidl
141 +---------------------------------------------------------------------*/
143 -PLT_MediaObject::ToDidl(NPT_UInt32 mask, NPT_String& didl)
144 +PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
147 didl += "<dc:title>";
148 @@ -682,7 +682,7 @@ PLT_MediaItem::ToDidl(const NPT_String& filter, NPT_String& didl)
149 | PLT_MediaItem::ToDidl
150 +---------------------------------------------------------------------*/
152 -PLT_MediaItem::ToDidl(NPT_UInt32 mask, NPT_String& didl)
153 +PLT_MediaItem::ToDidl(NPT_UInt64 mask, NPT_String& didl)
155 didl += "<item id=\"";
157 @@ -773,7 +773,7 @@ PLT_MediaContainer::ToDidl(const NPT_String& filter, NPT_String& didl)
158 | PLT_MediaContainer::ToDidl
159 +---------------------------------------------------------------------*/
161 -PLT_MediaContainer::ToDidl(NPT_UInt32 mask, NPT_String& didl)
162 +PLT_MediaContainer::ToDidl(NPT_UInt64 mask, NPT_String& didl)
164 // container id property
165 didl += "<container id=\"";
166 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
167 index fe04f34..2449276 100644
168 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
169 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
170 @@ -196,7 +196,7 @@ public:
172 virtual NPT_Result Reset();
173 virtual NPT_Result ToDidl(const NPT_String& filter, NPT_String& didl);
174 - virtual NPT_Result ToDidl(NPT_UInt32 mask, NPT_String& didl);
175 + virtual NPT_Result ToDidl(NPT_UInt64 mask, NPT_String& didl);
176 virtual NPT_Result FromDidl(NPT_XmlElementNode* entry);
179 @@ -248,7 +248,7 @@ public:
181 // PLT_MediaObject methods
182 NPT_Result ToDidl(const NPT_String& filter, NPT_String& didl);
183 - NPT_Result ToDidl(NPT_UInt32 mask, NPT_String& didl);
184 + NPT_Result ToDidl(NPT_UInt64 mask, NPT_String& didl);
185 NPT_Result FromDidl(NPT_XmlElementNode* entry);
188 @@ -271,7 +271,7 @@ public:
189 // PLT_MediaObject methods
191 NPT_Result ToDidl(const NPT_String& filter, NPT_String& didl);
192 - NPT_Result ToDidl(NPT_UInt32 mask, NPT_String& didl);
193 + NPT_Result ToDidl(NPT_UInt64 mask, NPT_String& didl);
194 NPT_Result FromDidl(NPT_XmlElementNode* entry);
197 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
198 index e8cb7c6..94f1ab3 100644
199 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
200 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
201 @@ -118,7 +118,7 @@ protected:
204 bool browse_metadata = false,
205 - const char* filter = "dc:date,dc:description,upnp:longDescription,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:rating,upnp:episodeNumber,upnp:programTitle,upnp:seriesTitle,upnp:album,upnp:artist,upnp:author,upnp:director,searchable,childCount", // explicitely specify res otherwise WMP won't return a URL!
206 + const char* 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,searchable,childCount", // explicitely specify res otherwise WMP won't return a URL!
207 const char* sort = "");
209 NPT_Result Find(const char* ip, PLT_DeviceDataReference& device);