From f4d129c3f56a6654614ee722bcb22d12213e3c6f Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Wed, 5 Oct 2016 11:40:49 +0900 Subject: [PATCH] Update code for configuration Some type information has no default value, so the error could be occurred. Then, skip the error in case of some type which has no default value. [Version] 0.10.76 [Profile] Common [Issue Type] Update [Dependency module] N/A [Dependency commit] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-mobile_20160930.5] Change-Id: I0af2aabc7597167388fe2c18d0e2218294732e58 Signed-off-by: Jeongmo Yang --- packaging/libmm-camcorder.spec | 2 +- src/mm_camcorder_configure.c | 18 +++++++++--------- src/mm_camcorder_platform.c | 25 +++++++++++-------------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index 9c2c3cc..a23e305 100644 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -1,6 +1,6 @@ Name: libmm-camcorder Summary: Camera and recorder library -Version: 0.10.75 +Version: 0.10.76 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_camcorder_configure.c b/src/mm_camcorder_configure.c index 14feac1..1f64188 100644 --- a/src/mm_camcorder_configure.c +++ b/src/mm_camcorder_configure.c @@ -1671,11 +1671,11 @@ int _mmcamcorder_conf_get_value_int(MMHandleType handle, camera_conf* configure_ } if (_mmcamcorder_conf_get_default_value_int(handle, configure_info->type, category, name, value)) { - /* _mmcam_dbg_log("Get[%s] int[%d]", name, *value); */ + /*_mmcam_dbg_log("Get[%s] int[%d]", name, *value);*/ return TRUE; } - _mmcam_dbg_warn("Faild to get int... check it...Category[%d],Name[%s]", category, name); + _mmcam_dbg_err("Faild to get int... check it...Category[%d],Name[%s]", category, name); return FALSE; } @@ -1787,7 +1787,7 @@ _mmcamcorder_conf_get_value_int_pair_array(camera_conf* configure_info, int cate *value = NULL; - _mmcam_dbg_warn("Faild to get int pair array... check it...Category[%d],Name[%s]", category, name); + /*_mmcam_dbg_warn("Faild to get int pair array... check it...Category[%d],Name[%s]", category, name);*/ return FALSE; } @@ -1812,18 +1812,18 @@ int _mmcamcorder_conf_get_value_string(MMHandleType handle, camera_conf* configu if (!strcmp(((type_string*)(info->detail_info[i]))->name , name)) { *value = ((type_string*)(info->detail_info[i]))->value; - /* _mmcam_dbg_log( "Get[%s] string[%s]", name, *value ); */ + /*_mmcam_dbg_log( "Get[%s] string[%s]", name, *value ? *value : "NULL" );*/ return TRUE; } } } if (_mmcamcorder_conf_get_default_value_string(handle, configure_info->type, category, name, value)) { - /* _mmcam_dbg_log("Get[%s]string[%s]", name, *value); */ + /*_mmcam_dbg_log( "Get[%s] string[%s]", name, *value ? *value : "NULL" );*/ return TRUE; } - _mmcam_dbg_warn("Faild to get string... check it...Category[%d],Name[%s]", category, name); + _mmcam_dbg_err("Faild to get string... check it...Category[%d],Name[%s]", category, name); return FALSE; } @@ -2054,7 +2054,7 @@ _mmcamcorder_conf_get_default_value_int(MMHandleType handle, int type, int categ } } - _mmcam_dbg_warn("Failed to get default int... check it... Type[%d],Category[%d],Name[%s]", type, category, name); + _mmcam_dbg_err("Failed to get default int... check it... Type[%d],Category[%d],Name[%s]", type, category, name); return FALSE; } @@ -2084,7 +2084,7 @@ int _mmcamcorder_conf_get_default_value_string(MMHandleType handle, int type, in for (i = 0 ; i < count_value ; i++) { if (!strcmp(hcamcorder->conf_main_info_table[category][i].name, name)) { *value = hcamcorder->conf_main_info_table[category][i].value_string; - _mmcam_dbg_log("Get[%s] default string[%s]", name, *value); + /*_mmcam_dbg_log("Get[%s] default string[%s]", name, *value ? *value : "NULL");*/ return TRUE; } } @@ -2092,7 +2092,7 @@ int _mmcamcorder_conf_get_default_value_string(MMHandleType handle, int type, in for (i = 0 ; i < count_value ; i++) { if (!strcmp(hcamcorder->conf_ctrl_info_table[category][i].name, name)) { *value = hcamcorder->conf_ctrl_info_table[category][i].value_string; - _mmcam_dbg_log("Get[%s] default string[%s]", name, *value); + /*_mmcam_dbg_log("Get[%s] default string[%s]", name, *value ? *value : "NULL");*/ return TRUE; } } diff --git a/src/mm_camcorder_platform.c b/src/mm_camcorder_platform.c index b4c0117..9dcd29d 100644 --- a/src/mm_camcorder_platform.c +++ b/src/mm_camcorder_platform.c @@ -940,6 +940,9 @@ int __mmcamcorder_set_info_to_attr(MMHandleType handle, _MMCamcorderInfoConverti info[i].conv_type); */ + if (ret != MM_ERROR_NONE) + break; + if (info[i].type == CONFIGURE_TYPE_MAIN) { conf_info = hcamcorder->conf_main; /*_mmcam_dbg_log("MAIN configure [%s]", info[i].keyword);*/ @@ -955,7 +958,7 @@ int __mmcamcorder_set_info_to_attr(MMHandleType handle, _MMCamcorderInfoConverti if (!_mmcamcorder_conf_get_value_int(handle, conf_info, info[i].category, info[i].keyword, &ivalue)) { ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE; - break; /* skip to set */ + break; /* skip to set */ } ret = mm_attrs_set_int(MMF_CAMCORDER_ATTRS(hcamcorder), info[i].attr_idx, ivalue); @@ -968,10 +971,8 @@ int __mmcamcorder_set_info_to_attr(MMHandleType handle, _MMCamcorderInfoConverti int idefault = 0; type_int_array *tarray = NULL; - if (!_mmcamcorder_conf_get_value_int_array(conf_info, info[i].category, info[i].keyword, &tarray)) { - ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE; - break; /* skip to set */ - } + if (!_mmcamcorder_conf_get_value_int_array(conf_info, info[i].category, info[i].keyword, &tarray)) + break; /* skip to set, but not error */ if (tarray) { idefault = tarray->default_value; @@ -1006,10 +1007,8 @@ int __mmcamcorder_set_info_to_attr(MMHandleType handle, _MMCamcorderInfoConverti { type_int_range *irange = NULL; - if (!_mmcamcorder_conf_get_value_int_range(conf_info, info[i].category, info[i].keyword, &irange)) { - ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE; - break; /* skip to set */ - } + if (!_mmcamcorder_conf_get_value_int_range(conf_info, info[i].category, info[i].keyword, &irange)) + break; /* skip to set, but not error */ if (irange) { /* _mmcam_dbg_log("INT Range. m:%d, s:%d, min=%d, max=%d", info[i].main_key, info[i].sub_key1, irange->min, irange->max); */ @@ -1029,7 +1028,7 @@ int __mmcamcorder_set_info_to_attr(MMHandleType handle, _MMCamcorderInfoConverti if (!_mmcamcorder_conf_get_value_string(handle, conf_info, info[i].category, info[i].keyword, &cString)) { ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE; - break; /* skip to set */ + break; /* skip to set */ } /* _mmcam_dbg_log("String. m:%d, s:%d, cString=%s", info[i].main_key, info[i].sub_key1, cString); */ @@ -1048,10 +1047,8 @@ int __mmcamcorder_set_info_to_attr(MMHandleType handle, _MMCamcorderInfoConverti /*_mmcam_dbg_log("INT PAIR Array. type:%d, attr_idx:%d, attr_idx_pair:%d", info[i].type, info[i].attr_idx, info[i].attr_idx_pair);*/ - if (!_mmcamcorder_conf_get_value_int_pair_array(conf_info, info[i].category, info[i].keyword, &pair_array)) { - ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE; - break; /* skip to set */ - } + if (!_mmcamcorder_conf_get_value_int_pair_array(conf_info, info[i].category, info[i].keyword, &pair_array)) + break; /* skip to set, but not error */ if (pair_array && pair_array->count > 0) { /* "mmf_attrs_set_valid_type" initializes spec value in attribute, so allocated memory could be missed */ -- 2.7.4