14 #include <sys/types.h>
20 #include <QStringList>
35 #include <sys/ioctl.h>
41 #define Z_NULL nullptr
49 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
50 QStringList sList = sDeviceType.split(
':', QString::SkipEmptyParts);
52 QStringList sList = sDeviceType.split(
':', Qt::SkipEmptyParts);
54 QString sLoc =
"LookupUDN(" + sDeviceType +
')';
56 if (sList.size() <= 2)
58 LOG(VB_GENERAL, LOG_ERR, sLoc +
"- bad device type '" +
59 sDeviceType +
"', not enough tokens");
65 QString sName =
"UPnP/UDN/" + sList.last();
66 QString sUDN = pConfig->
GetValue( sName,
"" );
68 LOG(VB_UPNP, LOG_INFO, sLoc +
" sName=" + sName +
", sUDN=" + sUDN);
71 if (sUDN.isEmpty() || sUDN.startsWith(
"{"))
73 sUDN = QUuid::createUuid().toString();
76 sUDN = sUDN.mid(1, 36);
95 QString protocolStr(
"http-get:*:%1:%2");
96 QStringList protocolList;
97 QStringList::Iterator it;
98 for (it = mimeTypes.begin(); it < mimeTypes.end(); ++it)
102 if (*it ==
"video/mpeg")
104 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_PS_PAL;" + flags);
105 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_PS_NTSC;" + flags);
106 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_PS_SD_DTS;" + flags);
107 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AVC_TS_NA_ISO;" + flags);
108 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_TS_HD_NA_ISO;" + flags);
109 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;" + flags);
110 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AVC_TS_EU_ISO;" + flags);
111 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;" + flags);
113 else if (*it ==
"audio/mpeg")
115 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MP3;" + flags);
116 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=MP3X;" + flags);
118 else if (*it ==
"audio/mp4")
120 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AAC_ISO_320;" + flags);
122 else if (*it ==
"audio/vnd.dolby.dd-raw")
124 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=AC3;" + flags);
126 else if (*it ==
"audio/x-ms-wma")
128 protocolList << protocolStr.arg(*it,
"DLNA.ORG_PN=WMAFULL;" + flags);
131 protocolList << protocolStr.arg(*it,
"*");
147 QStringList protocolList;
148 QStringList::Iterator it;
149 for (it = mimeTypes.begin(); it < mimeTypes.end(); ++it)
151 protocolList << QString(
"http-get:*:%1:*").arg(*it);