Use minimal timer access and diagnose failed video image transforms
This commit is contained in:
1 parent
9d45488369
commit
5e38e5b71d
2 files changed
+6
-2
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user