| 939 | } |
| 940 | |
| 941 | QString parseEdid(const QByteArray &edid, QString *vendorOut) { |
| 942 | if (edid.size() < 128) |
| 943 | return {}; |
| 944 | QString pnp = decodePnpId(quint8(edid[8]), quint8(edid[9])); |
| 945 | if (vendorOut) |
| 946 | *vendorOut = pnpVendorName(pnp); |
| 947 | for (int i = 0; i < 4; ++i) { |
| 948 | int off = 54 + i * 18; |
| 949 | if (off + 18 > edid.size()) |
| 950 | break; |
| 951 | if (edid[off] == 0 && edid[off + 1] == 0 |
| 952 | && edid[off + 2] == 0 && edid[off + 3] == char(0xFC)) { |
| 953 | QString name = QString::fromLatin1( |
| 954 | edid.mid(off + 5, 13)).trimmed(); |
| 955 | while (name.endsWith(QChar(0x0a))) |
| 956 | name.chop(1); |
| 957 | if (!name.isEmpty()) |
| 958 | return name; |
| 959 | } |
| 960 | } |
| 961 | return {}; |
| 962 | } |
| 963 | |
| 964 | QVector<Device> scanMonitors() { |
| 965 | QVector<Device> out; |
no test coverage detected