Migration to OpenCV 3.4.1 16/181916/1 accepted/tizen/unified/20180621.141332 submit/tizen/20180620.034203 submit/tizen/20180620.084620
authorTae-Young Chung <ty83.chung@samsung.com>
Tue, 5 Jun 2018 01:17:51 +0000 (10:17 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Tue, 19 Jun 2018 03:57:37 +0000 (12:57 +0900)
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 <ty83.chung@samsung.com>
common/include/mm_util_debug.h
imgcv/CMakeLists.txt
imgcv/include/mm_util_imgcv_internal.h
imgcv/mm_util_imgcv.cpp [moved from imgcv/mm_util_imgcv.c with 100% similarity]
imgcv/test/mm_util_imgcv_testsuite.c
packaging/libmm-utility.spec

index 0ef1599..b98ec90 100755 (executable)
@@ -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)
 
 /**
index dbc9919..39a4288 100755 (executable)
@@ -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")
index edd9fee..1682cd4 100755 (executable)
 
 #include <stdio.h>
 #include <string.h>
+#include <opencv2/core.hpp>
+#include <opencv2/imgproc.hpp>
 
 #ifdef __cplusplus
        extern "C" {
 #endif
 
-#include <opencv/cv.h>
-#include <opencv2/imgproc/imgproc_c.h>
 
 typedef struct _mm_util_imgcv_s {
        IplImage *inImg;
index 89623af..fced574 100755 (executable)
  *
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <mm_util_jpeg.h>
 #include <mm_util_imgcv.h>
-#include <mm_util_imgcv_internal.h>
 
 #define MAX_FILENAME_LEN 1024
 
index e166334..493e2a4 100755 (executable)
@@ -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)