# Configure for porting layer:
-option(MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT
- "Turn on building of licensed port of the barcode detecting module (if OFF - open port will be built)." OFF)
-option(MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
- "Turn on building of licensed port of the barcode generating module (if OFF - open port will be built)." OFF)
option(MEDIA_VISION_IMAGE_LICENSE_PORT
"Turn on building of licensed port of the image module (if OFF - open port will be built)." OFF)
option(MEDIA_VISION_FACE_LICENSE_PORT
message(STATUS "In_dir ${INC_DIR}")
-if(MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT)
- add_definitions(-DMEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT)
- SET(INC_BARCODE_DETECTOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_detector_lic/include")
-else()
- SET(INC_BARCODE_DETECTOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_detector/include")
-endif()
-
-if(MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT)
- add_definitions(-DMEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT)
- SET(INC_BARCODE_GENERATOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_generator_lic/include")
-else()
- SET(INC_BARCODE_GENERATOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_generator/include")
-endif()
+SET(INC_BARCODE_DETECTOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_detector/include")
+SET(INC_BARCODE_GENERATOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_generator/include")
if(MEDIA_VISION_IMAGE_LICENSE_PORT)
add_definitions(-DMEDIA_VISION_IMAGE_LICENSE_PORT)
2. USAGE OF PORTING LAYER FOR CHANGING MEDIA VISION ENGINE MODULES
-By default open source engine libraries are used to provide modules
-functionality. But it is possible to substitute them by licensed or other custom
-libraries. To enable building of custom library for the Media Vision package,
-follow these steps:
-
-a. Find CMakeLists.txt in the root of the package directory and change
- MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT (for enabling build of a custom
- barcode detector library) and/or
- MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT (for enabling build of a custom
- barcode generator library) and/or
- MEDIA_VISION_FACE_LICENSE_PORT (for enabling build of a custom Media Vision
- Face library) and/or MEDIA_VISION_IMAGE_LICENSE_PORT (for enabling build of
- a custom Media Vision Image library) options to ON. Example:
-
- # only barcode detector module will be customized
- option(MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT "..." ON)
- # barcode generator module will be default
- option(MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT "..." OFF)
- # face module will be default
- option(MEDIA_VISION_FACE_LICENSE_PORT "..." OFF)
- # image module will be default
- option(MEDIA_VISION_IMAGE_LICENSE_PORT "..." OFF)
-
-b. Options change will cause CMake to build from different subdirectories of
- mv_barcode/mv_face/mv_image directories. mv_barcode/barcode_detector,
- mv_barcode/barcode_generator, mv_face/face, mv_image/image subdirectories are
- used by default. mv_barcode/barcode_detector_lic,
- mv_barcode/mv_barcode_generator_lic, mv_face/face_lic, mv_image/image_lic
- subdirectories will be used during build if the corresponding option in ON.
- *_lic subdirectories already include base structure of the porting layer
- projects, and files will be used by main capi-media-vision library. Use this
- files to call functions from custom libraries. For example, you can change
- mv_barcode_detect_lic.c file in such a way:
-
- #include "mv_barcode_detect_lic.h"
- #include "custom_library_header.h"
-
- int mv_barcode_detect_lic(
- mv_source_h source,
- mv_engine_config_h engine_cfg,
- mv_rectangle_s roi,
- mv_barcode_on_detected_cb detect_cb,
- void *user_data)
- {
- mv_quadrangle_s *locations = NULL;
- const char *messages = NULL;
- mv_barcode_type_e *types = NULL;
-
- // Here the call of the custom barcode detection function from
- // custom_library_header.h:
- int barcodes_number = custom_library_function(
- source, roi, &locations, &messages, &types);
-
- if (barcodes_number > 0)
- {
- detect_cb(
- source, engine_cfg, locations, messages, types, barcodes_number,
- user_data);
- delete[] locations;
- delete[] messages;
- delete[] types;
- }
-
- return MEDIA_VISION_ERROR_NONE;
- }
-
-c. Change the packaging/capi-media-vision.spec to support any packages required
- to be found into the system for success build of the custom libraries.
- You also can remove requirements on open packages that are required by
- disabled barcode generator/detector, face, image ports. See list of the
- dependencies in the section 3 of this README file.
-
-d. Modify mv_barcode/<name_of_the_(sub)module>_lic/CMakeLists.txt file for
- linking required libraries and/or including additional headers. Don't modify
- the project name or reset ${MV_BARCODE_DETECTOR_LIB_NAME},
- ${MV_BARCODE_GENERATOR_LIB_NAME}, ${MV_FACE_LIB_NAME}, ${MV_IMAGE_LIB_NAME}
- variables, because porting layer use these ones during the build. If it is
- required to change projects/libraries names, best solution is to change
- MV_BARCODE_DETECTOR_LIB_NAME, MV_BARCODE_GENERATOR_LIB_NAME,
- MV_FACE_LIB_NAME, MV_IMAGE_LIB_NAME options in the CMakeLists.txt file that
- is located in the root of the package sources.
-
+Deprecated
3. OPEN PORT REQUIRED PACKAGES
project(mv_barcode)
cmake_minimum_required(VERSION 2.6)
-if(MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT)
- add_subdirectory(${PROJECT_SOURCE_DIR}/barcode_detector_lic) # Licensed port
-else()
- add_subdirectory(${PROJECT_SOURCE_DIR}/barcode_detector) # Open port
-endif()
-
-if(MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT)
- add_subdirectory(${PROJECT_SOURCE_DIR}/barcode_generator_lic) # Licened port
-else()
- add_subdirectory(${PROJECT_SOURCE_DIR}/barcode_generator) # Open port
-endif()
+add_subdirectory(${PROJECT_SOURCE_DIR}/barcode_detector)
+add_subdirectory(${PROJECT_SOURCE_DIR}/barcode_generator)
#include "mv_private.h"
#include "mv_barcode_detect.h"
-#ifdef MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT
-
-/* Include headers of licensed barcode detect module here. */
-#include "mv_barcode_detect_lic.h"
-
-#else
-
/* Include headers of open barcode detect module here. */
#include "mv_barcode_detect_open.h"
-#endif /* MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT */
-
/**
* @file mv_barcode_detect.c
* @brief This file contains the porting layer for Media Vision barcode module.
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
-#ifdef MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT
-
- /* Use licensed barcode detect functionality here. */
- ret = mv_barcode_detect_lic(
- source, engine_cfg, roi, detect_cb, user_data);
-
-#else
-
/* Use open barcode detect functionality here. */
ret = mv_barcode_detect_open(
source, engine_cfg, roi, detect_cb, user_data);
-#endif /* MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT */
-
MEDIA_VISION_FUNCTION_LEAVE();
return ret;
}
+++ /dev/null
-project(${MV_BARCODE_DETECTOR_LIB_NAME})
-cmake_minimum_required(VERSION 2.6)
-
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG)
-
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
-include_directories("${INC_DIR}")
-include_directories("${PROJECT_SOURCE_DIR}/include")
-include_directories("${PROJECT_SOURCE_DIR}/src")
-
-file(GLOB MV_BARCODE_DET_INC_LIST "${PROJECT_SOURCE_DIR}/include/*.h")
-file(GLOB MV_BARCODE_DET_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.c")
-
-if(FORCED_STATIC_BUILD)
- add_library(${PROJECT_NAME} STATIC ${MV_BARCODE_DET_INC_LIST} ${MV_BARCODE_DET_SRC_LIST})
-else()
- add_library(${PROJECT_NAME} SHARED ${MV_BARCODE_DET_INC_LIST} ${MV_BARCODE_DET_SRC_LIST})
-endif()
-
-target_link_libraries(${PROJECT_NAME} ${MV_COMMON_LIB_NAME})
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
+++ /dev/null
-/**
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __MEDIA_VISION_BARCODE_DETECT_LIC_H__
-#define __MEDIA_VISION_BARCODE_DETECT_LIC_H__
-
-#include "mv_barcode_detect.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @file mv_barcode_detect_lic.h
- * @brief This file contains the Media Vision barcode detect module API for the
- * licensed module.
- */
-
-/**
- * @brief Detects barcode(s) on source and reads message from it.
- *
- * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
- * @param [in] source The media source handle
- * @param [in] engine_cfg The handle to the configuration of the engine
- * @param [in] roi Region of interest - rectangular area on the
- * @a source which will be used for barcode detection
- * @param [in] detect_cb The callback for result handling
- * @param [in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, otherwise a negative error value
- * @retval #MEDIA_VISION_ERROR_NONE Successful
- * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @pre Create a source handle by calling @ref mv_create_source()
- * @pre Create an engine configuration handle by calling
- * @ref mv_create_engine_config() if necessary, otherwise use NULL
- *
- * @see mv_barcode_detected_cb()
- */
-int mv_barcode_detect_lic(
- mv_source_h source,
- mv_engine_config_h engine_cfg,
- mv_rectangle_s roi,
- mv_barcode_detected_cb detect_cb,
- void *user_data);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __MEDIA_VISION_BARCODE_DETECT_LIC_H__ */
+++ /dev/null
-/**
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "mv_barcode_detect_lic.h"
-
-int mv_barcode_detect_lic(
- mv_source_h source,
- mv_engine_config_h engine_cfg,
- mv_rectangle_s roi,
- mv_barcode_detected_cb detect_cb,
- void *user_data)
-{
- return MEDIA_VISION_ERROR_NOT_SUPPORTED;
-}
#include "mv_private.h"
#include "mv_barcode_generate.h"
-
-
-#ifdef MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
-
-/* Include headers of licensed barcode generate module here. */
-#include "mv_barcode_generate_lic.h"
-
-#else
-
/* Include headers of open barcode generate module here. */
#include "mv_barcode_generate_open.h"
-#endif /* MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT */
-
/**
* @file mv_barcode_generate.c
* @brief This file contains the porting layer for Media Vision barcode module.
}
}
-#ifdef MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
-
- /* Use licensed barcode generate functionality here. */
- int ret = mv_barcode_generate_source_lic(
- engine_cfg, message, type, qr_enc_mode, qr_ecc, qr_version,
- image);
-
-#else
-
/* Use open barcode generate functionality here. */
int ret = mv_barcode_generate_source_open(
engine_cfg, message, type, qr_enc_mode, qr_ecc, qr_version,
image);
-#endif /* MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT */
-
MEDIA_VISION_FUNCTION_LEAVE();
return ret;
}
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
-#ifdef MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
-
- /* Use licensed barcode generate functionality here. */
- int ret = mv_barcode_generate_image_lic(
- engine_cfg, message, image_width, image_height, type,
- qr_enc_mode, qr_ecc, qr_version, image_path, image_format);
-
-#else
-
/* Use open barcode generate functionality here. */
int ret = mv_barcode_generate_image_open(
engine_cfg, message, image_width, image_height, type,
qr_enc_mode, qr_ecc, qr_version, image_path, image_format);
-#endif /* MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT */
-
MEDIA_VISION_FUNCTION_LEAVE();
return ret;
}
+++ /dev/null
-project(${MV_BARCODE_GENERATOR_LIB_NAME})
-cmake_minimum_required(VERSION 2.6)
-
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG)
-
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
-include_directories("${INC_DIR}")
-include_directories("${PROJECT_SOURCE_DIR}/include")
-include_directories("${PROJECT_SOURCE_DIR}/src")
-
-file(GLOB MV_BARCODE_GEN_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/include/*.h")
-file(GLOB MV_BARCODE_GEN_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.c")
-
-if(FORCED_STATIC_BUILD)
- add_library(${PROJECT_NAME} STATIC ${MV_BARCODE_GEN_INCLUDE_LIST} ${MV_BARCODE_GEN_SRC_LIST})
-else()
- add_library(${PROJECT_NAME} SHARED ${MV_BARCODE_GEN_INCLUDE_LIST} ${MV_BARCODE_GEN_SRC_LIST})
-endif()
-
-target_link_libraries(${PROJECT_NAME} ${MV_COMMON_LIB_NAME})
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
+++ /dev/null
-/**
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __MEDIA_VISION_BARCODE_GENERATE_LIC_H__
-#define __MEDIA_VISION_BARCODE_GENERATE_LIC_H__
-
-#include "mv_barcode_generate.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @file mv_barcode_generate_lic.h
- * @brief This file contains the Media Vision barcode generate module API for
- * the licensed module.
- */
-
-/**
- * @brief Generates @ref mv_source_h with barcode image.
- *
- * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
- * @param [in] engine_cfg The handle to the configuration of the engine
- * @param [in] message The message to be encoded in the barcode
- * @param [in] image_width The width of the generated image
- * @param [in] image_height The height of the generated image
- * @param [in] type Type of the barcode to be generated
- * @param [in] qr_enc_mode Encoding mode for the message (only for QR codes;
- * for 1D barcodes set this parameter to
- * @ref MV_BARCODE_QR_MODE_UNAVAILABLE)
- * @param [in] qr_ecc Error correction level (only for QR codes; for
- * 1D barcodes set this parameter to
- * @ref MV_BARCODE_QR_ECC_UNAVAILABLE)
- * @param [in] qr_version QR code version (for 1D barcodes set this
- * parameter to 0)
- * @param [in] image The media source handle which will be used to
- * fill by the buffer with generated image
- * @return @c 0 on success, otherwise a negative error value
- * @retval #MEDIA_VISION_ERROR_NONE Successful
- * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see mv_barcode_generate_image_lic()
- */
-int mv_barcode_generate_source_lic(
- mv_engine_config_h engine_cfg,
- const char *message,
- mv_barcode_type_e type,
- mv_barcode_qr_mode_e qr_enc_mode,
- mv_barcode_qr_ecc_e qr_ecc,
- int qr_version,
- mv_source_h image);
-
-/**
- * @brief Generates image file with barcode.
- *
- * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
- * @param [in] engine_cfg The handle to the configuration of the engine
- * @param [in] message The message to be encoded in the barcode
- * @param [in] image_width The width of the generated image
- * @param [in] image_height The height of the generated image
- * @param [in] type Type of the barcode to be generated
- * @param [in] qr_enc_mode Encoding mode for the message (only for QR codes;
- * for 1D barcodes set this parameter to
- * @ref MV_BARCODE_QR_MODE_UNAVAILABLE)
- * @param [in] qr_ecc Error correction level (only for QR codes; for
- * 1D barcodes set this parameter to
- * @ref MV_BARCODE_QR_ECC_UNAVAILABLE)
- * @param [in] qr_version QR code version (for 1D barcodes set this
- * parameter to 0)
- * @param [in] image_path The path to the file that has to be generated
- * @param [in] image_format The format of the output image
- * @return @c 0 on success, otherwise a negative error value
- * @retval #MEDIA_VISION_ERROR_NONE Successful
- * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see mv_barcode_generate_source_lic()
- */
-int mv_barcode_generate_image_lic(
- mv_engine_config_h engine_cfg,
- const char *message,
- int image_width,
- int image_height,
- mv_barcode_type_e type,
- mv_barcode_qr_mode_e qr_enc_mode,
- mv_barcode_qr_ecc_e qr_ecc,
- int qr_version,
- const char *image_path,
- mv_barcode_image_format_e image_format);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __MEDIA_VISION_BARCODE_GENERATE_LIC_H__ */
+++ /dev/null
-/**
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "mv_barcode_generate_lic.h"
-
-int mv_barcode_generate_source_lic(
- mv_engine_config_h engine_cfg,
- const char *message,
- mv_barcode_type_e type,
- mv_barcode_qr_mode_e qr_enc_mode,
- mv_barcode_qr_ecc_e qr_ecc,
- int qr_version,
- mv_source_h image)
-{
- return MEDIA_VISION_ERROR_NOT_SUPPORTED;;
-}
-
-int mv_barcode_generate_image_lic(
- mv_engine_config_h engine_cfg,
- const char *message,
- int image_width,
- int image_height,
- mv_barcode_type_e type,
- mv_barcode_qr_mode_e qr_enc_mode,
- mv_barcode_qr_ecc_e qr_ecc,
- int qr_version,
- const char *image_path,
- mv_barcode_image_format_e image_format)
-{
- return MEDIA_VISION_ERROR_NOT_SUPPORTED;
-}