+int _mmcamcorder_get_fps_array_by_resolution(MMHandleType handle, int width, int height, MMCamAttrsInfo* fps_info)
+{
+ MMCamAttrsInfo *infoW = NULL;
+ MMCamAttrsInfo *infoH = NULL;
+ int i = 0;
+ char nameFps[16] = {0,};
+ bool valid_check = false;
+
+ type_int_array *fps_array;
+
+ mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+
+ MMCAM_LOG_DEBUG("resolution %dx%d", width, height);
+
+ infoW = (MMCamAttrsInfo*)calloc(1, sizeof(MMCamAttrsInfo));
+ if (infoW == NULL) {
+ MMCAM_LOG_ERROR("failed to alloc infoW");
+ return MM_ERROR_CAMCORDER_LOW_MEMORY;
+ }
+
+ infoH = (MMCamAttrsInfo*)calloc(1, sizeof(MMCamAttrsInfo));
+ if (infoH == NULL) {
+ MMCAM_LOG_ERROR("failed to alloc infoH");
+
+ free(infoW);
+ infoW = NULL;
+
+ return MM_ERROR_CAMCORDER_LOW_MEMORY;
+ }
+
+ mm_camcorder_get_attribute_info(handle, MMCAM_CAMERA_WIDTH, infoW);
+ mm_camcorder_get_attribute_info(handle, MMCAM_CAMERA_HEIGHT, infoH);
+
+ for (i = 0; i < infoW->int_array.count; i++) {
+ MMCAM_LOG_VERBOSE("check resolution %dx%d", infoW->int_array.array[i], infoH->int_array.array[i]);
+ if (infoW->int_array.array[i] == width && infoH->int_array.array[i] == height) {
+ valid_check = true;
+ snprintf(nameFps, sizeof(nameFps), "FPS%d", i);
+ MMCAM_LOG_INFO("nameFps[%s]", nameFps);
+ break;
+ }
+ }
+
+ free(infoW);
+ infoW = NULL;
+ free(infoH);
+ infoH = NULL;
+
+ if (!valid_check) {
+ MMCAM_LOG_ERROR("FAILED : Can't find the valid resolution from attribute.");
+ return MM_ERROR_CAMCORDER_NOT_SUPPORTED;
+ }
+
+ if (!_mmcamcorder_conf_get_value_int_array(hcamcorder->conf_ctrl, CONFIGURE_CATEGORY_CTRL_CAMERA, nameFps, &fps_array)) {
+ MMCAM_LOG_ERROR("FAILED : Can't find the valid FPS array.");
+ return MM_ERROR_CAMCORDER_CREATE_CONFIGURE;
+ }
+
+ fps_info->int_array.count = fps_array->count;
+ fps_info->int_array.array = fps_array->value;
+ fps_info->int_array.def = fps_array->default_value;
+
+ return MM_ERROR_NONE;
+}
+
+/* convert sensor value to MSL value */