summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mv_barcode.h30
-rw-r--r--include/mv_barcode_detect.h126
-rw-r--r--include/mv_barcode_generate.h177
-rw-r--r--include/mv_barcode_type.h103
-rw-r--r--include/mv_common.h680
-rw-r--r--include/mv_private.h64
6 files changed, 1180 insertions, 0 deletions
diff --git a/include/mv_barcode.h b/include/mv_barcode.h
new file mode 100644
index 0000000..00ec447
--- /dev/null
+++ b/include/mv_barcode.h
@@ -0,0 +1,30 @@
+/**
+ * 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 __TIZEN_MEDIAVISION_BARCODE_H__
+#define __TIZEN_MEDIAVISION_BARCODE_H__
+
+#include <mv_common.h>
+#include <mv_barcode_detect.h>
+#include <mv_barcode_generate.h>
+
+/**
+ * @file mv_barcode.h
+ * @brief Representative Media Vision Barcode API header file that includes
+ * Media Vision Barcode detection and generation functionalities.
+ */
+
+#endif /* __TIZEN_MEDIAVISION_BARCODE_H__ */
diff --git a/include/mv_barcode_detect.h b/include/mv_barcode_detect.h
new file mode 100644
index 0000000..28d4d31
--- /dev/null
+++ b/include/mv_barcode_detect.h
@@ -0,0 +1,126 @@
+/**
+ * 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 __TIZEN_MEDIAVISION_BARCODE_DETECT_H__
+#define __TIZEN_MEDIAVISION_BARCODE_DETECT_H__
+
+#include <mv_common.h>
+#include <mv_barcode_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file mv_barcode_detect.h
+ * @brief This file contains the Media Vision barcode detect API.
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_VISION_BARCODE_MODULE
+ * @{
+ */
+
+/**
+ * @brief Define MV_BARCODE_DETECT_ATTR_TARGET to set target attribute of the engine configuration
+ *
+ * @since_tizen 2.4
+ *
+ * @see mv_barcode_detect_attr_target_e
+ */
+#define MV_BARCODE_DETECT_ATTR_TARGET "MV_BARCODE_DETECT_ATTR_TARGET" /**< Target: 0-all, 1-1D, 2-2D*/
+
+/**
+ * @brief Enumeration to target attribute
+ *
+ * @since_tizen 2.4
+ */
+typedef enum {
+ MV_BARCODE_DETECT_ATTR_TARGET_ALL, /**< 1D and 2D */
+ MV_BARCODE_DETECT_ATTR_TARGET_1D_BARCODE, /**< 1D barcode only */
+ MV_BARCODE_DETECT_ATTR_TARGET_2D_BARCODE, /**< 2D barcode only */
+} mv_barcode_detect_attr_target_e;
+
+
+/**
+ * @brief Called when barcode detection is completed.
+ * @details If no barcode is detected then the method will be called, barcodes
+ * and states will be equal to NULL, and @a number_of_barcodes - 0.
+ *
+ * @since_tizen 2.4
+ * @param [in] source The handle to the media source
+ * @param [in] engine_cfg The handle to the configuration of the engine
+ * @param [in] barcode_locations The quadrangle locations of detected barcodes
+ * @param [in] messages The decoded messages of barcodes
+ * @param [in] types The types of detected barcodes
+ * @param [in] number_of_barcodes The number of detected barcodes
+ * @param [in] user_data The user data passed from
+ * the mv_barcode_detect() function
+ *
+ * @pre mv_barcode_detect() invokes this callback
+ *
+ * @see mv_barcode_detect()
+ */
+typedef void(*mv_barcode_detected_cb)(
+ mv_source_h source,
+ mv_engine_config_h engine_cfg,
+ const mv_quadrangle_s *barcode_locations,
+ const char *messages[],
+ const mv_barcode_type_e *types,
+ int number_of_barcodes,
+ void *user_data);
+
+/**
+ * @brief Detects barcode(s) on source and reads message from it.
+ *
+ * @since_tizen 2.4
+ * @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
+ * Note that @a roi should be inside area on the
+ * @a source.
+ * @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
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT Not supported format
+ * @retval #MEDIA_VISION_ERROR_INTERNAL Internal error
+ *
+ * @pre Create a source handle by calling @ref mv_create_source()
+ * @pre Create an engine configuration handle by calling
+ * @ref mv_create_engine_config(), otherwise use NULL
+ *
+ * @see mv_barcode_detected_cb()
+ */
+int mv_barcode_detect(
+ 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 /* __TIZEN_MEDIAVISION_BARCODE_DETECT_H__ */
diff --git a/include/mv_barcode_generate.h b/include/mv_barcode_generate.h
new file mode 100644
index 0000000..cbd4c1f
--- /dev/null
+++ b/include/mv_barcode_generate.h
@@ -0,0 +1,177 @@
+/**
+ * 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 __TIZEN_MEDIAVISION_BARCODE_GENERATE_H__
+#define __TIZEN_MEDIAVISION_BARCODE_GENERATE_H__
+
+#include <mv_common.h>
+#include <mv_barcode_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file mv_barcode_generate.h
+ * @brief This file contains the Media Vision barcode generate API.
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_VISION_BARCODE_MODULE
+ * @{
+ */
+
+/**
+ * @brief Define MV_BARCODE_GENERATE_ATTR_TEXT to set text attribute
+ of the engine configuration
+ *
+ * @since_tizen 2.4
+ * @remarks This attribute is only available for 1D barcode generation
+ *
+ * @see mv_barcode_generate_attr_text_e
+ */
+#define MV_BARCODE_GENERATE_ATTR_TEXT "MV_BARCODE_GENERATE_ATTR_TEXT" /**< Text:
+ 0-invisible,
+ 1-visible */
+
+/**
+ * @brief Enumeration to text attribute
+ *
+ * @since_tizen 2.4
+ */
+typedef enum {
+ MV_BARCODE_GENERATE_ATTR_TEXT_INVISIBLE, /**< Invisible */
+ MV_BARCODE_GENERATE_ATTR_TEXT_VISIBLE, /**< Visible */
+} mv_barcode_generate_attr_text_e;
+
+
+/**
+ * @brief Generates @ref mv_source_h with barcode image.
+ * @details Pay attention that for EAN-8 and EAN-13 barcode types the barcode
+ * type may be selected automatically and this selection depends on the input
+ * message length. Also for QR codes the version may be selected as minimum
+ * required to generate QR code with the input message length.
+ *
+ * @since_tizen 2.4
+ * @remarks If the text attribute of engine configuration is set to
+ * MV_BARCODE_GENERATE_ATTR_TEXT_VISIBLE,
+ * MEDIA_VISION_ERROR_INVALID_OPERATION will be return
+ * when @a type is MV_BARCODE_QR
+ *
+ * @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] 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
+ * @a MV_BARCODE_QR_MODE_UNAVAILABLE)
+ * @param [in] qr_ecc Error correction level (only for QR codes; for
+ * 1D barcodes set this parameter to
+ * @a MV_BARCODE_QR_ECC_UNAVAILABLE)
+ * @param [in] qr_version QR code version (for 1D barcodes set this
+ * parameter to 0)
+ * @param [in, out] 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
+ * @retval #MEDIA_VISION_ERROR_MSG_TOO_LONG Too long or short message
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MEDIA_VISION_ERROR_INVALID_DATA Invalid data
+ * @retval #MEDIA_VISION_ERROR_INTERNAL Internal error
+ * @retval #MEDIA_VISION_ERROR_INVALID_OPERATION Invalid operation
+ *
+ * @pre Create an engine configuration handle by calling
+ * @ref mv_create_engine_config(), otherwise use NULL
+ *
+ * @see mv_barcode_generate_image()
+ */
+int mv_barcode_generate_source(
+ 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.
+ * @details Pay attention that for EAN-8 and EAN-13 barcode types the barcode
+ * type may be selected automatically and this selection depends on the input
+ * message length. Also for QR codes the version may be selected as minimum
+ * required to generate QR code with the input message length.
+ *
+ * @since_tizen 2.4
+ * @remarks If the text attribute of engine configuration is set to
+ * MV_BARCODE_GENERATE_ATTR_TEXT_VISIBLE,
+ * MEDIA_VISION_ERROR_INVALID_OPERATION will be return
+ * when @a type is MV_BARCODE_QR
+ *
+ * @remarks The mediastorage privilege http://tizen.org/privilege/mediastorage is needed \n
+ if @a image_path is relevant to media storage.\n
+ The externalstorage privilege http://tizen.org/privilege/externalstorage is needed \n
+ if @a image_path is relevant to external storage.
+ * @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
+ * @a MV_BARCODE_QR_MODE_UNAVAILABLE)
+ * @param [in] qr_ecc Error correction level (only for QR codes; for
+ * 1D barcodes set this parameter to
+ * @a 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
+ * @retval #MEDIA_VISION_ERROR_MSG_TOO_LONG Too long or short message
+ * @retval #MEDIA_VISION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MEDIA_VISION_ERROR_INVALID_DATA Invalid data
+ * @retval #MEDIA_VISION_ERROR_INTERNAL Internal error
+ * @retval #MEDIA_VISION_ERROR_INVALID_OPERATION Invalid operation
+ *
+ * @pre Create an engine configuration handle by calling
+ * @ref mv_create_engine_config(), otherwise use NULL
+ *
+ * @see mv_barcode_generate_source()
+ */
+int mv_barcode_generate_image(
+ 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 /* __TIZEN_MEDIAVISION_BARCODE_GENERATE_H__ */
diff --git a/include/mv_barcode_type.h b/include/mv_barcode_type.h
new file mode 100644
index 0000000..4fe17a3
--- /dev/null
+++ b/include/mv_barcode_type.h
@@ -0,0 +1,103 @@
+/**
+ * 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 __TIZEN_MEDIAVISION_BARCODE_TYPE_H__
+#define __TIZEN_MEDIAVISION_BARCODE_TYPE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file mv_barcode_type.h
+ * @brief This file contains enumerations required by barcode detect/generate API.
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_VISION_BARCODE_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for supported barcode types.
+ * @details QR codes (versions 1 to 40) and set of 1D barcodes are supported
+ *
+ * @since_tizen 2.4
+ */
+typedef enum
+{
+ MV_BARCODE_QR, /**< 2D barcode - Quick Response code */
+ MV_BARCODE_UPC_A, /**< 1D barcode - Universal Product Code with 12-digit */
+ MV_BARCODE_UPC_E, /**< 1D barcode - Universal Product Code with 6-digit */
+ MV_BARCODE_EAN_8, /**< 1D barcode - International Article Number with 8-digit */
+ MV_BARCODE_EAN_13, /**< 1D barcode - International Article Number with 13-digit */
+ MV_BARCODE_CODE128, /**< 1D barcode - Code 128 */
+ MV_BARCODE_CODE39, /**< 1D barcode - Code 39 */
+ MV_BARCODE_I2_5, /**< 1D barcode - Interleaved Two of Five */
+ MV_BARCODE_UNDEFINED /**< Undefined */
+}
+mv_barcode_type_e;
+
+/**
+ * @brief Enumeration for supported QR code error correction level.
+ *
+ * @since_tizen 2.4
+ * @remarks This is unavailable for 1D barcodes
+ */
+typedef enum {
+ MV_BARCODE_QR_ECC_LOW, /**< Recovery up to 7% losses */
+ MV_BARCODE_QR_ECC_MEDIUM, /**< Recovery up to 15% losses */
+ MV_BARCODE_QR_ECC_QUARTILE, /**< Recovery up to 25% losses */
+ MV_BARCODE_QR_ECC_HIGH, /**< Recovery up to 30% losses */
+ MV_BARCODE_QR_ECC_UNAVAILABLE /**< Unavailable */
+} mv_barcode_qr_ecc_e;
+
+/**
+ * @brief Enumeration for supported QR code encoding mode.
+ *
+ * @since_tizen 2.4
+ * @remarks This is unavailable for 1D barcodes
+ */
+typedef enum {
+ MV_BARCODE_QR_MODE_NUMERIC, /**< Numeric digits */
+ MV_BARCODE_QR_MODE_ALPHANUMERIC, /**< Alphanumeric characters */
+ MV_BARCODE_QR_MODE_BYTE, /**< Raw 8-bit bytes */
+ MV_BARCODE_QR_MODE_UTF8, /**< UTF-8 character encoding */
+ MV_BARCODE_QR_MODE_UNAVAILABLE /**< Unavailable */
+} mv_barcode_qr_mode_e;
+
+/**
+ * @brief Enumeration for supported image formats for the barcode generating.
+ *
+ * @since_tizen 2.4
+ */
+typedef enum {
+ MV_BARCODE_IMAGE_FORMAT_UNAVAILABLE = -1, /** Unvailable image format */
+ MV_BARCODE_IMAGE_FORMAT_BMP, /**< BMP image format */
+ MV_BARCODE_IMAGE_FORMAT_JPG, /**< JPEG image format */
+ MV_BARCODE_IMAGE_FORMAT_PNG, /**< PNG image format */
+ MV_BARCODE_IMAGE_FORMAT_NUM, /**< The number of supported iamge format */
+} mv_barcode_image_format_e;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIAVISION_BARCODE_TYPE_H__ */
diff --git a/include/mv_common.h b/include/mv_common.h
new file mode 100644
index 0000000..98eedde
--- /dev/null
+++ b/include/mv_common.h
@@ -0,0 +1,680 @@
+/**
+ * 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 __TIZEN_MEDIAVISION_COMMON_H__
+#define __TIZEN_MEDIAVISION_COMMON_H__
+
+#include <media_packet.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file mv_common.h
+ * @brief This file contains the Media Vision Common API.
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_VISION_COMMON_MODULE
+ * @{
+ */
+
+/**
+ * @brief Point in 2D space.
+ *
+ * @since_tizen 2.4
+ */
+typedef struct {
+ int x; /**< X-axis coordinate of the point in 2D space */
+ int y; /**< Y-axis coordinate of the point in 2D space */
+} mv_point_s;
+
+/**
+ * @brief Location of the object bounded by quadrangle defined by four 2D points.
+ *
+ * @since_tizen 2.4
+ */
+typedef struct {
+ mv_point_s points[4]; /**< Four points that define object bounding
+ quadrangle */
+} mv_quadrangle_s;
+
+/**
+ * @brief Location of the object bounded by rectangle defined by
+ * coordinates of top left corner, width and height.
+ *
+ * @since_tizen 2.4
+ */
+typedef struct {
+ mv_point_s point; /**< Top left corner of rectangle coordinates */
+ int width; /**< Width of the bounding rectangle */
+ int height; /**< Height of the bounding rectangle */
+} mv_rectangle_s;
+
+/**
+ * @brief Enumeration for Media Vision error.
+ *
+ * @since_tizen 2.4
+ */
+typedef enum {
+ MEDIA_VISION_ERROR_NONE
+ = TIZEN_ERROR_NONE, /**< Successful */
+ MEDIA_VISION_ERROR_NOT_SUPPORTED
+ = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+ MEDIA_VISION_ERROR_MSG_TOO_LONG
+ = TIZEN_ERROR_MSG_TOO_LONG, /**< Msg too long */
+ MEDIA_VISION_ERROR_NO_DATA
+ = TIZEN_ERROR_NO_DATA, /**< No data */
+ MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE
+ = TIZEN_ERROR_KEY_NOT_AVAILABLE, /**< Key not available */
+ MEDIA_VISION_ERROR_OUT_OF_MEMORY
+ = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ MEDIA_VISION_ERROR_INVALID_PARAMETER
+ = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ MEDIA_VISION_ERROR_INVALID_OPERATION
+ = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
+ MEDIA_VISION_ERROR_PERMISSION_DENIED
+ = TIZEN_ERROR_NOT_PERMITTED, /**< Not permitted */
+ MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT
+ = TIZEN_ERROR_MEDIA_VISION | 0x01, /**< Not supported format */
+ MEDIA_VISION_ERROR_INTERNAL
+ = TIZEN_ERROR_MEDIA_VISION | 0x02, /**< Internal error */
+ MEDIA_VISION_ERROR_INVALID_DATA
+ = TIZEN_ERROR_MEDIA_VISION | 0x03, /**< Invalid data */
+} mv_error_e;
+
+/**
+ * @brief Enumeration for Media Vision @ref mv_engine_config_h handle attribute
+ * type.
+ *
+ * @since_tizen 2.4
+ */
+typedef enum {
+ MV_ENGINE_CONFIG_ATTR_TYPE_DOUBLE, /**< Double attribute type */
+ MV_ENGINE_CONFIG_ATTR_TYPE_INTEGER, /**< Integer attribute type */
+ MV_ENGINE_CONFIG_ATTR_TYPE_BOOLEAN, /**< Boolean attribute type */
+ MV_ENGINE_CONFIG_ATTR_TYPE_STRING /**< String attribute type */
+} mv_config_attribute_type_e;
+
+/**
+ * @brief Enumeration for Media Vision colorspace.
+ *
+ * @since_tizen 2.4
+ */
+typedef enum {
+ MEDIA_VISION_COLORSPACE_INVALID, /**< The colorspace type is invalid */
+ MEDIA_VISION_COLORSPACE_Y800, /**< The colorspace type is Y800 */
+ MEDIA_VISION_COLORSPACE_I420, /**< The colorspace type is I420 */
+ MEDIA_VISION_COLORSPACE_NV12, /**< The colorspace type is NV12 */
+ MEDIA_VISION_COLORSPACE_YV12, /**< The colorspace type is YV12 */
+ MEDIA_VISION_COLORSPACE_NV21, /**< The colorspace type is NV21 */
+ MEDIA_VISION_COLORSPACE_YUYV, /**< The colorspace type is YUYV */
+ MEDIA_VISION_COLORSPACE_UYVY, /**< The colorspace type is UYVY */
+ MEDIA_VISION_COLORSPACE_422P, /**< The colorspace type is 422P */
+ MEDIA_VISION_COLORSPACE_RGB565, /**< The colorspace type is RGB565 */
+ MEDIA_VISION_COLORSPACE_RGB888, /**< The colorspace type is RGB888 */
+ MEDIA_VISION_COLORSPACE_RGBA, /**< The colorspace type is RGBA */
+} mv_colorspace_e;
+
+/**
+ * @brief The handle to the Media Vision API engine algorithms configuration.
+ * @details Configuration is a dictionary consists of key and value pairs to
+ * collect engine-specific settings and allow Media Vision module to
+ * access them internally. Engine configuration provides developer by
+ * the possibility to make computer vision algorithms work better
+ * in particular conditions of API usage. To create engine
+ * configuration handle @ref mv_create_engine_config() function has to
+ * be used. When configuration is not needed any more, it is required to
+ * destroy it and release resources by @ref mv_destroy_engine_config()
+ * function.
+ *
+ * @since_tizen 2.4
+ *
+ * @see mv_create_engine_config()
+ * @see mv_destroy_engine_config()
+ */
+typedef void *mv_engine_config_h;
+
+/**
+ * @brief The handle to the source.
+ *
+ * @since_tizen 2.4
+ */
+typedef void *mv_source_h;
+
+/**
+ * @brief Creates a source handle.
+ *
+ * @since_tizen 2.4
+ * @remarks You must release @a source by using @ref mv_destroy_source().
+ * @param [out] source A new handle to the source
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_destroy_source()
+ */
+int mv_create_source(
+ mv_source_h *source);
+
+/**
+ * @brief Destroys the source handle and releases all its resources.
+ *
+ * @since_tizen 2.4
+ * @param [in] source The handle to the source to be destroyed
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_create_source()
+ */
+int mv_destroy_source(
+ mv_source_h source);
+
+/**
+ * @brief Fills the media source based on the media packet.
+ *
+ * @since_tizen 2.4
+ * @param [in, out] source The handle to the source
+ * @param [in] media_packet The handle to the media packet from which
+ * will be filled the source
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT Not supported format
+ * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre Create a source handle by calling @ref mv_create_source()
+ *
+ * @see mv_create_source()
+ * @see mv_destroy_source()
+ */
+int mv_source_fill_by_media_packet(
+ mv_source_h source,
+ media_packet_h media_packet);
+
+/**
+ * @brief Fills the media source based on the buffer and metadata.
+ *
+ * @since_tizen 2.4
+ * @param [in, out] source The handle to the source
+ * @param [in] data_buffer The buffer of image data
+ * @param [in] buffer_size The buffer size
+ * @param [in] image_width The width of image data
+ * @param [in] image_height The height of image data
+ * @param [in] image_colorspace The image colorspace
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre Create a source handle by calling @ref mv_create_source()
+ *
+ * @see mv_source_clear()
+ */
+int mv_source_fill_by_buffer(
+ mv_source_h source,
+ unsigned char *data_buffer,
+ unsigned int buffer_size,
+ unsigned int image_width,
+ unsigned int image_height,
+ mv_colorspace_e image_colorspace);
+
+/**
+ * @brief Clears the buffer of the media source.
+ *
+ * @since_tizen 2.4
+ * @param [in, out] source The handle to the source
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_source_fill_by_buffer()
+ */
+int mv_source_clear(
+ mv_source_h source);
+
+/**
+ * @brief Gets buffer of the media source.
+ *
+ * @since_tizen 2.4
+ * @remarks Note that the retrieved buffer will be destroyed when
+ * @ref mv_destroy_source() or @ref mv_source_clear() function
+ * is called for the @a source.
+ *
+ * @param [in] source The handle to the source
+ * @param [out] data_buffer The buffer of the source
+ * @param [out] buffer_size The size of buffer
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_source_get_width()
+ * @see mv_source_get_height()
+ * @see mv_source_get_colorspace()
+ */
+int mv_source_get_buffer(
+ mv_source_h source,
+ unsigned char **data_buffer,
+ unsigned int *buffer_size);
+
+/**
+ * @brief Gets height of the media source.
+ *
+ * @since_tizen 2.4
+ * @param [in] source The handle to the source
+ * @param [out] image_height The height of an image in the source
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_source_get_width()
+ * @see mv_source_get_colorspace()
+ * @see mv_source_get_buffer()
+ */
+int mv_source_get_height(
+ mv_source_h source,
+ unsigned int *image_height);
+
+/**
+ * @brief Gets width of the media source.
+ *
+ * @since_tizen 2.4
+ * @param [in] source The handle to the source
+ * @param [out] image_width The width of an image in the source
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_source_get_height()
+ * @see mv_source_get_colorspace()
+ * @see mv_source_get_buffer()
+ */
+int mv_source_get_width(
+ mv_source_h source,
+ unsigned int *image_width);
+
+/**
+ * @brief Gets colorspace of the media source.
+ *
+ * @since_tizen 2.4
+ * @param [in] source The handle to the source
+ * @param [out] image_colorspace The colorspace of an image in the source
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_source_get_width()
+ * @see mv_source_get_height()
+ * @see mv_source_get_buffer()
+ */
+int mv_source_get_colorspace(
+ mv_source_h source,
+ mv_colorspace_e *image_colorspace);
+
+/**
+ * @brief Creates the handle to the configuration of engine.
+ *
+ * @since_tizen 2.4
+ * @remarks Available engine configuration attributes can be get by using
+ * @ref mv_engine_config_foreach_supported_attribute().
+ * The attributes can be changed by @ref mv_engine_config_h
+ * related setters. Default values are used if the attributes
+ * are not changed.
+ * @param [out] engine_cfg The handle to the engine to be created
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_h
+ * @see mv_destroy_engine_config()
+ * @see mv_engine_config_set_double_attribute()
+ * @see mv_engine_config_set_int_attribute()
+ * @see mv_engine_config_set_bool_attribute()
+ * @see mv_engine_config_set_string_attribute()
+ * @see mv_engine_config_get_double_attribute()
+ * @see mv_engine_config_get_int_attribute()
+ * @see mv_engine_config_get_bool_attribute()
+ * @see mv_engine_config_get_string_attribute()
+ */
+int mv_create_engine_config(
+ mv_engine_config_h *engine_cfg);
+
+/**
+ * @brief Destroys the engine configuration handle and releases all its
+ * resources.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg The handle to the engine configuration
+ * to be destroyed
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_h
+ * @see mv_create_engine_config()
+ */
+int mv_destroy_engine_config(
+ mv_engine_config_h engine_cfg);
+
+/**
+ * @brief Sets the double attribute to the configuration.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg Engine configuration for which @a value has
+ * to be set
+ * @param [in] name String key of the attribute will be used for
+ * storing the @a value into configuration
+ * dictionary
+ * @param [in] value The double value of the attribute
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_get_double_attribute()
+ * @see mv_engine_config_set_int_attribute()
+ * @see mv_engine_config_set_bool_attribute()
+ * @see mv_engine_config_set_string_attribute()
+ */
+int mv_engine_config_set_double_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ double value);
+
+/**
+ * @brief Sets the integer attribute to the configuration.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg Engine configuration for which @a value has
+ * to be set
+ * @param [in] name String key of the attribute will be used for
+ * storing the @a value into configuration
+ * dictionary
+ * @param [in] value The integer value of the attribute
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_get_int_attribute()
+ * @see mv_engine_config_set_double_attribute()
+ * @see mv_engine_config_set_bool_attribute()
+ * @see mv_engine_config_set_string_attribute()
+ * @see mv_barcode_detect_attr_target_e
+ * @see mv_barcode_generate_attr_text_e
+ */
+int mv_engine_config_set_int_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ int value);
+
+/**
+ * @brief Sets the boolean attribute to the configuration.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg Engine configuration for which @a value has
+ * to be set
+ * @param [in] name String key of the attribute will be used for
+ * storing the @a value into configuration
+ * dictionary
+ * @param [in] value The boolean value of the attribute
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_get_bool_attribute()
+ * @see mv_engine_config_set_double_attribute()
+ * @see mv_engine_config_set_int_attribute()
+ * @see mv_engine_config_set_string_attribute()
+ */
+int mv_engine_config_set_bool_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ bool value);
+
+/**
+ * @brief Sets the string attribute to the configuration.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg Engine configuration for which @a value has
+ * to be set
+ * @param [in] name String key of the attribute will be used for
+ * storing the @a value into configuration
+ * dictionary
+ * @param [in] value The string value of the attribute
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_get_string_attribute()
+ * @see mv_engine_config_set_double_attribute()
+ * @see mv_engine_config_set_int_attribute()
+ * @see mv_engine_config_set_bool_attribute()
+ */
+int mv_engine_config_set_string_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ const char *value);
+
+/**
+ * @brief Gets the double attribute from the configuration dictionary.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg Engine configuration from which @a value
+ * has to be gotten. If NULL, default attribute
+ * value will be returned
+ * @param [in] name String key of the attribute will be used for
+ * getting the @a value from the
+ * configuration dictionary
+ * @param [out] value The attribute to be filled with double value
+ * from dictionary
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_set_double_attribute()
+ * @see mv_engine_config_get_int_attribute()
+ * @see mv_engine_config_get_bool_attribute()
+ * @see mv_engine_config_get_string_attribute()
+ */
+int mv_engine_config_get_double_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ double *value);
+
+/**
+ * @brief Gets the integer attribute from the configuration dictionary.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg Engine configuration from which @a value
+ * has to be gotten. If NULL, default attribute
+ * value will be returned
+ * @param [in] name String key of the attribute will be used for
+ * getting the @a value from the
+ * configuration dictionary
+ * @param [out] value The attribute to be filled with integer value
+ * from dictionary
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_set_int_attribute()
+ * @see mv_engine_config_get_double_attribute()
+ * @see mv_engine_config_get_bool_attribute()
+ * @see mv_engine_config_get_string_attribute()
+ * @see mv_barcode_detect_attr_target_e
+ * @see mv_barcode_generate_attr_text_e
+ */
+int mv_engine_config_get_int_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ int *value);
+
+/**
+ * @brief Gets the boolean attribute from the configuration dictionary.
+ *
+ * @since_tizen 2.4
+ * @param [in] engine_cfg Engine configuration from which @a value
+ * has to be gotten. If NULL, default attribute
+ * value will be returned
+ * @param [in] name String key of the attribute will be used for
+ * getting the @a value from the
+ * configuration dictionary
+ * @param [out] value The attribute to be filled with boolean value
+ * from dictionary
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_set_bool_attribute()
+ * @see mv_engine_config_get_double_attribute()
+ * @see mv_engine_config_get_int_attribute()
+ * @see mv_engine_config_get_string_attribute()
+ */
+int mv_engine_config_get_bool_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ bool *value);
+
+/**
+ * @brief Gets the string attribute from the configuration dictionary.
+ *
+ * @since_tizen 2.4
+ * @remarks Function allocates memory required for output @a value, so
+ * it has to be removed by the user himself.
+ * @param [in] engine_cfg Engine configuration from which @a value
+ * has to be gotten. If NULL, default attribute
+ * value will be returned
+ * @param [in] name String key of the attribute will be used for
+ * getting the @a value from the
+ * configuration dictionary
+ * @param [out] value The attribute to be filled with string value
+ * from dictionary
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MEDIA_VISION_ERROR_NONE Successful
+ * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_set_string_attribute()
+ * @see mv_engine_config_get_double_attribute()
+ * @see mv_engine_config_get_int_attribute()
+ * @see mv_engine_config_get_bool_attribute()
+ */
+int mv_engine_config_get_string_attribute(
+ mv_engine_config_h engine_cfg,
+ const char *name,
+ char **value);
+
+/**
+ * @brief Called to get information (type and name) once for each supported
+ * attribute.
+ *
+ * @since_tizen 2.4
+ * @param [in] attribute_type The supported attribute type
+ * @param [in] attribute_name The supported attribute name
+ * @param [in] user_data The user data passed from the
+ * @ref mv_engine_config_foreach_supported_attribute()
+ * function
+ * @return @c true to continue with the next iteration of the loop, \n
+ * otherwise @c false to break out of the loop
+ *
+ * @pre mv_engine_config_foreach_supported_attribute() will invoke this callback
+ * @see mv_engine_config_foreach_supported_attribute()
+ */
+typedef bool(*mv_supported_attribute_cb)(
+ mv_config_attribute_type_e attribute_type,
+ const char *attribute_name,
+ void *user_data);
+
+/**
+ * @brief Traverses the list of supported attribute names and types.
+ * @details Using this function names of supported attributes can be obtained.
+ * Names of the attributes can be used with @ref mv_engine_config_h
+ * related getters and setters to get/set appropriate attribute values.
+ *
+ * @since_tizen 2.4
+ * @remarks If @a callback is called zero times after
+ * @ref mv_engine_config_foreach_supported_attribute() call, then
+ * engine configuration is not supported and setting of attributes will
+ * cause no effect. In this case for all Media Vision functions which
+ * require @ref mv_engine_config_h handle as in parameter this
+ * parameter can be set NULL.
+ * @remarks If @a callback is called at least once, then attribute names and
+ * types obtained in the @ref mv_supported_attribute_cb callback can be
+ * changed after mv_engine_config_h handle creation (with
+ * @ref mv_create_engine_config() function) by corresponding setters.
+ * Although, if attributes aren't changed by setters, then default
+ * values will be used.\n
+ * Changing of attribute values will affect internal functionality
+ * provided by concrete library underlying Media Vision API.
+ * @param [in] callback The iteration callback function
+ * @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_NO_DATA Can't determine list of supported attributes
+ * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see mv_engine_config_set_double_attribute()
+ * @see mv_engine_config_set_int_attribute()
+ * @see mv_engine_config_set_bool_attribute()
+ * @see mv_engine_config_set_string_attribute()
+ * @see mv_engine_config_get_double_attribute()
+ * @see mv_engine_config_get_int_attribute()
+ * @see mv_engine_config_get_bool_attribute()
+ * @see mv_engine_config_get_string_attribute()
+ */
+int mv_engine_config_foreach_supported_attribute(
+ mv_supported_attribute_cb callback,
+ void *user_data);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIAVISION_COMMON_H__ */
diff --git a/include/mv_private.h b/include/mv_private.h
new file mode 100644
index 0000000..2bd4cbc
--- /dev/null
+++ b/include/mv_private.h
@@ -0,0 +1,64 @@
+/*
+* 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 __TIZEN_MEDIA_VISION_PRIVATE_H__
+#define __TIZEN_MEDIA_VISION_PRIVATE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <stdbool.h>
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "TIZEN_MEDIA_VISION"
+
+#define MEDIA_VISION_FUNCTION_ENTER() \
+ LOGI("[%s] <ENTER>", __FUNCTION__)
+
+#define MEDIA_VISION_FUNCTION_LEAVE() \
+ LOGI("[%s] <LEAVE>", __FUNCTION__)
+
+#define MEDIA_VISION_CHECK_CONDITION(condition, error, msg) \
+ if(condition) {} else \
+ { LOGE("[%s] %s(0x%08x)", __FUNCTION__, msg, error); return error;}
+
+#define MEDIA_VISION_INSTANCE_CHECK(arg) \
+ MEDIA_VISION_CHECK_CONDITION(arg != NULL, \
+ MEDIA_VISION_ERROR_INVALID_PARAMETER, \
+ "MEDIA_VISION_ERROR_INVALID_PARAMETER")
+
+#define MEDIA_VISION_NULL_ARG_CHECK(arg) \
+ MEDIA_VISION_CHECK_CONDITION(arg != NULL, \
+ MEDIA_VISION_ERROR_INVALID_PARAMETER, \
+ "MEDIA_VISION_ERROR_INVALID_PARAMETER")
+#define MEDIA_VISION_SUPPORT_CHECK(arg) \
+ MEDIA_VISION_CHECK_CONDITION(arg != false, MEDIA_VISION_ERROR_NOT_SUPPORTED, \
+ "MEDIA_VISION_ERROR_NOT_SUPPORTED")
+
+bool __mv_barcode_check_system_info_feature_supported();
+bool __mv_barcode_detect_check_system_info_feature_supported();
+bool __mv_barcode_generate_check_system_info_feature_supported();
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_VISION_PRIVATE_H__ */