From 4a64e54c9545aa32e7984ecce9e6db400f1657e6 Mon Sep 17 00:00:00 2001 From: Tae-Young Chung Date: Tue, 5 Jun 2018 10:17:51 +0900 Subject: [PATCH] Migration to OpenCV 3.4.1 imgcv has dependency to OpenCV which is upgraded to 3.4.1. This is a patch for Migration to OpenCV 3.4.1. Change-Id: I19c988f222c606f3d5084b8b046235c360f1e2dc Signed-off-by: Tae-Young Chung --- common/include/mm_util_debug.h | 16 ++++++++-------- imgcv/CMakeLists.txt | 3 +++ imgcv/include/mm_util_imgcv_internal.h | 4 ++-- imgcv/{mm_util_imgcv.c => mm_util_imgcv.cpp} | 0 imgcv/test/mm_util_imgcv_testsuite.c | 2 +- packaging/libmm-utility.spec | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) rename imgcv/{mm_util_imgcv.c => mm_util_imgcv.cpp} (100%) diff --git a/common/include/mm_util_debug.h b/common/include/mm_util_debug.h index 0ef1599..b98ec90 100755 --- a/common/include/mm_util_debug.h +++ b/common/include/mm_util_debug.h @@ -41,23 +41,23 @@ extern "C" #define FONT_COLOR_CYAN "\033[36m" #define mm_util_debug(fmt, arg...) do { \ - LOGD(FONT_COLOR_RESET""fmt"", ##arg); \ + LOGD(FONT_COLOR_RESET#fmt, ##arg); \ } while (0) #define mm_util_info(fmt, arg...) do { \ - LOGI(FONT_COLOR_RESET""fmt"", ##arg); \ + LOGI(FONT_COLOR_RESET#fmt, ##arg); \ } while (0) #define mm_util_warn(fmt, arg...) do { \ - LOGW(FONT_COLOR_RESET""fmt"", ##arg); \ + LOGW(FONT_COLOR_RESET#fmt, ##arg); \ } while (0) #define mm_util_error(fmt, arg...) do { \ - LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \ + LOGE(FONT_COLOR_RED#fmt FONT_COLOR_RESET, ##arg); \ } while (0) #define mm_util_sec_debug(fmt, arg...) do { \ - SECURE_LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \ + SECURE_LOGD(FONT_COLOR_CYAN#fmt FONT_COLOR_RESET, ##arg); \ } while (0) #define mm_util_fenter() do { \ @@ -70,14 +70,14 @@ extern "C" #define mm_util_retm_if(expr, fmt, arg...) do { \ if (expr) { \ - LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \ + LOGE(FONT_COLOR_RED#fmt FONT_COLOR_RESET, ##arg); \ return; \ } \ } while (0) #define mm_util_retvm_if(expr, val, fmt, arg...) do { \ if (expr) { \ - LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \ + LOGE(FONT_COLOR_RED#fmt FONT_COLOR_RESET, ##arg); \ return (val); \ } \ } while (0) @@ -86,7 +86,7 @@ extern "C" #define mm_util_stderror(fmt) do { \ char buf[ERR_BUF_LENGHT] = {0,}; \ strerror_r(errno, buf, ERR_BUF_LENGHT); \ - mm_util_error(fmt" : standard error= [%s]", buf); \ + mm_util_error(#fmt" : standard error= [%s]", buf); \ } while (0) /** diff --git a/imgcv/CMakeLists.txt b/imgcv/CMakeLists.txt index dbc9919..39a4288 100755 --- a/imgcv/CMakeLists.txt +++ b/imgcv/CMakeLists.txt @@ -23,10 +23,13 @@ INCLUDE(FindPkgConfig) pkg_check_modules(${fw_name} REQUIRED ${dependents}) FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") + SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}") ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC") +SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g --w") IF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DTARGET") diff --git a/imgcv/include/mm_util_imgcv_internal.h b/imgcv/include/mm_util_imgcv_internal.h index edd9fee..1682cd4 100755 --- a/imgcv/include/mm_util_imgcv_internal.h +++ b/imgcv/include/mm_util_imgcv_internal.h @@ -21,13 +21,13 @@ #include #include +#include +#include #ifdef __cplusplus extern "C" { #endif -#include -#include typedef struct _mm_util_imgcv_s { IplImage *inImg; diff --git a/imgcv/mm_util_imgcv.c b/imgcv/mm_util_imgcv.cpp similarity index 100% rename from imgcv/mm_util_imgcv.c rename to imgcv/mm_util_imgcv.cpp diff --git a/imgcv/test/mm_util_imgcv_testsuite.c b/imgcv/test/mm_util_imgcv_testsuite.c index 89623af..fced574 100755 --- a/imgcv/test/mm_util_imgcv_testsuite.c +++ b/imgcv/test/mm_util_imgcv_testsuite.c @@ -19,11 +19,11 @@ * */ #include +#include #include #include #include -#include #define MAX_FILENAME_LEN 1024 diff --git a/packaging/libmm-utility.spec b/packaging/libmm-utility.spec index e166334..493e2a4 100755 --- a/packaging/libmm-utility.spec +++ b/packaging/libmm-utility.spec @@ -1,6 +1,6 @@ Name: libmm-utility Summary: Multimedia Framework Utility Library -Version: 0.1.23 +Version: 0.1.24 Release: 0 Group: System/Libraries License: Apache-2.0 @@ -17,7 +17,7 @@ BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gmodule-2.0) BuildRequires: libjpeg-turbo-devel BuildRequires: pkgconfig(libtzplatform-config) -BuildRequires: pkgconfig(opencv) +BuildRequires: pkgconfig(opencv) >= 3.4.1 BuildRequires: pkgconfig(libpng) BuildRequires: giflib-devel BuildRequires: pkgconfig(libbmp) -- 2.7.4