14 #include <sys/types.h>
20 #include <QStringList>
34 #include <sys/ioctl.h>
40 #define Z_NULL nullptr
48 QStringList sList = sDeviceType.split(
':', Qt::SkipEmptyParts);
49 QString sLoc =
"LookupUDN(" + sDeviceType +
')';
51 if (sList.size() <= 2)
53 LOG(VB_GENERAL, LOG_ERR, sLoc +
"- bad device type '" +
54 sDeviceType +
"', not enough tokens");
60 QString sName =
"UPnP/UDN/" + sList.last();
61 QString sUDN = config.GetValue(sName,
"");
63 LOG(VB_UPNP, LOG_INFO, sLoc +
" sName=" + sName +
", sUDN=" + sUDN);
66 if (sUDN.isEmpty() || sUDN.startsWith(
"{"))
68 sUDN = QUuid::createUuid().toString();
71 sUDN = sUDN.mid(1, 36);
73 config.SetValue(sName, sUDN);
90 QString protocolStr(
"http-get:*:%1:%2");
91 QStringList protocolList;
92 QStringList::Iterator it;
93 for (it = mimeTypes.begin(); it < mimeTypes.end(); ++it)
97 if (*it ==
"video/mpeg")
99 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_PS_PAL;" + flags);
100 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_PS_NTSC;" + flags);
101 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_PS_SD_DTS;" + flags);
102 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AVC_TS_NA_ISO;" + flags);
103 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_TS_HD_NA_ISO;" + flags);
104 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;" + flags);
105 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AVC_TS_EU_ISO;" + flags);
106 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;" + flags);
108 else if (*it ==
"audio/mpeg")
110 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MP3;" + flags);
111 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MP3X;" + flags);
113 else if (*it ==
"audio/mp4")
115 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AAC_ISO_320;" + flags);
117 else if (*it ==
"audio/vnd.dolby.dd-raw")
119 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AC3;" + flags);
121 else if (*it ==
"audio/x-ms-wma")
123 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=WMAFULL;" + flags);
127 protocolList << protocolStr.arg(*it,
"*");
144 QStringList protocolList;
145 QStringList::Iterator it;
146 for (it = mimeTypes.begin(); it < mimeTypes.end(); ++it)
148 protocolList << QString(
"http-get:*:%1:*").arg(*it);