51 #define PLT_FILTER_MASK_ALL 0xFFFFFFFF
53 #define PLT_FILTER_MASK_CREATOR 0x00000001
54 #define PLT_FILTER_MASK_ARTIST 0x00000002
55 #define PLT_FILTER_MASK_ALBUM 0x00000004
56 #define PLT_FILTER_MASK_GENRE 0x00000008
57 #define PLT_FILTER_MASK_ALBUMARTURI 0x00000010
58 #define PLT_FILTER_MASK_DESCRIPTION 0x00000020
59 #define PLT_FILTER_MASK_SEARCHABLE 0x00000040
60 #define PLT_FILTER_MASK_CHILDCOUNT 0x00000080
61 #define PLT_FILTER_MASK_ORIGINALTRACK 0x00000100
62 #define PLT_FILTER_MASK_ACTOR 0x00000200
63 #define PLT_FILTER_MASK_AUTHOR 0x00000400
64 #define PLT_FILTER_MASK_DATE 0x00000800
65 #define PLT_FILTER_MASK_PROGRAMTITLE 0x00001000
66 #define PLT_FILTER_MASK_SERIESTITLE 0x00002000
67 #define PLT_FILTER_MASK_EPISODE 0x00004000
68 #define PLT_FILTER_MASK_TITLE 0x00008000
70 #define PLT_FILTER_MASK_RES 0x00010000
71 #define PLT_FILTER_MASK_RES_DURATION 0x00020000
72 #define PLT_FILTER_MASK_RES_SIZE 0x00040000
73 #define PLT_FILTER_MASK_RES_PROTECTION 0x00080000
74 #define PLT_FILTER_MASK_RES_RESOLUTION 0x00100000
75 #define PLT_FILTER_MASK_RES_BITRATE 0x00200000
76 #define PLT_FILTER_MASK_RES_BITSPERSAMPLE 0x00400000
77 #define PLT_FILTER_MASK_RES_NRAUDIOCHANNELS 0x00800000
78 #define PLT_FILTER_MASK_RES_SAMPLEFREQUENCY 0x01000000
80 #define PLT_FILTER_MASK_LONGDESCRIPTION 0x02000000
81 #define PLT_FILTER_MASK_ICON 0x04000000
83 #define PLT_FILTER_MASK_TOC 0x02000000
84 #define PLT_FILTER_MASK_SEARCHCLASS 0x04000000
85 #define PLT_FILTER_MASK_REFID 0x08000000
87 #define PLT_FILTER_FIELD_TITLE "dc:title"
88 #define PLT_FILTER_FIELD_CREATOR "dc:creator"
89 #define PLT_FILTER_FIELD_DATE "dc:date"
90 #define PLT_FILTER_FIELD_ARTIST "upnp:artist"
91 #define PLT_FILTER_FIELD_ACTOR "upnp:actor"
92 #define PLT_FILTER_FIELD_AUTHOR "upnp:author"
93 #define PLT_FILTER_FIELD_ALBUM "upnp:album"
94 #define PLT_FILTER_FIELD_GENRE "upnp:genre"
95 #define PLT_FILTER_FIELD_ALBUMARTURI "upnp:albumArtURI"
96 #define PLT_FILTER_FIELD_ALBUMARTURI_DLNAPROFILEID "upnp:albumArtURI@dlna:profileID"
97 #define PLT_FILTER_FIELD_DESCRIPTION "dc:description"
98 #define PLT_FILTER_FIELD_LONGDESCRIPTION "upnp:longDescription"
99 #define PLT_FILTER_FIELD_ICON "upnp:icon"
100 #define PLT_FILTER_FIELD_ORIGINALTRACK "upnp:originalTrackNumber"
101 #define PLT_FILTER_FIELD_PROGRAMTITLE "upnp:programTitle"
102 #define PLT_FILTER_FIELD_SERIESTITLE "upnp:seriesTitle"
103 #define PLT_FILTER_FIELD_EPISODE "upnp:episodeNumber"
104 #define PLT_FILTER_FIELD_SEARCHCLASS "upnp:searchClass"
105 #define PLT_FILTER_FIELD_SEARCHABLE "@searchable"
106 #define PLT_FILTER_FIELD_CHILDCOUNT "@childcount"
107 #define PLT_FILTER_FIELD_CONTAINER_CHILDCOUNT "container@childCount"
108 #define PLT_FILTER_FIELD_CONTAINER_SEARCHABLE "container@searchable"
109 #define PLT_FILTER_FIELD_REFID "@refID"
111 #define PLT_FILTER_FIELD_RES "res"
112 #define PLT_FILTER_FIELD_RES_DURATION "res@duration"
113 #define PLT_FILTER_FIELD_RES_DURATION_SHORT "@duration"
114 #define PLT_FILTER_FIELD_RES_SIZE "res@size"
115 #define PLT_FILTER_FIELD_RES_PROTECTION "res@protection"
116 #define PLT_FILTER_FIELD_RES_RESOLUTION "res@resolution"
117 #define PLT_FILTER_FIELD_RES_BITRATE "res@bitrate"
118 #define PLT_FILTER_FIELD_RES_BITSPERSAMPLE "res@bitsPerSample"
119 #define PLT_FILTER_FIELD_RES_NRAUDIOCHANNELS "res@nrAudioChannels"
120 #define PLT_FILTER_FIELD_RES_SAMPLEFREQUENCY "res@sampleFrequency"
122 extern const char* didl_header;
123 extern const char* didl_footer;
124 extern const char* didl_namespace_dc;
125 extern const char* didl_namespace_upnp;
126 extern const char* didl_namespace_dlna;
140 const NPT_String& filter,
142 static NPT_Result FromDidl(
const char* didl,
143 PLT_MediaObjectListReference& objects);
144 static void AppendXmlEscape(NPT_String& out,
const char* in);
145 static void AppendXmlUnEscape(NPT_String& out,
const char* in);
146 static NPT_Result ParseTimeStamp(
const NPT_String& timestamp, NPT_UInt32& seconds);
147 static NPT_String FormatTimeStamp(NPT_UInt32 seconds);
148 static NPT_Result ParseTimeStamp(
const NPT_String& in, NPT_TimeStamp& timestamp) {
150 NPT_Result res = ParseTimeStamp(in, seconds);
151 timestamp = NPT_TimeStamp((
double)seconds);
155 static NPT_UInt32 ConvertFilterToMask(
const NPT_String& filter);