|
a/src/httpfs.cxx |
|
b/src/httpfs.cxx |
|
... |
|
... |
24 |
#include "upmpdutils.hxx"
|
24 |
#include "upmpdutils.hxx"
|
25 |
#include "httpfs.hxx"
|
25 |
#include "httpfs.hxx"
|
26 |
|
26 |
|
27 |
using namespace std;
|
27 |
using namespace std;
|
28 |
using namespace UPnPP;
|
28 |
using namespace UPnPP;
|
|
|
29 |
|
|
|
30 |
// UPnP AV services. We can disable this to help pure OpenHome
|
|
|
31 |
// renderers which having both UPnP AV and OpenHome gets in trouble
|
|
|
32 |
// (Kinsky)
|
|
|
33 |
static string upnpAVDesc(
|
|
|
34 |
"<service>"
|
|
|
35 |
" <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>"
|
|
|
36 |
" <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>"
|
|
|
37 |
" <SCPDURL>/upmpd/RenderingControl.xml</SCPDURL>"
|
|
|
38 |
" <controlURL>/ctl/RenderingControl</controlURL>"
|
|
|
39 |
" <eventSubURL>/evt/RenderingControl</eventSubURL>"
|
|
|
40 |
"</service>"
|
|
|
41 |
"<service>"
|
|
|
42 |
" <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>"
|
|
|
43 |
" <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>"
|
|
|
44 |
" <SCPDURL>/upmpd/AVTransport.xml</SCPDURL>"
|
|
|
45 |
" <controlURL>/ctl/AVTransport</controlURL>"
|
|
|
46 |
" <eventSubURL>/evt/AVTransport</eventSubURL>"
|
|
|
47 |
"</service>"
|
|
|
48 |
"<service>"
|
|
|
49 |
" <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>"
|
|
|
50 |
" <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>"
|
|
|
51 |
" <SCPDURL>/upmpd/ConnectionManager.xml</SCPDURL>"
|
|
|
52 |
" <controlURL>/ctl/ConnectionManager</controlURL>"
|
|
|
53 |
" <eventSubURL>/evt/ConnectionManager</eventSubURL>"
|
|
|
54 |
"</service>"
|
|
|
55 |
);
|
29 |
|
56 |
|
30 |
// The description XML document is the first thing downloaded by
|
57 |
// The description XML document is the first thing downloaded by
|
31 |
// clients and tells them what services we export, and where to find
|
58 |
// clients and tells them what services we export, and where to find
|
32 |
// them. The base data is in /usr/shared/upmpdcli/description.xml, it
|
59 |
// them. The base data is in /usr/shared/upmpdcli/description.xml, it
|
33 |
// has a number of substitutable fields for optional data, like the
|
60 |
// has a number of substitutable fields for optional data, like the
|
|
... |
|
... |
152 |
// Read and setup our (mostly XML) data to make it available from the
|
179 |
// Read and setup our (mostly XML) data to make it available from the
|
153 |
// virtual directory
|
180 |
// virtual directory
|
154 |
bool initHttpFs(unordered_map<string, VDirContent>& files,
|
181 |
bool initHttpFs(unordered_map<string, VDirContent>& files,
|
155 |
const string& datadir,
|
182 |
const string& datadir,
|
156 |
const string& UUID, const string& friendlyname,
|
183 |
const string& UUID, const string& friendlyname,
|
157 |
bool openhome, const string& iconpath,
|
184 |
bool enableAV, bool enableOH,
|
158 |
const string& presentationhtml)
|
185 |
const string& iconpath, const string& presentationhtml)
|
159 |
{
|
186 |
{
|
160 |
if (openhome) {
|
187 |
if (enableOH) {
|
161 |
if (!g_sc2mpd_path.empty()) {
|
188 |
if (!g_sc2mpd_path.empty()) {
|
162 |
ohxmlfilenames.push_back("OHReceiver.xml");
|
189 |
ohxmlfilenames.push_back("OHReceiver.xml");
|
163 |
}
|
190 |
}
|
164 |
xmlfilenames.insert(xmlfilenames.end(), ohxmlfilenames.begin(),
|
191 |
xmlfilenames.insert(xmlfilenames.end(), ohxmlfilenames.begin(),
|
165 |
ohxmlfilenames.end());
|
192 |
ohxmlfilenames.end());
|
|
... |
|
... |
195 |
}
|
222 |
}
|
196 |
if (i == 0) {
|
223 |
if (i == 0) {
|
197 |
// Special for description: set UUID and friendlyname
|
224 |
// Special for description: set UUID and friendlyname
|
198 |
data = regsub1("@UUID@", data, UUID);
|
225 |
data = regsub1("@UUID@", data, UUID);
|
199 |
data = regsub1("@FRIENDLYNAME@", data, friendlyname);
|
226 |
data = regsub1("@FRIENDLYNAME@", data, friendlyname);
|
200 |
if (openhome) {
|
227 |
if (enableAV) {
|
|
|
228 |
data = regsub1("@UPNPAV@", data, upnpAVDesc);
|
|
|
229 |
} else {
|
|
|
230 |
data = regsub1("@UPNPAV@", data, "");
|
|
|
231 |
}
|
|
|
232 |
if (enableOH) {
|
201 |
if (!g_sc2mpd_path.empty()) {
|
233 |
if (!g_sc2mpd_path.empty()) {
|
202 |
ohDesc += ohDescReceive;
|
234 |
ohDesc += ohDescReceive;
|
203 |
}
|
235 |
}
|
204 |
data = regsub1("@OPENHOME@", data, ohDesc);
|
236 |
data = regsub1("@OPENHOME@", data, ohDesc);
|
205 |
} else {
|
237 |
} else {
|