|
a/src/httpfs.cxx |
|
b/src/httpfs.cxx |
|
... |
|
... |
124 |
" </icon>"
|
124 |
" </icon>"
|
125 |
"</iconList>"
|
125 |
"</iconList>"
|
126 |
);
|
126 |
);
|
127 |
|
127 |
|
128 |
static const string presDesc(
|
128 |
static const string presDesc(
|
129 |
"<presentationURL>/upmpd/presentation.html</presentationURL>"
|
129 |
"<presentationURL>/upmpd/presentation.html</presentationURL>"
|
|
|
130 |
);
|
|
|
131 |
|
|
|
132 |
static const string deviceMedia(
|
|
|
133 |
"<device>"
|
|
|
134 |
"<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>"
|
|
|
135 |
"<friendlyName>@FRIENDLYNAMEMEDIA@</friendlyName>"
|
|
|
136 |
"<UDN>uuid:@UUIDMEDIA@</UDN>"
|
|
|
137 |
"<serviceList>"
|
|
|
138 |
"<service>"
|
|
|
139 |
"<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>"
|
|
|
140 |
"<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>"
|
|
|
141 |
"<SCPDURL>/upmpd/ConnectionManager.xml</SCPDURL>"
|
|
|
142 |
"<controlURL>/ctl1/ConnectionManager</controlURL>"
|
|
|
143 |
"<eventSubURL>/evt1/ConnectionManager</eventSubURL>"
|
|
|
144 |
"</service>"
|
|
|
145 |
"<service>"
|
|
|
146 |
"<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>"
|
|
|
147 |
"<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>"
|
|
|
148 |
"<SCPDURL>/upmpd/ContentDirectory.xml</SCPDURL>"
|
|
|
149 |
"<controlURL>/ctl1/ContentDirectory</controlURL>"
|
|
|
150 |
"<eventSubURL>/evt1/ContentDirectory</eventSubURL>"
|
|
|
151 |
"</service>"
|
|
|
152 |
"</serviceList>"
|
|
|
153 |
"</device>"
|
130 |
);
|
154 |
);
|
131 |
|
155 |
|
132 |
// The base XML description files. !Keep description.xml first!
|
156 |
// The base XML description files. !Keep description.xml first!
|
133 |
static vector<const char *> xmlfilenames =
|
157 |
static vector<const char *> xmlfilenames =
|
134 |
{
|
158 |
{
|
|
... |
|
... |
138 |
|
162 |
|
139 |
// Optional OpenHome service description files
|
163 |
// Optional OpenHome service description files
|
140 |
static vector<const char *> ohxmlfilenames =
|
164 |
static vector<const char *> ohxmlfilenames =
|
141 |
{
|
165 |
{
|
142 |
"OHProduct.xml", "OHInfo.xml", "OHTime.xml", "OHVolume.xml",
|
166 |
"OHProduct.xml", "OHInfo.xml", "OHTime.xml", "OHVolume.xml",
|
143 |
"OHPlaylist.xml", "OHRadio.xml"
|
167 |
"OHPlaylist.xml", "OHRadio.xml", "ContentDirectory.xml"
|
144 |
};
|
168 |
};
|
145 |
|
169 |
|
146 |
/** Read protocol info file. This contains the connection manager
|
170 |
/** Read protocol info file. This contains the connection manager
|
147 |
* protocol info data
|
171 |
* protocol info data
|
148 |
*
|
172 |
*
|
|
... |
|
... |
189 |
// virtual directory
|
213 |
// virtual directory
|
190 |
bool initHttpFs(unordered_map<string, VDirContent>& files,
|
214 |
bool initHttpFs(unordered_map<string, VDirContent>& files,
|
191 |
const string& datadir,
|
215 |
const string& datadir,
|
192 |
const string& UUID, const string& friendlyname,
|
216 |
const string& UUID, const string& friendlyname,
|
193 |
bool enableAV, bool enableOH, bool enableReceiver,
|
217 |
bool enableAV, bool enableOH, bool enableReceiver,
|
194 |
bool enableL16,
|
218 |
bool enableL16, bool enableMediaServer,
|
195 |
const string& iconpath, const string& presentationhtml)
|
219 |
const string& iconpath, const string& presentationhtml)
|
196 |
{
|
220 |
{
|
197 |
if (enableOH) {
|
221 |
if (enableOH) {
|
198 |
if (enableReceiver) {
|
222 |
if (enableReceiver) {
|
199 |
ohxmlfilenames.push_back("OHReceiver.xml");
|
223 |
ohxmlfilenames.push_back("OHReceiver.xml");
|
|
... |
|
... |
238 |
}
|
262 |
}
|
239 |
if (i == 0) {
|
263 |
if (i == 0) {
|
240 |
// Special for description: set UUID and friendlyname
|
264 |
// Special for description: set UUID and friendlyname
|
241 |
data = regsub1("@UUID@", data, UUID);
|
265 |
data = regsub1("@UUID@", data, UUID);
|
242 |
data = regsub1("@FRIENDLYNAME@", data, friendlyname);
|
266 |
data = regsub1("@FRIENDLYNAME@", data, friendlyname);
|
|
|
267 |
|
|
|
268 |
if (enableMediaServer) {
|
|
|
269 |
string msdesc = regsub1("@UUIDMEDIA@", deviceMedia,
|
|
|
270 |
uuidMediaServer(UUID));
|
|
|
271 |
msdesc = regsub1("@FRIENDLYNAMEMEDIA@", msdesc,
|
|
|
272 |
friendlyNameMediaServer(friendlyname));
|
|
|
273 |
data = regsub1("@MEDIASERVER@", data, msdesc);
|
|
|
274 |
} else {
|
|
|
275 |
data = regsub1("@MEDIASERVER@", data, "");
|
|
|
276 |
}
|
|
|
277 |
|
243 |
if (enableAV) {
|
278 |
if (enableAV) {
|
244 |
data = regsub1("@UPNPAV@", data, upnpAVDesc);
|
279 |
data = regsub1("@UPNPAV@", data, upnpAVDesc);
|
245 |
} else {
|
280 |
} else {
|
246 |
data = regsub1("@UPNPAV@", data, "");
|
281 |
data = regsub1("@UPNPAV@", data, "");
|
247 |
}
|
282 |
}
|
|
|
283 |
|
248 |
if (enableOH) {
|
284 |
if (enableOH) {
|
249 |
if (enableReceiver) {
|
285 |
if (enableReceiver) {
|
250 |
ohDesc += ohDescReceive;
|
286 |
ohDesc += ohDescReceive;
|
251 |
}
|
287 |
}
|
252 |
data = regsub1("@OPENHOME@", data, ohDesc);
|
288 |
data = regsub1("@OPENHOME@", data, ohDesc);
|