Change flag for some attributes
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_configure.c
index c37a213..575a073 100644 (file)
@@ -629,9 +629,6 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
 
        /* [VideoInput] matching table */
        static conf_info_table conf_main_video_input_table[] = {
-               { "UseConfCtrl",        CONFIGURE_VALUE_INT,            {.value_int = 1} },
-               { "ConfCtrlFile0",      CONFIGURE_VALUE_STRING,         {NULL} },
-               { "ConfCtrlFile1",      CONFIGURE_VALUE_STRING,         {NULL} },
                { "VideosrcElement",    CONFIGURE_VALUE_ELEMENT,        {&_videosrc_element_default} },
                { "UseVideoscale",      CONFIGURE_VALUE_INT,            {.value_int = 0} },
                { "VideoscaleElement",  CONFIGURE_VALUE_ELEMENT,        {&_videoscale_element_default} },
@@ -779,11 +776,12 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
                { "FPS9",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
                { "PictureFormat",        CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
                { "Overlay",              CONFIGURE_VALUE_INT_RANGE,      {NULL} },
-               { "RecommendDisplayRotation", CONFIGURE_VALUE_INT,     {.value_int = 3}    },
+               { "RecommendDisplayRotation", CONFIGURE_VALUE_INT,     {.value_int = 3} },
                { "RecommendPreviewFormatCapture", CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_YUYV} },
                { "RecommendPreviewFormatRecord",  CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_NV12} },
                { "RecommendPreviewResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
                { "FacingDirection",      CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_CAMERA_FACING_DIRECTION_REAR} },
+               { "FrameStabilityCount",  CONFIGURE_VALUE_INT,     {.value_int = 0} },
        };
 
        /* [Strobe] matching table */
@@ -800,6 +798,7 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
                { "Contrast",             CONFIGURE_VALUE_INT_RANGE, {NULL} },
                { "Saturation",           CONFIGURE_VALUE_INT_RANGE, {NULL} },
                { "Sharpness",            CONFIGURE_VALUE_INT_RANGE, {NULL} },
+               { "Hue",                  CONFIGURE_VALUE_INT_RANGE, {NULL} },
                { "WhiteBalance",         CONFIGURE_VALUE_INT_ARRAY, {NULL} },
                { "ColorTone",            CONFIGURE_VALUE_INT_ARRAY, {NULL} },
                { "Flip",                 CONFIGURE_VALUE_INT_ARRAY, {NULL} },
@@ -840,6 +839,7 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
                { "SensorEncodedCapture", CONFIGURE_VALUE_INT,       {.value_int = 1} },
                { "SupportHDR",           CONFIGURE_VALUE_INT_ARRAY, {NULL} },
                { "SupportZSL",           CONFIGURE_VALUE_INT,       {.value_int = FALSE} },
+               { "FrameStabilityCount",  CONFIGURE_VALUE_INT,       {.value_int = 0} },
        };
 
        /* [Detect] matching table */
@@ -920,27 +920,24 @@ int _mmcamcorder_conf_get_info(MMHandleType handle, int type, const char *ConfFi
        _mmcam_dbg_log("Try open Configure File[%s]", conf_path);
 
        fp = fopen(conf_path, "r");
-       if (fp == NULL) {
+       if (!fp) {
                _mmcam_dbg_warn("File open failed.[%s] retry...", conf_path);
 
                snprintf(conf_path, sizeof(conf_path), "%s/multimedia/%s", TZ_SYS_ETC, ConfFile);
                _mmcam_dbg_log("Try open Configure File[%s]", conf_path);
                fp = fopen(conf_path, "r");
-               if (fp == NULL)
+               if (!fp) {
                        _mmcam_dbg_warn("open failed.[%s] errno [%d]", conf_path, errno);
+                       ret = MM_ERROR_CAMCORDER_NOT_SUPPORTED;
+               }
        }
 
-       if (fp != NULL) {
+       if (fp) {
                ret = _mmcamcorder_conf_parse_info(handle, type, fp, configure_info);
                fclose(fp);
-       } else {
-               if (errno == ENOENT)
-                       ret = MM_ERROR_CAMCORDER_NOT_SUPPORTED;
-               else
-                       ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE;
        }
 
-       _mmcam_dbg_log("Leave...");
+       _mmcam_dbg_log("Leave [0x%x]", ret);
 
        return ret;
 }
@@ -980,13 +977,13 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera
 
        new_conf = (camera_conf *)g_malloc0(sizeof(camera_conf));
        if (new_conf == NULL) {
-               _mmcam_dbg_err("new_conf alloc failed : %d", sizeof(camera_conf));
+               _mmcam_dbg_err("new_conf alloc failed : %zu", sizeof(camera_conf));
                return MM_ERROR_CAMCORDER_LOW_MEMORY;
        }
 
        buffer_string = (char*)g_malloc0(sizeof(char) * BUFFER_LENGTH_STRING);
        if (buffer_string == NULL) {
-               _mmcam_dbg_err("buffer_string alloc failed : %d", sizeof(char) * BUFFER_LENGTH_STRING);
+               _mmcam_dbg_err("buffer_string alloc failed : %zu", sizeof(char) * BUFFER_LENGTH_STRING);
                g_free(new_conf);
                return MM_ERROR_CAMCORDER_LOW_MEMORY;
        }
@@ -1629,7 +1626,7 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info
                                                }
                                        }
                                } else {
-                                       _mmcam_dbg_err("malloc failed : %d", sizeof(type_string2*)*(new_element->count_string));
+                                       _mmcam_dbg_err("malloc failed : %zu", sizeof(type_string2*)*(new_element->count_string));
                                }
                        } else {
                                /*_mmcam_dbg_err("invalid count - %d", new_element->count_string);*/
@@ -2768,7 +2765,7 @@ _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int **
 
                arr = (int*) g_malloc0(count * sizeof(int));
                if (arr == NULL) {
-                       _mmcam_dbg_err("malloc failed : %d", count * sizeof(int));
+                       _mmcam_dbg_err("malloc failed : %zu", count * sizeof(int));
                        return 0;
                }