#ifndef __TIZEN_MEDIA_IMAGE_UTIL_H__
#define __TIZEN_MEDIA_IMAGE_UTIL_H__
-#include <tizen.h>
-#include <media_packet.h>
+#include <image_util_type.h>
#ifdef __cplusplus
extern "C"
*/
/**
- * @brief Enumeration for error.
- * @since_tizen 2.3
- */
-typedef enum
-{
- IMAGE_UTIL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- IMAGE_UTIL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- IMAGE_UTIL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- IMAGE_UTIL_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file */
- IMAGE_UTIL_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Internal error */
- IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT = TIZEN_ERROR_IMAGE_UTIL | 0x01, /**< Not supported format */
- IMAGE_UTIL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
- IMAGE_UTIL_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED /**< Not supported */
-} image_util_error_e;
-
-/**
- * @brief Enumeration for colorspace.
- * @since_tizen 2.3
- */
-typedef enum
-{
- IMAGE_UTIL_COLORSPACE_YV12, /**< YV12 - YCrCb planar format */
- IMAGE_UTIL_COLORSPACE_YUV422, /**< YUV422 - planar */
- IMAGE_UTIL_COLORSPACE_I420, /**< YUV420 - planar */
- IMAGE_UTIL_COLORSPACE_NV12, /**< NV12- planar */
-
- IMAGE_UTIL_COLORSPACE_UYVY, /**< UYVY - packed */
- IMAGE_UTIL_COLORSPACE_YUYV, /**< YUYV - packed */
-
- IMAGE_UTIL_COLORSPACE_RGB565, /**< RGB565, high-byte is Blue */
- IMAGE_UTIL_COLORSPACE_RGB888, /**< RGB888, high-byte is Blue */
- IMAGE_UTIL_COLORSPACE_ARGB8888, /**< ARGB8888, high-byte is Blue */
-
- IMAGE_UTIL_COLORSPACE_BGRA8888, /**< BGRA8888, high-byte is Alpha */
- IMAGE_UTIL_COLORSPACE_RGBA8888, /**< RGBA8888, high-byte is Alpha */
- IMAGE_UTIL_COLORSPACE_BGRX8888, /**< BGRX8888, high-byte is X */
- IMAGE_UTIL_COLORSPACE_NV21, /**< NV12- planar */
- IMAGE_UTIL_COLORSPACE_NV16, /**< NV16- planar */
- IMAGE_UTIL_COLORSPACE_NV61, /**< NV61- planar */
-} image_util_colorspace_e;
-
-/**
- * @brief Enumerations of rotation
- */
-typedef enum
-{
- IMAGE_UTIL_ROTATION_NONE = 0, /**< None */
- IMAGE_UTIL_ROTATION_90 = 1, /**< Rotation 90 degree */
- IMAGE_UTIL_ROTATION_180, /**< Rotation 180 degree */
- IMAGE_UTIL_ROTATION_270, /**< Rotation 270 degree */
- IMAGE_UTIL_ROTATION_FLIP_HORZ, /**< Flip horizontal */
- IMAGE_UTIL_ROTATION_FLIP_VERT, /**< Flip vertical */
-} image_util_rotation_e;
-
-
-/**
-* @ingroup CAPI_MEDIA_IMAGE_UTIL_MODULE
-* @brief Image util handle.
-* @since_tizen 2.3
-*/
-typedef struct transformation_s *transformation_h;
-
-
-/**
-* @ingroup CAPI_MEDIA_IMAGE_UTIL_MODULE
-* @brief Called when transform is finished just before returning the output.
-* @since_tizen 2.3
-*
-* @param[in] error_code The error code of image util transfrom
-* @param[in,out] dst The result buffer of image util transform
-* @param[in] user_data The user data passed from the callback registration function
-* @pre image_util_transform_run() will invoke this function.
-*/
-typedef void (*image_util_transform_completed_cb)(media_packet_h *dst, int error_code, void *user_data);
-
-
-
-/**
- * @addtogroup CAPI_MEDIA_IMAGE_UTIL_MODULE
- * @{
- */
-
-/**
* @brief Creates a handle to image util transform.
* @since_tizen 2.3
*
*
* @remarks You must release @a image_buffer using free().\n
* http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n
-* http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.
+* http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.\n
+* If you decode the JPEG image which has odd numbered width or height to YUV colorspace,\n
+* the width or height of decoded data will be rounded down to even numbered width or height.
*
* @param[in] path The image file path
* @param[in] colorspace The decoded image colorspace
* @brief Decodes the JPEG image(in memory) to the buffer.
* @since_tizen 2.3
*
-* @remarks You must release @a image_buffer using free().
+* @remarks You must release @a image_buffer using free().\n
+* If you decode the JPEG image which has odd numbered width or height to YUV colorspace,\n
+* the width or height of decoded data will be rounded down to even numbered width or height.
*
* @param[in] jpeg_buffer The JPEG image buffer
* @param[in] jpeg_size The JPEG image buffer size
int image_util_decode_jpeg_from_memory( const unsigned char * jpeg_buffer , int jpeg_size , image_util_colorspace_e colorspace, unsigned char ** image_buffer , int *width , int *height , unsigned int *size);
/**
+* @brief Decodes the JPEG image to the buffer with downscale decoding option.
+* @since_tizen 2.4
+*
+* @remarks You must release @a image_buffer using free().\n
+* http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n
+* http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.\n
+* If you decode the JPEG image which has odd numbered width or height to YUV colorspace,\n
+* the width or height of decoded data will be rounded down to even numbered width or height.
+*
+* @param[in] path The image file path
+* @param[in] colorspace The decoded image colorspace
+* @param[in] downscale The downscale value
+* @param[out] image_buffer The image buffer for the decoded image
+* @param[out] width The image width
+* @param[out] height The image height
+* @param[out] size The image buffer size
+*
+* @return @c 0 on success,
+* otherwise a negative error value
+*
+* @retval #IMAGE_UTIL_ERROR_NONE Successful
+* @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY out of memory
+* @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
+* @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
+* @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
+*
+* @see image_util_supported_jpeg_colorspace_cb()
+* @see image_util_decode_jpeg_from_memory()
+* @see image_util_foreach_supported_jpeg_colorspace()
+*/
+int image_util_decode_jpeg_with_downscale( const char *path, image_util_colorspace_e colorspace, image_util_scale_e downscale, unsigned char ** image_buffer, int *width, int *height, unsigned int *size);
+
+/**
+* @brief Decodes the JPEG image(in memory) to the buffer with downscale decoding option.
+* @since_tizen 2.4
+*
+* @remarks You must release @a image_buffer using free().\n
+* If you decode the JPEG image which has odd numbered width or height to YUV colorspace,\n
+* the width or height of decoded data will be rounded down to even numbered width or height.
+*
+* @param[in] jpeg_buffer The JPEG image buffer
+* @param[in] jpeg_size The JPEG image buffer size
+* @param[in] colorspace The decoded image colorspace
+* @param[in] downscale The downscale value
+* @param[out] image_buffer The image buffer for the decoded image
+* @param[out] width The image width
+* @param[out] height The image height
+* @param[out] size The image buffer size
+*
+* @return @c 0 on success,
+* otherwise a negative error value
+*
+* @retval #IMAGE_UTIL_ERROR_NONE Successful
+* @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY out of memory
+* @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
+* @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
+* @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
+*
+* @see image_util_supported_jpeg_colorspace_cb()
+* @see image_util_decode_jpeg()
+* @see image_util_foreach_supported_jpeg_colorspace()
+*/
+int image_util_decode_jpeg_from_memory_with_downscale( const unsigned char * jpeg_buffer, int jpeg_size, image_util_colorspace_e colorspace, image_util_scale_e downscale, unsigned char ** image_buffer, int *width, int *height, unsigned int *size);
+
+/**
* @brief Encodes the image to the JPEG image.
* @since_tizen 2.3
*
#ifndef __TIZEN_MEDIA_IMAGE_UTIL_PRIVATE_H__
#define __TIZEN_MEDIA_IMAGE_UTIL_PRIVATE_H__
+#include <image_util_type.h>
#ifdef __cplusplus
extern "C"
--- /dev/null
+/*
+* Copyright (c) 2011 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_IMAGE_UTIL_TYPE_H__
+#define __TIZEN_MEDIA_IMAGE_UTIL_TYPE_H__
+
+#include <tizen.h>
+#include <media_packet.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define IMAGE_UTIL_ERROR_CLASS TIZEN_ERROR_IMAGE_UTIL
+
+/**
+ * @file image_util_type.h
+ * @brief This file contains the image util API
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_IMAGE_UTIL_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for error.
+ * @since_tizen 2.3
+ */
+typedef enum
+{
+ IMAGE_UTIL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ IMAGE_UTIL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ IMAGE_UTIL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ IMAGE_UTIL_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file */
+ IMAGE_UTIL_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Internal error */
+ IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT = TIZEN_ERROR_IMAGE_UTIL | 0x01, /**< Not supported format */
+ IMAGE_UTIL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ IMAGE_UTIL_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED /**< Not supported */
+} image_util_error_e;
+
+/**
+ * @brief Enumeration for colorspace.
+ * @since_tizen 2.3
+ */
+typedef enum
+{
+ IMAGE_UTIL_COLORSPACE_YV12, /**< YV12 - YCrCb planar format */
+ IMAGE_UTIL_COLORSPACE_YUV422, /**< YUV422 - planar */
+ IMAGE_UTIL_COLORSPACE_I420, /**< YUV420 - planar */
+ IMAGE_UTIL_COLORSPACE_NV12, /**< NV12- planar */
+
+ IMAGE_UTIL_COLORSPACE_UYVY, /**< UYVY - packed */
+ IMAGE_UTIL_COLORSPACE_YUYV, /**< YUYV - packed */
+
+ IMAGE_UTIL_COLORSPACE_RGB565, /**< RGB565, high-byte is Blue */
+ IMAGE_UTIL_COLORSPACE_RGB888, /**< RGB888, high-byte is Blue */
+ IMAGE_UTIL_COLORSPACE_ARGB8888, /**< ARGB8888, high-byte is Blue */
+
+ IMAGE_UTIL_COLORSPACE_BGRA8888, /**< BGRA8888, high-byte is Alpha */
+ IMAGE_UTIL_COLORSPACE_RGBA8888, /**< RGBA8888, high-byte is Alpha */
+ IMAGE_UTIL_COLORSPACE_BGRX8888, /**< BGRX8888, high-byte is X */
+ IMAGE_UTIL_COLORSPACE_NV21, /**< NV12- planar */
+ IMAGE_UTIL_COLORSPACE_NV16, /**< NV16- planar */
+ IMAGE_UTIL_COLORSPACE_NV61, /**< NV61- planar */
+}image_util_colorspace_e;
+
+/**
+ * @brief Enumeration for scale decoding.
+ * @since_tizen 2.4
+ */
+typedef enum
+{
+ IMAGE_UTIL_DOWNSCALE_1_1, /** 1/1 downscale */
+ IMAGE_UTIL_DOWNSCALE_1_2, /** 1/2 downscale */
+ IMAGE_UTIL_DOWNSCALE_1_4, /** 1/4 downscale */
+ IMAGE_UTIL_DOWNSCALE_1_8, /** 1/8 downscale */
+} image_util_scale_e;
+
+/**
+ * @brief Enumeration for rotation.
+ * @since_tizen 2.3
+ */
+typedef enum
+{
+ IMAGE_UTIL_ROTATION_NONE = 0, /**< None */
+ IMAGE_UTIL_ROTATION_90, /**< Rotation 90 degree */
+ IMAGE_UTIL_ROTATION_180, /**< Rotation 180 degree */
+ IMAGE_UTIL_ROTATION_270, /**< Rotation 270 degree */
+ IMAGE_UTIL_ROTATION_FLIP_HORZ, /**< Flip horizontal */
+ IMAGE_UTIL_ROTATION_FLIP_VERT, /**< Flip vertical */
+} image_util_rotation_e;
+
+/**
+* @ingroup CAPI_MEDIA_IMAGE_UTIL_MODULE
+* @brief Image util handle.
+* @since_tizen 2.3
+*/
+typedef struct transformation_s *transformation_h;
+
+/**
+* @ingroup CAPI_MEDIA_IMAGE_UTIL_MODULE
+* @brief Called when transform is finished just before returning the output.
+* @since_tizen 2.3
+*
+* @remarks You must release the @a dst result using media_packet_destroy().
+*
+* @param[in] error_code The error code of image util transfrom
+* @param[in,out] dst The result buffer of image util transform
+* @param[in] user_data The user data passed from the callback registration function
+* @pre image_util_transform_run() will invoke this function.
+*/
+typedef void (*image_util_transform_completed_cb)(media_packet_h *dst, int error_code, void *user_data);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_MEDIA_IMAGE_UTIL_TYPE_H__ */
Name: capi-media-image-util
Summary: A Image Utility library in Tizen Native API
-Version: 0.1.1
+Version: 0.1.2
Release: 0
Group: Multimedia/API
License: Apache-2.0
MM_UTIL_JPEG_FMT_YUV420 , /* IMAGE_UTIL_COLORSPACE_YUV420 */
-1 , /* IMAGE_UTIL_COLORSPACE_YUV422 */
MM_UTIL_JPEG_FMT_YUV420 , /* IMAGE_UTIL_COLORSPACE_I420 */
- MM_UTIL_JPEG_FMT_NV12 , /* IMAGE_UTIL_COLORSPACE_NV12 */
+ -1 , /* IMAGE_UTIL_COLORSPACE_NV12 */
-1 , /* IMAGE_UTIL_COLORSPACE_UYVY */
- MM_UTIL_JPEG_FMT_YUYV , /* IMAGE_UTIL_COLORSPACE_YUYV */
+ -1 , /* IMAGE_UTIL_COLORSPACE_YUYV */
-1 , /* IMAGE_UTIL_COLORSPACE_RGB565 */
MM_UTIL_JPEG_FMT_RGB888 , /* IMAGE_UTIL_COLORSPACE_RGB888 */
MM_UTIL_JPEG_FMT_ARGB8888 , /* IMAGE_UTIL_COLORSPACE_ARGB8888 */
MM_UTIL_JPEG_FMT_BGRA8888 , /* IMAGE_UTIL_COLORSPACE_BGRA8888 */
MM_UTIL_JPEG_FMT_RGBA8888 , /* IMAGE_UTIL_COLORSPACE_RGBA8888 */
-1 , /* IMAGE_UTIL_COLORSPACE_BGRX8888 */
- MM_UTIL_JPEG_FMT_NV21 , /* IMAGE_UTIL_COLORSPACE_NV21 */
- MM_UTIL_JPEG_FMT_NV16 , /* IMAGE_UTIL_COLORSPACE_NV16 */
- MM_UTIL_JPEG_FMT_NV61 , /* IMAGE_UTIL_COLORSPACE_NV61 */
+ -1 , /* IMAGE_UTIL_COLORSPACE_NV21 */
+ -1 , /* IMAGE_UTIL_COLORSPACE_NV16 */
+ -1 , /* IMAGE_UTIL_COLORSPACE_NV61 */
};
+static int _convert_decode_scale_tbl[] = {
+ MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1,
+ MM_UTIL_JPEG_DECODE_DOWNSCALE_1_2,
+ MM_UTIL_JPEG_DECODE_DOWNSCALE_1_4,
+ MM_UTIL_JPEG_DECODE_DOWNSCALE_1_8,
+};
static int _convert_image_util_error_code(const char *func, int code){
int ret = IMAGE_UTIL_ERROR_INVALID_OPERATION;
if(handle && handle->image_h)
{
- ret = mm_transform_is_completed(handle->image_h, is_completed);
+ ret = mm_util_transform_is_completed(handle->image_h, is_completed);
}
else
{
return IMAGE_UTIL_ERROR_INVALID_PARAMETER;
}
+ if(!_handle->set_convert)
+ {
+ LOGE("Did not set colorspace before");
+ return IMAGE_UTIL_ERROR_INVALID_OPERATION;
+ }
+
if(!colorspace)
{
LOGE("colorspace area parameter error");
return IMAGE_UTIL_ERROR_INVALID_PARAMETER;
}
+ if(!_handle->set_resize)
+ {
+ LOGE("Did not set resolution before");
+ return IMAGE_UTIL_ERROR_INVALID_OPERATION;
+ }
+
if(!width || !height)
{
LOGE("resolution area parameter error");
return IMAGE_UTIL_ERROR_INVALID_PARAMETER;
}
+ if(!_handle->set_rotate)
+ {
+ LOGE("Did not set rotation before");
+ return IMAGE_UTIL_ERROR_INVALID_OPERATION;
+ }
+
if(!rotation)
{
LOGE("rotation area parameter error");
return IMAGE_UTIL_ERROR_INVALID_PARAMETER;
}
- if(_handle->set_resize)
+ if(!_handle->set_crop)
{
- LOGE("Crop and Resize can't do at the same time");
+ LOGE("Did not set crop area before");
return IMAGE_UTIL_ERROR_INVALID_OPERATION;
}
return _convert_image_util_error_code(__func__, ret);
}
+int image_util_decode_jpeg_with_downscale( const char *path, image_util_colorspace_e colorspace, image_util_scale_e downscale, unsigned char ** image_buffer, int *width, int *height, unsigned int *size)
+{
+ int ret = IMAGE_UTIL_ERROR_NONE;
+
+ if( path == NULL || image_buffer == NULL || size == NULL)
+ return _convert_image_util_error_code(__func__, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
+ if(strlen (path) == 0)
+ return _convert_image_util_error_code(__func__, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
+ if( colorspace < 0 || colorspace >= sizeof(_convert_colorspace_tbl)/sizeof(int))
+ return _convert_image_util_error_code(__func__, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
+ if( _convert_encode_colorspace_tbl[colorspace] == -1 )
+ return _convert_image_util_error_code(__func__, MM_ERROR_IMAGE_NOT_SUPPORT_FORMAT);
+ if( downscale < 0 || downscale >= sizeof(_convert_decode_scale_tbl)/sizeof(int))
+ return _convert_image_util_error_code(__func__, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
+
+ mm_util_jpeg_yuv_data decoded = { 0, 0, 0, NULL};
+
+ ret = mm_util_decode_from_jpeg_file_with_downscale(&decoded, (char*)path, _convert_encode_colorspace_tbl[colorspace], _convert_decode_scale_tbl[downscale]);
+ if( ret == 0 ){
+ *image_buffer = decoded.data;
+ if(width)
+ *width = decoded.width;
+ if(height)
+ *height = decoded.height;
+ if(size)
+ *size = decoded.size;
+ }
+ return _convert_image_util_error_code(__func__, ret);
+}
+
+int image_util_decode_jpeg_from_memory_with_downscale( const unsigned char * jpeg_buffer, int jpeg_size, image_util_colorspace_e colorspace, image_util_scale_e downscale, unsigned char ** image_buffer, int *width, int *height, unsigned int *size)
+{
+ int ret = IMAGE_UTIL_ERROR_NONE;
+
+ if( jpeg_buffer == NULL || image_buffer == NULL || size == NULL)
+ return _convert_image_util_error_code(__func__, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
+ if( colorspace < 0 ||colorspace >= sizeof(_convert_colorspace_tbl)/sizeof(int))
+ return _convert_image_util_error_code(__func__, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
+ if( _convert_encode_colorspace_tbl[colorspace] == -1 )
+ return _convert_image_util_error_code(__func__, MM_ERROR_IMAGE_NOT_SUPPORT_FORMAT);
+ if( downscale < 0 || downscale >= sizeof(_convert_decode_scale_tbl)/sizeof(int))
+ return _convert_image_util_error_code(__func__, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
+
+ mm_util_jpeg_yuv_data decoded;
+
+ ret = mm_util_decode_from_jpeg_memory_with_downscale(&decoded, jpeg_buffer, jpeg_size, _convert_encode_colorspace_tbl[colorspace], _convert_decode_scale_tbl[downscale]);
+
+ if( ret == 0 ){
+ *image_buffer = decoded.data;
+ if(width)
+ *width = decoded.width;
+ if(height)
+ *height = decoded.height;
+ if(size)
+ *size = decoded.size;
+ }
+
+ return _convert_image_util_error_code(__func__, ret);
+}
+
int image_util_encode_jpeg( const unsigned char *buffer, int width, int height, image_util_colorspace_e colorspace, int quality, const char *path)
{
int ret = IMAGE_UTIL_ERROR_NONE;
MESSAGE(${flag})
ENDFOREACH()
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -pie -Wall")
#ADD_EXECUTABLE("system-sensor" system-sensor.c)
#TARGET_LINK_LIBRARIES("system-sensor" ${fw_name} ${${fw_test}_LDFLAGS})