Use minimal timer access and diagnose failed video image transforms

This commit is contained in:
evgeny committed 2026-10-19 19:24:07 +02:00
1 parent 9d45488369
commit 5e38e5b71d
2 files changed
+6 -2

No files matched your search

+4 -1
View File
@@ -188,7 +188,10 @@ int CallVideoDecoder::receive(call_video_frame& f, QImage& image) {
uint8_t* planes[4] = {output.bits(), nullptr, nullptr, nullptr}; int strides[4] = {(int)output.bytesPerLine(), 0, 0, 0};
if (sws_scale(m->scale, pixels->data, pixels->linesize, 0, pixels->height, planes, strides) != pixels->height)
result = AVERROR_INVALIDDATA;
else image = f.format.rotation ? output.transformed(QTransform().rotate(f.format.rotation)) : output;
else {
image = f.format.rotation ? output.transformed(QTransform().rotate(f.format.rotation)) : output;
if (image.isNull()) result = AVERROR(ENOMEM);
}
}
}
av_frame_free(&copied); av_frame_free(&decoded);
+2 -1
View File
@@ -27,7 +27,8 @@ public:
CallVideoWake() {
#ifdef _WIN32
event = CreateEventW(nullptr, FALSE, FALSE, nullptr);
timer = CreateWaitableTimerExW(nullptr, nullptr, 0x00000002, TIMER_ALL_ACCESS);
constexpr DWORD highResolution = 0x00000002; // CREATE_WAITABLE_TIMER_HIGH_RESOLUTION (Windows 10 1803+).
timer = CreateWaitableTimerExW(nullptr, nullptr, highResolution, TIMER_MODIFY_STATE | SYNCHRONIZE);
if (!timer) {
DEBUG_WARN(DEBUG_CATEGORY_CALL, "video high resolution timer unavailable error=%lu; using regular timer", GetLastError());
timer = CreateWaitableTimerW(nullptr, FALSE, nullptr);