From 7a0dfbcda92cd9a2c0e7158d9ebc2264a62a3da1 Mon Sep 17 00:00:00 2001 From: hunbernd Date: Sun, 22 Nov 2020 21:58:56 +0100 Subject: [PATCH] Fixed includes and macros for newer opencv --- plugins/VOIP/VOIP.pro | 9 ++++++++- plugins/VOIP/VOIPPlugin.cpp | 2 +- plugins/VOIP/gui/QVideoDevice.cpp | 5 +++-- plugins/VOIP/gui/VideoProcessor.cpp | 14 +++++++------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/plugins/VOIP/VOIP.pro b/plugins/VOIP/VOIP.pro index 20feb82c6..ca5b13b7b 100644 --- a/plugins/VOIP/VOIP.pro +++ b/plugins/VOIP/VOIP.pro @@ -121,10 +121,17 @@ win32 { message(Use system opencv libraries.) LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc } - LIBS += -lzlib -lole32 -loleaut32 -luuid -lvfw32 -llibjpeg-turbo -llibtiff -llibpng -llibjasper -lIlmImf + LIBS += -lole32 -loleaut32 -luuid -lvfw32 LIBS += -lavifil32 -lavicap32 -lavcodec -lavutil -lswresample + + # Check for msys2 + !isEmpty(PREFIX_MSYS2) { + message(Use msys2 opencv4.) + INCLUDEPATH += "$${PREFIX_MSYS2}/include/opencv4" + } } + #################################### MacOSX ##################################### macx { diff --git a/plugins/VOIP/VOIPPlugin.cpp b/plugins/VOIP/VOIPPlugin.cpp index 1f5a31b2e..e5b412858 100644 --- a/plugins/VOIP/VOIPPlugin.cpp +++ b/plugins/VOIP/VOIPPlugin.cpp @@ -38,7 +38,7 @@ #include "gui/SoundManager.h" #include "gui/chat/ChatWidget.h" -#include +#include #include #define IMAGE_VOIP ":/images/talking_on.svg" diff --git a/plugins/VOIP/gui/QVideoDevice.cpp b/plugins/VOIP/gui/QVideoDevice.cpp index c6db0f4f9..1a3d084db 100644 --- a/plugins/VOIP/gui/QVideoDevice.cpp +++ b/plugins/VOIP/gui/QVideoDevice.cpp @@ -18,8 +18,9 @@ * * *******************************************************************************/ -#include -#include +#include +#include +#include #include #include diff --git a/plugins/VOIP/gui/VideoProcessor.cpp b/plugins/VOIP/gui/VideoProcessor.cpp index fa8437008..b9d867cf3 100644 --- a/plugins/VOIP/gui/VideoProcessor.cpp +++ b/plugins/VOIP/gui/VideoProcessor.cpp @@ -473,10 +473,10 @@ FFmpegVideo::FFmpegVideo() encoding_context->rc_max_rate = 0; encoding_context->rc_buffer_size = 0; #endif - if (encoding_codec->capabilities & CODEC_CAP_TRUNCATED) - encoding_context->flags |= CODEC_FLAG_TRUNCATED; - encoding_context->flags |= CODEC_FLAG_PSNR;//Peak signal-to-noise ratio - encoding_context->flags |= CODEC_CAP_PARAM_CHANGE; + if (encoding_codec->capabilities & AV_CODEC_CAP_TRUNCATED) + encoding_context->flags |= AV_CODEC_FLAG_TRUNCATED; + encoding_context->flags |= AV_CODEC_FLAG_PSNR;//Peak signal-to-noise ratio + encoding_context->flags |= AV_CODEC_CAP_PARAM_CHANGE; encoding_context->i_quant_factor = 0.769f; encoding_context->b_quant_factor = 1.4f; encoding_context->time_base.num = 1; @@ -569,10 +569,10 @@ FFmpegVideo::FFmpegVideo() decoding_context->pix_fmt = AV_PIX_FMT_YUV420P; #endif - if(decoding_codec->capabilities & CODEC_CAP_TRUNCATED) - decoding_context->flags |= CODEC_FLAG_TRUNCATED; // we do not send complete frames + if(decoding_codec->capabilities & AV_CODEC_CAP_TRUNCATED) + decoding_context->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames //we can receive truncated frames - decoding_context->flags2 |= CODEC_FLAG2_CHUNKS; + decoding_context->flags2 |= AV_CODEC_FLAG2_CHUNKS; AVDictionary* dictionary = NULL; if(avcodec_open2(decoding_context, decoding_codec, &dictionary) < 0)