[ITC][media-vision][Non-ACR][Fix invalid parameters] 11/237711/2
authorTae-Young Chung <ty83.chung@samsung.com>
Fri, 3 Jul 2020 00:56:26 +0000 (09:56 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Fri, 3 Jul 2020 01:04:17 +0000 (10:04 +0900)
Invalid parameter is used to mv_barcode_generate_source().
mv_barcode_qr_ecc_e should be given.
Invalid roi is used to mv_barcode_detect(). When roi is given
a valid value from g_hMvSource should be used.

Change-Id: Ic55890083d595644cfe5a039f8b9704f650b189b
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
src/itc/media-vision/ITs-media-vision-barcode.c
src/itc/media-vision/ITs-media-vision-common.c

index 5805a3464b0ec93dac5b3f7c30911ec48fa818ac..098143d3f2e7a455c34d481cb7243210ab8ba385 100755 (executable)
@@ -292,9 +292,12 @@ int ITc_mv_barcode_detect_p(void)
        g_sPoint.x = 0;
        g_sPoint.y = 0;
        g_sRectangle.point = g_sPoint;
-       g_sRectangle.width = BARCODEWIDTH;
-       g_sRectangle.height = BARCODEHEIGHT;
-       
+
+       nRet = mv_source_get_width(g_hMvSource, &g_sRectangle.width);
+       PRINT_RESULT_NORETURN(MEDIA_VISION_ERROR_NONE, nRet, "DestroyEngine", "Return Value Not Correct");
+       nRet = mv_source_get_height(g_hMvSource, &g_sRectangle.height);
+       PRINT_RESULT_NORETURN(MEDIA_VISION_ERROR_NONE, nRet, "DestroyEngine", "Return Value Not Correct");
+
        nRet = mv_barcode_detect(g_hMvSource, g_hMvEngineConfig, g_sRectangle, MvBarCodeDetectedCB, TESTSTRING);
        PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_barcode_detect", MediaVisionGetError(nRet), DestroyEngine());
        IterateGmainLoop();
index 8d4ac5d6816d09e851f6f9415f9811931fe4bd3d..d834e6188da0bad9467258d7484c49257b27ccfa 100755 (executable)
@@ -289,7 +289,7 @@ bool GenerateBarcode(void)
        nRet = mv_engine_config_set_int_attribute(g_hMvEngineConfig, "MV_BARCODE_GENERATE_ATTR_TEXT", MV_BARCODE_GENERATE_ATTR_TEXT_INVISIBLE);
        PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_int_attribute", MediaVisionGetError(nRet), DestroyEngine());
 
-       nRet = mv_barcode_generate_source(g_hMvEngineConfig, TESTVALUE, MV_BARCODE_QR, MV_BARCODE_QR_MODE_NUMERIC, MV_BARCODE_UPC_E, 1, g_hMvSource);
+       nRet = mv_barcode_generate_source(g_hMvEngineConfig, TESTVALUE, MV_BARCODE_QR, MV_BARCODE_QR_MODE_NUMERIC, MV_BARCODE_QR_ECC_QUARTILE, 1, g_hMvSource);
        PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_barcode_generate_source", MediaVisionGetError(nRet), DestroyEngine());
 
        return 0;