Populate call resolutions from camera modes and test Full HD IPC

This commit is contained in:
evgeny committed 2026-10-19 22:35:05 +02:00
1 parent eb11d2ebc5
commit 7a0bc9516c
3 files changed
+60 -12

No files matched your search

+11 -2
View File
@@ -147,7 +147,16 @@ struct CallCameraCapture::Session : QObject {
quint32 count = 0; in >> count;
if (in.status() != QDataStream::Ok || count > 128) return false;
CallCameraDevices devices;
for (quint32 i = 0; i < count; ++i) { QString name; QByteArray id; in >> name >> id; devices.append({name, id}); }
for (quint32 i = 0; i < count; ++i) {
CallCameraDevice device; quint32 modes = 0; in >> device.name >> device.id >> modes;
if (in.status() != QDataStream::Ok || modes > 256) return false;
for (quint32 j = 0; j < modes; ++j) {
qint32 w = 0, h = 0; in >> w >> h;
if (!validSize(w, h)) return false;
device.modes.append({QSize(w, h), 30});
}
devices.append(device);
}
if (owner) emit owner->devicesChanged(devices);
} else if (type == Stage) {
QString next; in >> next;
@@ -158,7 +167,7 @@ struct CallCameraCapture::Session : QObject {
if (revision == generation) fail(error);
} else if (type == Frame) {
qint64 pts = -1, correction = 0; qint32 w = 0, h = 0; in >> pts >> correction >> w >> h;
if (in.status() != QDataStream::Ok || pts < 0 || correction < 0 || w < 1 || h < 1 || w > 1280 || h > 720 || !pixels) return false;
if (in.status() != QDataStream::Ok || pts < 0 || correction < 0 || !validSize(w, h) || !pixels) return false;
const qint64 now = call_video_playout_now_us();
const bool current = owner && enabled && revision == generation && !failureReported;
if (current && pts <= now && now - pts <= CallCameraMaxFrameAgeUs) {