X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmm_camcorder_configure.c;h=20618ad013ca6ab357f4c471a3d87c235049fbf4;hb=HEAD;hp=2f7758257c46025f417300f80b77c08f23853a93;hpb=1125f77a18d575f37b5959651b5020a707fa9d7d;p=platform%2Fcore%2Fmultimedia%2Flibmm-camcorder.git diff --git a/src/mm_camcorder_configure.c b/src/mm_camcorder_configure.c index 2f77582..12d0699 100644 --- a/src/mm_camcorder_configure.c +++ b/src/mm_camcorder_configure.c @@ -42,8 +42,10 @@ | LOCAL VARIABLE DEFINITIONS | -----------------------------------------------------------------------*/ #define DEFAULT_AUDIO_BUFFER_INTERVAL 50 +#define DEFAULT_ENCODED_PREVIEW_BITRATE (1024*1024*4) -#define __MMCAMCORDER_CONF_FILEPATH_LENGTH 128 +#define MMCAMCORDER_CONF_FILEPATH_LENGTH 128 +#define MMCAMCORDER_BUFFER_LINE_MAX 256 char *get_new_string(char* src_string) { @@ -190,6 +192,36 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure 0, }; + /* MJPEG decoder element default value */ + static type_element _videodecoder_element_mjpeg_default = { + "VideodecoderElementMJPEG", + "jpegdec", + NULL, + 0, + NULL, + 0, + }; + + /* VP8 decoder element default value */ + static type_element _videodecoder_element_vp8_default = { + "VideodecoderElementVP8", + "vp8dec", + NULL, + 0, + NULL, + 0, + }; + + /* VP9 decoder element default value */ + static type_element _videodecoder_element_vp9_default = { + "VideodecoderElementVP9", + "vp9dec", + NULL, + 0, + NULL, + 0, + }; + /* Record sink element default value */ static type_element _recordsink_element_default = { "RecordsinkElement", @@ -622,21 +654,23 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure /* [General] matching table */ static conf_info_table conf_main_general_table[] = { - { "SyncStateChange", CONFIGURE_VALUE_INT, {.value_int = 1} }, - { "GSTInitOption", CONFIGURE_VALUE_STRING_ARRAY, {NULL} }, - { "ModelName", CONFIGURE_VALUE_STRING, {NULL} }, - { "DisabledAttributes", CONFIGURE_VALUE_STRING_ARRAY, {NULL} }, + { "GSTInitOption", CONFIGURE_VALUE_STRING_ARRAY, {NULL} }, + { "PlatformPrivilegeCamera", CONFIGURE_VALUE_STRING, {NULL} }, + { "LogLevel", CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_LOG_LEVEL_INFO} }, + { "NetworkCameraHALName", CONFIGURE_VALUE_STRING, {NULL} }, }; /* [VideoInput] matching table */ static conf_info_table conf_main_video_input_table[] = { - { "VideosrcElement", CONFIGURE_VALUE_ELEMENT, {&_videosrc_element_default} }, - { "UseVideoscale", CONFIGURE_VALUE_INT, {.value_int = 0} }, - { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {&_videoscale_element_default} }, - { "UseZeroCopyFormat", CONFIGURE_VALUE_INT, {.value_int = 0} }, - { "DeviceCount", CONFIGURE_VALUE_INT, {.value_int = MM_VIDEO_DEVICE_NUM} }, - { "SupportMediaPacketPreviewCb", CONFIGURE_VALUE_INT, {.value_int = 0} }, - { "SupportUserBuffer", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideosrcElement", CONFIGURE_VALUE_ELEMENT, {&_videosrc_element_default} }, + { "UseVideoscale", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {&_videoscale_element_default} }, + { "UseZeroCopyFormat", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "DeviceCount", CONFIGURE_VALUE_INT, {.value_int = MM_VIDEO_DEVICE_NUM} }, + { "SupportMediaPacketPreviewCb", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "SupportUserBuffer", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "MeasurePreviewFPS", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "DefaultEncodedPreviewBitrate", CONFIGURE_VALUE_INT, {.value_int = DEFAULT_ENCODED_PREVIEW_BITRATE} }, }; /* [AudioInput] matching table */ @@ -662,13 +696,15 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure { "UseVideoconvert", CONFIGURE_VALUE_INT, {.value_int = 0} }, { "VideoconvertElement", CONFIGURE_VALUE_ELEMENT, {&_videoconvert_element_default} }, { "VideodecoderElementH264", CONFIGURE_VALUE_ELEMENT, {&_videodecoder_element_h264_default} }, + { "VideodecoderElementMJPEG",CONFIGURE_VALUE_ELEMENT, {&_videodecoder_element_mjpeg_default} }, + { "VideodecoderElementVP8", CONFIGURE_VALUE_ELEMENT, {&_videodecoder_element_vp8_default} }, + { "VideodecoderElementVP9", CONFIGURE_VALUE_ELEMENT, {&_videodecoder_element_vp9_default} }, { "RecreateDecoder", CONFIGURE_VALUE_INT, {.value_int = 0} } }; /* [Capture] matching table */ static conf_info_table conf_main_capture_table[] = { - { "UseEncodebin", CONFIGURE_VALUE_INT, {.value_int = 0} }, - { "UseCaptureMode", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "CaptureMode", CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_CAPTURE_MODE_ENCODEBIN} }, { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {&_videoscale_element_default} }, { "PlayCaptureSound", CONFIGURE_VALUE_INT, {.value_int = 1} }, }; @@ -780,12 +816,26 @@ 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} }, - { "RecommendPreviewFormatCapture", CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_YUYV} }, - { "RecommendPreviewFormatRecord", CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_NV12} }, + { "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} }, + { "FacingDirection", CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_CAMERA_FACING_DIRECTION_REAR} }, + { "FrameStabilityCount", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "SupportExtraPreview", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "ExtraPreviewMode", CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_EXTRA_PREVIEW_MODE_CAMERA_CONTROL} }, + { "AltVideosrcElement", CONFIGURE_VALUE_ELEMENT, {NULL} }, /* The alternative of videosrc element, it will be used instead of "VideosrcElement" if exists. */ + { "AltUseZeroCopyFormat", CONFIGURE_VALUE_INT, {.value_int = -1} }, /* The alternative of "UseZeroCopyFormat", it will be used if it's not default(-1) value. */ + { "VideoFilterElement", CONFIGURE_VALUE_ELEMENT, {NULL} }, /* The video filter element which is placed between videosrc and videosink elements. */ + { "VideoFilterCropX", CONFIGURE_VALUE_INT, {.value_int = 0} }, /* The VideoFilterElement is existed and these values are valid, they will be set to "crop" property. */ + { "VideoFilterCropY", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideoFilterCropW", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideoFilterCropH", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideoFilter2Element", CONFIGURE_VALUE_ELEMENT, {NULL} }, + { "VideoFilter2CropX", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideoFilter2CropY", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideoFilter2CropW", CONFIGURE_VALUE_INT, {.value_int = 0} }, + { "VideoFilter2CropH", CONFIGURE_VALUE_INT, {.value_int = 0} } }; /* [Strobe] matching table */ @@ -793,23 +843,26 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure { "StrobeControl", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, { "StrobeMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, { "StrobeEV", CONFIGURE_VALUE_INT_RANGE, {NULL} }, + { "StrobeBrightness", CONFIGURE_VALUE_INT_RANGE, {NULL} }, }; /* [Effect] matching table */ static conf_info_table conf_ctrl_effect_table[] = { - { "Brightness", CONFIGURE_VALUE_INT_RANGE, {NULL} }, - { "BrightnessStepDenominator", CONFIGURE_VALUE_INT, {.value_int = 2} }, - { "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} }, - { "Rotation", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, - { "WDR", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, - { "PartColorMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, - { "PartColor", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, + { "Brightness", CONFIGURE_VALUE_INT_RANGE, {NULL} }, + { "BrightnessStepDenominator", CONFIGURE_VALUE_INT, {.value_int = 2} }, + { "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} }, + { "Rotation", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, + { "WDR", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, + { "PartColorMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, + { "PartColor", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, + { "WhiteBalanceTemperature", CONFIGURE_VALUE_INT_RANGE, {NULL} }, + { "WhiteBalanceTemperatureStep", CONFIGURE_VALUE_INT, {.value_int = 1} } }; /* [Photograph] matching table */ @@ -818,6 +871,7 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure { "DigitalZoom", CONFIGURE_VALUE_INT_RANGE, {NULL} }, { "OpticalZoom", CONFIGURE_VALUE_INT_RANGE, {NULL} }, { "FocusMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, + { "FocusLevel", CONFIGURE_VALUE_INT_RANGE, {NULL} }, { "AFType", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, { "AEType", CONFIGURE_VALUE_INT_ARRAY, {NULL} }, { "ExposureValue", CONFIGURE_VALUE_INT_RANGE, {NULL} }, @@ -834,6 +888,8 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure { "PanElec", CONFIGURE_VALUE_INT_RANGE, {NULL} }, { "TiltMecha", CONFIGURE_VALUE_INT_RANGE, {NULL} }, { "TiltElec", CONFIGURE_VALUE_INT_RANGE, {NULL} }, + { "Gain", CONFIGURE_VALUE_INT_RANGE, {NULL} }, + { "GainStep", CONFIGURE_VALUE_INT, {.value_int = 1} } }; /* [Capture] matching table */ @@ -855,7 +911,7 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure { "DetectSelectNumber", CONFIGURE_VALUE_INT_RANGE, {NULL} }, }; - _mmcam_dbg_log("Entered..."); + MMCAM_LOG_INFO("Entered..."); if (type == CONFIGURE_TYPE_MAIN) { hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_GENERAL] = conf_main_general_table; @@ -900,12 +956,8 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure } configure_info->info = (conf_detail **)g_malloc0(sizeof(conf_detail *) * category_num); - if (configure_info->info == NULL) { - _mmcam_dbg_err("category info alloc failed : type %d", type); - return MM_ERROR_CAMCORDER_LOW_MEMORY; - } - _mmcam_dbg_log("Done."); + MMCAM_LOG_INFO("Done."); return MM_ERROR_NONE; } @@ -915,34 +967,33 @@ int _mmcamcorder_conf_get_info(MMHandleType handle, int type, const char *ConfFi { int ret = MM_ERROR_NONE; FILE *fp = NULL; - char conf_path[__MMCAMCORDER_CONF_FILEPATH_LENGTH] = {'\0',}; + char conf_path[MMCAMCORDER_CONF_FILEPATH_LENGTH] = {'\0',}; - _mmcam_dbg_log("Opening...[%s]", ConfFile); + MMCAM_LOG_INFO("Opening...[%s]", ConfFile); mmf_return_val_if_fail(ConfFile, FALSE); snprintf(conf_path, sizeof(conf_path), "%s/multimedia/%s", SYSCONFDIR, ConfFile); - _mmcam_dbg_log("Try open Configure File[%s]", conf_path); + MMCAM_LOG_INFO("Try open Configure File[%s]", conf_path); fp = fopen(conf_path, "r"); if (!fp) { - _mmcam_dbg_warn("File open failed.[%s] retry...", conf_path); + MMCAM_LOG_WARNING("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); + MMCAM_LOG_INFO("Try open Configure File[%s]", conf_path); fp = fopen(conf_path, "r"); if (!fp) { - _mmcam_dbg_warn("open failed.[%s] errno [%d]", conf_path, errno); - ret = MM_ERROR_CAMCORDER_NOT_SUPPORTED; + MMCAM_LOG_WARNING("open failed.[%s] errno [%d]", conf_path, errno); + return MM_ERROR_CAMCORDER_NOT_SUPPORTED; } } - if (fp) { - ret = _mmcamcorder_conf_parse_info(handle, type, fp, configure_info); - fclose(fp); - } + ret = _mmcamcorder_conf_parse_info(handle, type, fp, configure_info); + + fclose(fp); - _mmcam_dbg_log("Leave [0x%x]", ret); + MMCAM_LOG_INFO("Leave [0x%x]", ret); return ret; } @@ -952,8 +1003,8 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera { const unsigned int BUFFER_NUM_DETAILS = 256; const unsigned int BUFFER_NUM_TOKEN = 20; - size_t BUFFER_LENGTH_STRING = 256; - const char* delimiters = " |=,\t\n"; + size_t buffer_line_size = MMCAMCORDER_BUFFER_LINE_MAX; + const char* delimiters = " |=,\t\r\n"; int i = 0; int ret = MM_ERROR_NONE; @@ -974,30 +1025,20 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera camera_conf *new_conf = NULL; - _mmcam_dbg_log(""); + MMCAM_LOG_INFO(""); mmf_return_val_if_fail(handle && fp && configure_info, MM_ERROR_INVALID_ARGUMENT); *configure_info = NULL; new_conf = (camera_conf *)g_malloc0(sizeof(camera_conf)); - if (new_conf == NULL) { - _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 : %zu", sizeof(char) * BUFFER_LENGTH_STRING); - g_free(new_conf); - return MM_ERROR_CAMCORDER_LOW_MEMORY; - } + buffer_string = (char *)g_malloc0(sizeof(char) * buffer_line_size); new_conf->type = type; ret = _mmcamcorder_conf_init(handle, type, new_conf); if (ret != MM_ERROR_NONE) { - _mmcam_dbg_err("conf init failed 0x%x", ret); + MMCAM_LOG_ERROR("conf init failed 0x%x", ret); g_free(new_conf); g_free(buffer_string); return ret; @@ -1010,19 +1051,27 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera while (!feof(fp)) { if (read_main == 0) { - length_read = getline(&buffer_string, &BUFFER_LENGTH_STRING, fp); - /*_mmcam_dbg_log( "Read Line : [%s]", buffer_string );*/ + buffer_line_size = MMCAMCORDER_BUFFER_LINE_MAX; + length_read = getline(&buffer_string, &buffer_line_size, fp); + if (length_read < 1) { + MMCAM_LOG_DEBUG("skip this case - length read[%d]", length_read); + continue; + } + + buffer_string[--length_read] = '\0'; /* remove new line character */ + + MMCAM_LOG_DEBUG("Read Line : \"%s\"", buffer_string); count_token = 0; token = strtok_r(buffer_string, delimiters, &user_ptr); if ((token) && (token[0] == ';') && (length_read > -1)) { - /*_mmcam_dbg_log( "Comment - Nothing to do" );*/ + MMCAM_LOG_VERBOSE( "Comment - Nothing to do" ); continue; } while (token) { - /*_mmcam_dbg_log("token : [%s]", token);*/ + MMCAM_LOG_VERBOSE("token : \"%s\"", token); buffer_token[count_token] = token; count_token++; token = strtok_r(NULL, delimiters, &user_ptr); @@ -1036,12 +1085,12 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera if (*buffer_token[0] == ';') { /* Comment */ - /*_mmcam_dbg_log( "Comment - Nothing to do" );*/ + MMCAM_LOG_VERBOSE( "Comment - Nothing to do" ); } else if (*buffer_token[0] == '[') { /* Main Category */ category_name = get_new_string(buffer_token[0]); if (category_name == NULL) { - _mmcam_dbg_err("strdup failed for [%s]", buffer_token[0]); + MMCAM_LOG_ERROR("strdup failed for \"%s\"", buffer_token[0]); continue; } @@ -1049,15 +1098,22 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera count_details = 0; while (!feof(fp)) { - length_read = getline(&buffer_string, &BUFFER_LENGTH_STRING, fp); - /*_mmcam_dbg_log("Read Detail Line : [%s], read length : [%d]", buffer_string, length_read);*/ + length_read = getline(&buffer_string, &buffer_line_size, fp); + if (length_read < 1) { + MMCAM_LOG_DEBUG("skip this case - length read[%d]", length_read); + continue; + } + + buffer_string[--length_read] = '\0'; /* remove new line character */ + + MMCAM_LOG_DEBUG("Read Detail Line : \"%s\", length[%d]", buffer_string, length_read); detail_string = get_new_string(buffer_string); token = strtok_r(buffer_string, delimiters, &user_ptr); if (token && token[0] != ';' && length_read > -1) { - /*_mmcam_dbg_log("token : [%s]", token);*/ + MMCAM_LOG_VERBOSE("token : [%s]", token); if (token[0] == '[') { read_main = 1; buffer_token[0] = token; @@ -1071,10 +1127,10 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera } } - /*_mmcam_dbg_log("type : %d, category_name : %s, count : [%d]", type, category_name, count_details);*/ + MMCAM_LOG_DEBUG("type : %d, category_name : %s, count : [%d]", type, category_name, count_details); if (count_details == 0) { - _mmcam_dbg_warn("category %s has no detail value... skip this category...", category_name); + MMCAM_LOG_WARNING("category %s has no detail value... skip this category...", category_name); SAFE_G_FREE(category_name); continue; } @@ -1120,9 +1176,9 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera if (category != -1) { _mmcamcorder_conf_add_info(handle, type, &(new_conf->info[category]), - buffer_details, category, count_details); + buffer_details, category, count_details); } else { - _mmcam_dbg_warn("No matched category[%s],type[%d]... check it.", category_name, type); + MMCAM_LOG_WARNING("No matched category[%s],type[%d]... check it.", category_name, type); } /* Free memory */ @@ -1137,7 +1193,7 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera SAFE_G_FREE(buffer_string); - /*_mmcam_dbg_log("Done.");*/ + /*MMCAM_LOG_INFO("Done.");*/ return MM_ERROR_NONE; } @@ -1161,7 +1217,7 @@ void _mmcamcorder_conf_release_info(MMHandleType handle, camera_conf **configure type_string_array *temp_string_array = NULL; type_element2 *temp_element = NULL; - _mmcam_dbg_log("Entered..."); + MMCAM_LOG_INFO("Entered..."); mmf_return_if_fail(temp_conf); @@ -1240,7 +1296,7 @@ void _mmcamcorder_conf_release_info(MMHandleType handle, camera_conf **configure } break; default: - _mmcam_dbg_warn("unknown type %d", type); + MMCAM_LOG_WARNING("unknown type %d", type); break; } } @@ -1258,7 +1314,7 @@ void _mmcamcorder_conf_release_info(MMHandleType handle, camera_conf **configure SAFE_G_FREE((*configure_info)->info); SAFE_G_FREE((*configure_info)); - _mmcam_dbg_log("Done."); + MMCAM_LOG_INFO("Done."); } int _mmcamcorder_conf_get_value_type(MMHandleType handle, int type, int category, const char* name, int* value_type) @@ -1269,26 +1325,26 @@ int _mmcamcorder_conf_get_value_type(MMHandleType handle, int type, int category mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); if (hcamcorder == NULL) { - _mmcam_dbg_err("handle is NULL"); + MMCAM_LOG_ERROR("handle is NULL"); return FALSE; } - /*_mmcam_dbg_log("Entered...");*/ + /*MMCAM_LOG_INFO("Entered...");*/ mmf_return_val_if_fail(name, FALSE); if (!_mmcamcorder_conf_get_category_size(handle, type, category, &count_value)) { - _mmcam_dbg_warn("No matched category... check it... categoty[%d]", category); + MMCAM_LOG_WARNING("No matched category... check it... categoty[%d]", category); return FALSE; } - /*_mmcam_dbg_log("Number of value : [%d]", count_value);*/ + /*MMCAM_LOG_INFO("Number of value : [%d]", count_value);*/ if (type == CONFIGURE_TYPE_MAIN) { for (i = 0 ; i < count_value ; i++) { if (!strcmp(hcamcorder->conf_main_info_table[category][i].name, name)) { *value_type = hcamcorder->conf_main_info_table[category][i].value_type; - /*_mmcam_dbg_log("Category[%d],Name[%s],Type[%d]", category, name, *value_type);*/ + /*MMCAM_LOG_INFO("Category[%d],Name[%s],Type[%d]", category, name, *value_type);*/ return TRUE; } } @@ -1296,7 +1352,7 @@ int _mmcamcorder_conf_get_value_type(MMHandleType handle, int type, int category for (i = 0 ; i < count_value ; i++) { if (!strcmp(hcamcorder->conf_ctrl_info_table[category][i].name, name)) { *value_type = hcamcorder->conf_ctrl_info_table[category][i].value_type; - /*_mmcam_dbg_log("Category[%d],Name[%s],Type[%d]", category, name, *value_type);*/ + /*MMCAM_LOG_INFO("Category[%d],Name[%s],Type[%d]", category, name, *value_type);*/ return TRUE; } } @@ -1318,29 +1374,18 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info char *buffer_token[BUFFER_NUM_TOKEN]; char *user_ptr = NULL; - const char *delimiters = " |=,\t\n"; - const char *delimiters_sub = " |\t\n"; - const char *delimiters_3rd = "|\n"; + const char *delimiters = " |=,\t\r\n"; + const char *delimiters_sub = " |\t\r\n"; + const char *delimiters_3rd = "|\r\n"; mmf_return_val_if_fail(info && buffer_details, FALSE); - (*info) = (conf_detail*)g_malloc0(sizeof(conf_detail)); - if (*info == NULL) { - _mmcam_dbg_err("info allo failed"); - return FALSE; - } + (*info) = (conf_detail *)g_malloc0(sizeof(conf_detail)); (*info)->detail_info = (void**)g_malloc0(sizeof(void*) * count_details); (*info)->count = count_details; - if ((*info)->detail_info == NULL) { - _mmcam_dbg_err("detail_info alloc failed"); - g_free(*info); - *info = NULL; - return FALSE; - } - for (i = 0 ; i < count_details ; i++) { - /*_mmcam_dbg_log("Read line\"%s\"", buffer_details[i]);*/ + MMCAM_LOG_VERBOSE("Read line \"%s\"", buffer_details[i]); count_token = 0; token = strtok_r(buffer_details[i], delimiters, &user_ptr); @@ -1349,13 +1394,13 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info count_token++; } else { (*info)->detail_info[i] = NULL; - _mmcam_dbg_warn("No token... check it.[%s]", buffer_details[i]); + MMCAM_LOG_WARNING("No token... check it.[%s]", buffer_details[i]); continue; } if (!_mmcamcorder_conf_get_value_type(handle, type, category, buffer_token[0], &value_type)) { (*info)->detail_info[i] = NULL; - _mmcam_dbg_warn("Failed to get value type... check it. Category[%d],Name[%s]", category, buffer_token[0]); + MMCAM_LOG_WARNING("Failed to get value type... check it. Category[%d],Name[%s]", category, buffer_token[0]); continue; } @@ -1363,14 +1408,14 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info token = strtok_r(NULL, delimiters, &user_ptr); while (token) { buffer_token[count_token] = token; - /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/ + MMCAM_LOG_VERBOSE("token : [%s]", buffer_token[count_token]); count_token++; token = strtok_r(NULL, delimiters, &user_ptr); } if (count_token < 2) { (*info)->detail_info[i] = NULL; - _mmcam_dbg_warn("Number of token is too small... check it.[%s]", buffer_details[i]); + MMCAM_LOG_WARNING("Number of token is too small... check it.[%s]", buffer_details[i]); continue; } } else { /* CONFIGURE_VALUE_STRING or CONFIGURE_VALUE_STRING_ARRAY */ @@ -1381,7 +1426,7 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info token = strtok_r(NULL, delimiters_sub, &user_ptr); while (token) { buffer_token[count_token] = token; - /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/ + MMCAM_LOG_VERBOSE("token : [%s]", buffer_token[count_token]); count_token++; token = strtok_r(NULL, delimiters_sub, &user_ptr); } @@ -1390,14 +1435,14 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info if (token) { g_strchug(token); buffer_token[count_token] = token; - /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/ + MMCAM_LOG_VERBOSE("token : [%s]", buffer_token[count_token]); count_token++; } } if (count_token < 2) { (*info)->detail_info[i] = NULL; - _mmcam_dbg_warn("No string value... check it.[%s]", buffer_details[i]); + MMCAM_LOG_WARNING("No string value... check it.[%s]", buffer_details[i]); continue; } } @@ -1408,14 +1453,10 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info type_int2* new_int; new_int = (type_int2*)g_malloc0(sizeof(type_int2)); - if (new_int == NULL) { - _mmcam_dbg_err("allocation failed"); - break; - } new_int->name = get_new_string(buffer_token[0]); new_int->value = atoi(buffer_token[1]); (*info)->detail_info[i] = (void*)new_int; - /*_mmcam_dbg_log("INT - name[%s],value[%d]", new_int->name, new_int->value);*/ + MMCAM_LOG_VERBOSE("INT - name[%s],value[%d]", new_int->name, new_int->value); break; } case CONFIGURE_VALUE_INT_RANGE: @@ -1423,22 +1464,17 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info type_int_range* new_int_range; new_int_range = (type_int_range*)g_malloc0(sizeof(type_int_range)); - if (new_int_range == NULL) { - _mmcam_dbg_err("allocation failed"); - break; - } new_int_range->name = get_new_string(buffer_token[0]); new_int_range->min = atoi(buffer_token[1]); new_int_range->max = atoi(buffer_token[2]); new_int_range->default_value = atoi(buffer_token[3]); (*info)->detail_info[i] = (void*)new_int_range; - /* - _mmcam_dbg_log("INT RANGE - name[%s],min[%d],max[%d],default[%d]", + + MMCAM_LOG_VERBOSE("INT RANGE - name[%s],min[%d],max[%d],default[%d]", new_int_range->name, new_int_range->min, new_int_range->max, new_int_range->default_value); - */ break; } case CONFIGURE_VALUE_INT_ARRAY: @@ -1447,28 +1483,18 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info type_int_array* new_int_array; new_int_array = (type_int_array*)g_malloc0(sizeof(type_int_array)); - if (new_int_array == NULL) { - _mmcam_dbg_err("allocation failed"); - break; - } new_int_array->name = get_new_string(buffer_token[0]); new_int_array->value = (int*)g_malloc0(sizeof(int)*count_value); - if (new_int_array->value == NULL) { - SAFE_G_FREE(new_int_array->name); - SAFE_G_FREE(new_int_array); - _mmcam_dbg_err("allocation failed"); - break; - } new_int_array->count = count_value; - /*_mmcam_dbg_log("INT ARRAY - name[%s]", new_int_array->name);*/ + MMCAM_LOG_VERBOSE("INT ARRAY - name[%s]", new_int_array->name); for (j = 0 ; j < count_value ; j++) { new_int_array->value[j] = atoi(buffer_token[j+1]); - /*_mmcam_dbg_log(" index[%d] - value[%d]", j, new_int_array->value[j]);*/ + MMCAM_LOG_VERBOSE(" index[%d] - value[%d]", j, new_int_array->value[j]); } new_int_array->default_value = atoi(buffer_token[count_token-1]); - /*_mmcam_dbg_log(" default value[%d]", new_int_array->default_value);*/ + MMCAM_LOG_VERBOSE(" default value[%d]", new_int_array->default_value); (*info)->detail_info[i] = (void*)new_int_array; break; @@ -1479,46 +1505,28 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info type_int_pair_array* new_int_pair_array; new_int_pair_array = (type_int_pair_array*)g_malloc0(sizeof(type_int_pair_array)); - if (new_int_pair_array == NULL) { - _mmcam_dbg_err("allocation failed"); - break; - } new_int_pair_array->name = get_new_string(buffer_token[0]); new_int_pair_array->value[0] = (int*)g_malloc0(sizeof(int)*(count_value)); - if (new_int_pair_array->value[0] == NULL) { - SAFE_G_FREE(new_int_pair_array->name); - SAFE_G_FREE(new_int_pair_array); - _mmcam_dbg_err("allocation failed"); - break; - } new_int_pair_array->value[1] = (int*)g_malloc0(sizeof(int)*(count_value)); - if (new_int_pair_array->value[1] == NULL) { - SAFE_G_FREE(new_int_pair_array->value[0]); - SAFE_G_FREE(new_int_pair_array->name); - SAFE_G_FREE(new_int_pair_array); - _mmcam_dbg_err("allocation failed"); - break; - } new_int_pair_array->count = count_value; - /*_mmcam_dbg_log("INT PAIR ARRAY - name[%s],count[%d]", new_int_pair_array->name, count_value);*/ + MMCAM_LOG_VERBOSE("INT PAIR ARRAY - name[%s],count[%d]", new_int_pair_array->name, count_value); for (j = 0 ; j < count_value ; j++) { new_int_pair_array->value[0][j] = atoi(buffer_token[(j<<1)+1]); new_int_pair_array->value[1][j] = atoi(buffer_token[(j<<1)+2]); - /* - _mmcam_dbg_log(" index[%d] - value[%d,%d]", j, + + MMCAM_LOG_VERBOSE(" index[%d] - value[%d,%d]", j, new_int_pair_array->value[0][j], new_int_pair_array->value[1][j]); - */ } new_int_pair_array->default_value[0] = atoi(buffer_token[count_token-2]); new_int_pair_array->default_value[1] = atoi(buffer_token[count_token-1]); - /* - _mmcam_dbg_log(" default value[%d,%d]", + + MMCAM_LOG_VERBOSE(" default value[%d,%d]", new_int_pair_array->default_value[0], new_int_pair_array->default_value[1]); - */ + (*info)->detail_info[i] = (void*)new_int_pair_array; break; } @@ -1527,15 +1535,11 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info type_string2* new_string; new_string = (type_string2*)g_malloc0(sizeof(type_string2)); - if (new_string == NULL) { - _mmcam_dbg_err("allocation failed"); - break; - } new_string->name = get_new_string(buffer_token[0]); new_string->value = get_new_string(buffer_token[1]); (*info)->detail_info[i] = (void*)new_string; - /*_mmcam_dbg_log("STRING - name[%s],value[%s]", new_string->name, new_string->value);*/ + MMCAM_LOG_VERBOSE("STRING - name[%s],value[%s]", new_string->name, new_string->value); break; } case CONFIGURE_VALUE_STRING_ARRAY: @@ -1544,26 +1548,21 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info type_string_array* new_string_array; new_string_array = (type_string_array*)g_malloc0(sizeof(type_string_array)); - if (new_string_array == NULL) - break; - new_string_array->name = get_new_string(buffer_token[0]); new_string_array->count = count_value; new_string_array->value = (char**)g_malloc0(sizeof(char*)*count_value); - if (new_string_array->value == NULL) { - SAFE_G_FREE(new_string_array->name); - SAFE_G_FREE(new_string_array); - _mmcam_dbg_err("allocation failed"); - break; - } - /*_mmcam_dbg_log("STRING ARRAY - name[%s]", new_string_array->name);*/ + + MMCAM_LOG_VERBOSE("STRING ARRAY - name[%s]", new_string_array->name); + for (j = 0 ; j < count_value ; j++) { new_string_array->value[j] = get_new_string(buffer_token[j+1]); - /*_mmcam_dbg_log(" index[%d] - value[%s]", j, new_string_array->value[j]);*/ + MMCAM_LOG_VERBOSE(" index[%d] - value[%s]", j, new_string_array->value[j]); } new_string_array->default_value = get_new_string(buffer_token[count_token-1]); - /*_mmcam_dbg_log(" default value[%s]", new_string_array->default_value);*/ + + MMCAM_LOG_VERBOSE(" default value[%s]", new_string_array->default_value); + (*info)->detail_info[i] = (void*)new_string_array; break; } @@ -1571,71 +1570,43 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info { type_element2* new_element; + j = 0; new_element = (type_element2*)g_malloc0(sizeof(type_element2)); - if (new_element == NULL) { - _mmcam_dbg_err("allocation failed"); - break; - } new_element->name = get_new_string(buffer_token[0]); new_element->element_name = get_new_string(buffer_token[1]); new_element->count_int = atoi(buffer_token[2]); new_element->value_int = NULL; new_element->count_string = atoi(buffer_token[3]); new_element->value_string = NULL; - /* - _mmcam_dbg_log("Element - name[%s],element_name[%s],count_int[%d],count_string[%d]", + + MMCAM_LOG_VERBOSE("Element - name[%s],element_name[%s],count_int[%d],count_string[%d]", new_element->name, new_element->element_name, new_element->count_int, new_element->count_string); - */ /* add int values */ if (new_element->count_int > 0 && new_element->count_int <= 30) { new_element->value_int = (type_int2**)g_malloc0(sizeof(type_int2*)*(new_element->count_int)); - if (new_element->value_int) { - for (j = 0 ; j < new_element->count_int ; j++) { - new_element->value_int[j] = (type_int2*)g_malloc0(sizeof(type_int2)); - if (new_element->value_int[j]) { - new_element->value_int[j]->name = get_new_string(buffer_token[4+(j<<1)]); - new_element->value_int[j]->value = atoi(buffer_token[5+(j<<1)]); - } else { - _mmcam_dbg_err("allocation failed"); - } - /* - _mmcam_dbg_log(" Element INT[%d] - name[%s],value[%d]", - j, new_element->value_int[j]->name, new_element->value_int[j]->value); - */ - } - } else { - _mmcam_dbg_err("allocation failed"); + for ( ; j < new_element->count_int ; j++) { + new_element->value_int[j] = (type_int2*)g_malloc0(sizeof(type_int2)); + new_element->value_int[j]->name = get_new_string(buffer_token[4+(j<<1)]); + new_element->value_int[j]->value = atoi(buffer_token[5+(j<<1)]); + + MMCAM_LOG_VERBOSE(" Element INT[%d] - name[%s],value[%d]", + j, new_element->value_int[j]->name, new_element->value_int[j]->value); } - } else { - /*_mmcam_dbg_err("invalid count - %d", new_element->count_int);*/ - new_element->value_int = NULL; } /* add string values */ if (new_element->count_string > 0 && new_element->count_string <= 30 && new_element->count_int >= 0 && new_element->count_int <= 30) { new_element->value_string = (type_string2**)g_malloc0(sizeof(type_string2*)*(new_element->count_string)); - if (new_element->value_string) { - for ( ; j < new_element->count_string + new_element->count_int ; j++) { - new_element->value_string[j-new_element->count_int] = (type_string2*)g_malloc0(sizeof(type_string2)); - if (new_element->value_string[j-new_element->count_int]) { - new_element->value_string[j-new_element->count_int]->name = get_new_string(buffer_token[4+(j<<1)]); - new_element->value_string[j-new_element->count_int]->value = get_new_string(buffer_token[5+(j<<1)]); - /* - _mmcam_dbg_log(" Element STRING[%d] - name[%s],value[%s]", - j-new_element->count_int, new_element->value_string[j-new_element->count_int]->name, new_element->value_string[j-new_element->count_int]->value); - */ - } else { - _mmcam_dbg_err("allocation failed"); - } - } - } else { - _mmcam_dbg_err("malloc failed : %zu", sizeof(type_string2*)*(new_element->count_string)); + for ( ; j < new_element->count_string + new_element->count_int ; j++) { + new_element->value_string[j-new_element->count_int] = (type_string2*)g_malloc0(sizeof(type_string2)); + new_element->value_string[j-new_element->count_int]->name = get_new_string(buffer_token[4+(j<<1)]); + new_element->value_string[j-new_element->count_int]->value = get_new_string(buffer_token[5+(j<<1)]); + + MMCAM_LOG_VERBOSE(" Element STRING[%d] - name[%s],value[%s]", + j - new_element->count_int, new_element->value_string[j-new_element->count_int]->name, new_element->value_string[j-new_element->count_int]->value); } - } else { - /*_mmcam_dbg_err("invalid count - %d", new_element->count_string);*/ - new_element->value_string = NULL; } (*info)->detail_info[i] = (void*)new_element; @@ -1655,7 +1626,7 @@ int _mmcamcorder_conf_get_value_int(MMHandleType handle, camera_conf* configure_ int i, count; conf_detail* info; - /* _mmcam_dbg_log("Entered... category[%d],name[%s]", category, name); */ + MMCAM_LOG_VERBOSE("category[%d], name[%s]", category, name); mmf_return_val_if_fail(configure_info, FALSE); mmf_return_val_if_fail(name, FALSE); @@ -1670,18 +1641,18 @@ int _mmcamcorder_conf_get_value_int(MMHandleType handle, camera_conf* configure_ if (!strcmp(((type_int*)(info->detail_info[i]))->name , name)) { *value = ((type_int*)(info->detail_info[i]))->value; - /* _mmcam_dbg_log("Get[%s] int[%d]", name, *value); */ + MMCAM_LOG_DEBUG("Get[%s] int[%d]", name, *value); return TRUE; } } } if (_mmcamcorder_conf_get_default_value_int(handle, configure_info->type, category, name, value)) { - /*_mmcam_dbg_log("Get[%s] int[%d]", name, *value);*/ + MMCAM_LOG_DEBUG("Get default [%s] int[%d]", name, *value); return TRUE; } - _mmcam_dbg_err("Faild to get int... check it...Category[%d],Name[%s]", category, name); + MMCAM_LOG_DEBUG("Failed to get [%s]", name); return FALSE; } @@ -1692,7 +1663,7 @@ _mmcamcorder_conf_get_value_int_range(camera_conf* configure_info, int category, int i, count; conf_detail* info; - /* _mmcam_dbg_log("Entered... category[%d],name[%s]", category, name); */ + MMCAM_LOG_VERBOSE("category[%d], name[%s]", category, name); mmf_return_val_if_fail(configure_info, FALSE); mmf_return_val_if_fail(name, FALSE); @@ -1707,10 +1678,8 @@ _mmcamcorder_conf_get_value_int_range(camera_conf* configure_info, int category, if (!strcmp(((type_int_range*)(info->detail_info[i]))->name , name)) { *value = (type_int_range*)(info->detail_info[i]); - /* - _mmcam_dbg_log("Get[%s] int range - min[%d],max[%d],default[%d]", + MMCAM_LOG_DEBUG("Get[%s] int range - min[%d],max[%d],default[%d]", name, (*value)->min, (*value)->max, (*value)->default_value); - */ return TRUE; } } @@ -1718,18 +1687,17 @@ _mmcamcorder_conf_get_value_int_range(camera_conf* configure_info, int category, *value = NULL; - /*_mmcam_dbg_warn( "Faild to get int range... check it...Category[%d],Name[%s]", category, name );*/ + MMCAM_LOG_DEBUG("Failed to get [%s]", name); return FALSE; } -int -_mmcamcorder_conf_get_value_int_array(camera_conf* configure_info, int category, const char* name, type_int_array** value) +int _mmcamcorder_conf_get_value_int_array(camera_conf* configure_info, int category, const char* name, type_int_array** value) { int i, count; conf_detail* info; - /*_mmcam_dbg_log("Entered... category[%d],name[%s]", category, name);*/ + MMCAM_LOG_VERBOSE("category[%d], name[%s]", category, name); mmf_return_val_if_fail(configure_info, FALSE); mmf_return_val_if_fail(name, FALSE); @@ -1744,10 +1712,8 @@ _mmcamcorder_conf_get_value_int_array(camera_conf* configure_info, int category, if (!strcmp(((type_int_array*)(info->detail_info[i]))->name , name)) { *value = (type_int_array*)(info->detail_info[i]); - /* - _mmcam_dbg_log("Get[%s] int array - [%x],count[%d],default[%d]", + MMCAM_LOG_DEBUG("Get[%s] int array - [%p],count[%d],default[%d]", name, (*value)->value, (*value)->count, (*value)->default_value); - */ return TRUE; } } @@ -1755,7 +1721,7 @@ _mmcamcorder_conf_get_value_int_array(camera_conf* configure_info, int category, *value = NULL; - /*_mmcam_dbg_warn( "Faild to get int array... check it...Category[%d],Name[%s]", category, name );*/ + MMCAM_LOG_DEBUG("Failed to get [%s]", name); return FALSE; } @@ -1766,7 +1732,7 @@ _mmcamcorder_conf_get_value_int_pair_array(camera_conf* configure_info, int cate int i, count; conf_detail* info; - /* _mmcam_dbg_log("Entered... category[%d],name[%s]", category, name); */ + MMCAM_LOG_VERBOSE("category[%d], name[%s]", category, name); mmf_return_val_if_fail(configure_info, FALSE); mmf_return_val_if_fail(name, FALSE); @@ -1781,11 +1747,9 @@ _mmcamcorder_conf_get_value_int_pair_array(camera_conf* configure_info, int cate if (!strcmp(((type_int_pair_array*)(info->detail_info[i]))->name , name)) { *value = (type_int_pair_array*)(info->detail_info[i]); - /* - _mmcam_dbg_log("Get[%s] int pair array - [%x][%x],count[%d],default[%d][%d]", + MMCAM_LOG_DEBUG("Get[%s] int pair array - [%p][%p],count[%d],default[%d][%d]", name, (*value)->value[0], (*value)->value[1], (*value)->count, (*value)->default_value[0], (*value)->default_value[1]); - */ return TRUE; } } @@ -1793,7 +1757,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_LOG_DEBUG("Failed to get [%s]", name); return FALSE; } @@ -1803,7 +1767,7 @@ int _mmcamcorder_conf_get_value_string(MMHandleType handle, camera_conf* configu int i, count; conf_detail* info; - /* _mmcam_dbg_log("Entered... category[%d],name[%s]", category, name); */ + MMCAM_LOG_VERBOSE("category[%d], name[%s]", category, name); mmf_return_val_if_fail(configure_info, FALSE); mmf_return_val_if_fail(name, FALSE); @@ -1818,29 +1782,28 @@ 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 ? *value : "NULL" );*/ + MMCAM_LOG_DEBUG("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 ? *value : "NULL" );*/ + MMCAM_LOG_DEBUG("Get default [%s] string[%s]", name, *value ? *value : "NULL"); return TRUE; } - _mmcam_dbg_err("Faild to get string... check it...Category[%d],Name[%s]", category, name); + MMCAM_LOG_DEBUG("Failed to get [%s]", name); return FALSE; } -int -_mmcamcorder_conf_get_value_string_array(camera_conf* configure_info, int category, const char* name, type_string_array** value) +int _mmcamcorder_conf_get_value_string_array(camera_conf* configure_info, int category, const char* name, type_string_array** value) { int i, count; conf_detail* info; - /* _mmcam_dbg_log("Entered... category[%d],name[%s]", category, name); */ + MMCAM_LOG_VERBOSE("category[%d], name[%s]", category, name); mmf_return_val_if_fail(configure_info, FALSE); mmf_return_val_if_fail(name, FALSE); @@ -1855,10 +1818,8 @@ _mmcamcorder_conf_get_value_string_array(camera_conf* configure_info, int catego if (!strcmp(((type_string_array*)(info->detail_info[i]))->name , name)) { *value = (type_string_array*)(info->detail_info[i]); - /* - _mmcam_dbg_log("Get[%s] string array - [%x],count[%d],default[%s]", + MMCAM_LOG_DEBUG("Get[%s] string array - [%p],count[%d],default[%s]", name, (*value)->value, (*value)->count, (*value)->default_value); - */ return TRUE; } } @@ -1866,7 +1827,7 @@ _mmcamcorder_conf_get_value_string_array(camera_conf* configure_info, int catego *value = NULL; - /*_mmcam_dbg_warn("Faild to get string array... check it...Category[%d],Name[%s]", category, name);*/ + MMCAM_LOG_DEBUG("Failed to get [%s]", name); return FALSE; } @@ -1876,7 +1837,7 @@ int _mmcamcorder_conf_get_element(MMHandleType handle, camera_conf* configure_in int i, count; conf_detail* info; - /* _mmcam_dbg_log("Entered... category[%d], ame[%s]", category, name); */ + MMCAM_LOG_VERBOSE("category[%d], name[%s]", category, name); mmf_return_val_if_fail(configure_info, FALSE); mmf_return_val_if_fail(name, FALSE); @@ -1891,139 +1852,122 @@ int _mmcamcorder_conf_get_element(MMHandleType handle, camera_conf* configure_in if (!strcmp(((type_element*)(info->detail_info[i]))->name , name)) { *element = (type_element*)(info->detail_info[i]); - /* _mmcam_dbg_log("Get[%s] element[%x]", name, *element); */ + MMCAM_LOG_DEBUG("Get[%s] element[%p]", name, *element); return TRUE; } } } if (_mmcamcorder_conf_get_default_element(handle, configure_info->type, category, name, element)) { - /* _mmcam_dbg_log("Get[%s] element[%x]", name, *element); */ + MMCAM_LOG_DEBUG("Get default [%s] element[%p]", name, *element); return TRUE; } - _mmcam_dbg_warn("Faild to get element name... check it...Category[%d],Name[%s]", category, name); + MMCAM_LOG_ERROR("Failed to get [%s]", name); return FALSE; } -int -_mmcamcorder_conf_get_value_element_name(type_element* element, const char** value) +int _mmcamcorder_conf_get_value_element_name(type_element* element, const char** value) { - /* _mmcam_dbg_log("Entered..."); */ - mmf_return_val_if_fail(element, FALSE); *value = element->element_name; - /* _mmcam_dbg_log("Get element name : [%s]", *value); */ + MMCAM_LOG_DEBUG("Get element name : [%s]", *value); return TRUE; } -int -_mmcamcorder_conf_get_value_element_int(type_element* element, const char* name, int* value) +int _mmcamcorder_conf_get_value_element_int(type_element* element, const char* name, int* value) { int i; - /* _mmcam_dbg_log( "Entered..." ); */ - mmf_return_val_if_fail(element, FALSE); mmf_return_val_if_fail(name, FALSE); for (i = 0 ; i < element->count_int ; i++) { if (!strcmp(element->value_int[i]->name, name)) { *value = element->value_int[i]->value; - /* _mmcam_dbg_log("Get[%s] element int[%d]", name, *value); */ + MMCAM_LOG_DEBUG("Get[%s] element int[%d]", name, *value); return TRUE; } } - _mmcam_dbg_warn("Faild to get int in element... ElementName[%p],Name[%s],Count[%d]", + MMCAM_LOG_ERROR("Failed to get int in element. Element[%s],Name[%s],Count[%d]", element->name, name, element->count_int); return FALSE; } -int -_mmcamcorder_conf_get_value_element_string(type_element* element, const char* name, const char** value) +int _mmcamcorder_conf_get_value_element_string(type_element* element, const char* name, const char** value) { int i; - /* _mmcam_dbg_log("Entered..."); */ - mmf_return_val_if_fail(element, FALSE); mmf_return_val_if_fail(name, FALSE); for (i = 0 ; i < element->count_string ; i++) { if (!strcmp(element->value_string[i]->name, name)) { *value = element->value_string[i]->value; - /*_mmcam_dbg_log("Get[%s] element string[%s]", name, *value);*/ + MMCAM_LOG_DEBUG("Get[%s] element string[%s]", name, *value); return TRUE; } } - _mmcam_dbg_warn("Faild to get int in element... ElementName[%p],Name[%s],Count[%d]", + MMCAM_LOG_ERROR("Failed to get int in element. Element[%s],Name[%s],Count[%d]", element->name, name, element->count_string); return FALSE; } -int -_mmcamcorder_conf_set_value_element_property(GstElement* gst, type_element* element) +int _mmcamcorder_conf_set_value_element_property(GstElement* gst, type_element* element) { int i; - /* _mmcam_dbg_log("Entered..."); */ - mmf_return_val_if_fail(gst, FALSE); mmf_return_val_if_fail(element, FALSE); if (element->count_int == 0) { - /*_mmcam_dbg_log( "There is no integer property to set in INI file[%s].", element->name );*/ + MMCAM_LOG_DEBUG("There is no integer property to set in INI file[%s].", element->name ); } else { if (element->value_int == NULL) { - _mmcam_dbg_warn("count_int[%d] is NOT zero, but value_int is NULL", element->count_int); + MMCAM_LOG_WARNING("count_int[%d] is NOT zero, but value_int is NULL", element->count_int); return FALSE; } for (i = 0 ; i < element->count_int ; i++) { MMCAMCORDER_G_OBJECT_SET(gst, element->value_int[i]->name, element->value_int[i]->value); - /* - _mmcam_dbg_log("Element[%s] Set[%s] -> integer[%d]", + MMCAM_LOG_DEBUG("Element[%s] Set[%s] -> [i:%d]", element->element_name, element->value_int[i]->name, element->value_int[i]->value); - */ } } if (element->count_string == 0) { - _mmcam_dbg_log("There is no string property to set in INI file[%s].", element->name); + MMCAM_LOG_DEBUG("There is no string property to set in INI file[%s].", element->name); } else { if (element->value_string == NULL) { - _mmcam_dbg_warn("count_string[%d] is NOT zero, but value_string is NULL", element->count_string); + MMCAM_LOG_WARNING("count_string[%d] is NOT zero, but value_string is NULL", element->count_string); return FALSE; } for (i = 0 ; i < element->count_string ; i++) { MMCAMCORDER_G_OBJECT_SET_POINTER(gst, element->value_string[i]->name, element->value_string[i]->value); - _mmcam_dbg_log("Element[%s] Set[%s] -> string[%s]", + MMCAM_LOG_DEBUG("Element[%s] Set[%s] -> [s:%s]", element->element_name, element->value_string[i]->name, element->value_string[i]->value); } } - /* _mmcam_dbg_log( "Done." ); */ - return TRUE; } -int -_mmcamcorder_conf_get_default_value_int(MMHandleType handle, int type, int category, const char* name, int* value) +int _mmcamcorder_conf_get_default_value_int(MMHandleType handle, int type, int category, const char* name, int* value) { int i = 0; int count_value = 0; @@ -2031,16 +1975,14 @@ _mmcamcorder_conf_get_default_value_int(MMHandleType handle, int type, int categ mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); if (hcamcorder == NULL) { - _mmcam_dbg_err("handle is NULL"); + MMCAM_LOG_ERROR("handle is NULL"); return FALSE; } - /* _mmcam_dbg_log("Entered..."); */ - mmf_return_val_if_fail(name, FALSE); if (!_mmcamcorder_conf_get_category_size(handle, type, category, &count_value)) { - _mmcam_dbg_warn("No matched category... check it... categoty[%d]", category); + MMCAM_LOG_WARNING("No matched category. categoty[%d]", category); return FALSE; } @@ -2060,7 +2002,7 @@ _mmcamcorder_conf_get_default_value_int(MMHandleType handle, int type, int categ } } - _mmcam_dbg_err("Failed to get default int... check it... Type[%d],Category[%d],Name[%s]", type, category, name); + MMCAM_LOG_ERROR("Failed to get default int. Type[%d],Category[%d],Name[%s]", type, category, name); return FALSE; } @@ -2073,16 +2015,14 @@ int _mmcamcorder_conf_get_default_value_string(MMHandleType handle, int type, in mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); if (hcamcorder == NULL) { - _mmcam_dbg_err("handle is NULL"); + MMCAM_LOG_ERROR("handle is NULL"); return FALSE; } - /* _mmcam_dbg_log("Entered..."); */ - mmf_return_val_if_fail(name, FALSE); if (!_mmcamcorder_conf_get_category_size(handle, type, category, &count_value)) { - _mmcam_dbg_warn("No matched category... check it... categoty[%d]", category); + MMCAM_LOG_WARNING("No matched category... check it... categoty[%d]", category); return FALSE; } @@ -2090,7 +2030,6 @@ 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 ? *value : "NULL");*/ return TRUE; } } @@ -2098,13 +2037,12 @@ 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 ? *value : "NULL");*/ return TRUE; } } } - _mmcam_dbg_warn("Failed to get default string... check it... Type[%d],Category[%d],Name[%s]", type, category, name); + MMCAM_LOG_ERROR("Failed to get default string. Type[%d],Category[%d],Name[%s]", type, category, name); return FALSE; } @@ -2117,16 +2055,14 @@ int _mmcamcorder_conf_get_default_element(MMHandleType handle, int type, int cat mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); if (hcamcorder == NULL) { - _mmcam_dbg_err("handle is NULL"); + MMCAM_LOG_ERROR("handle is NULL"); return FALSE; } - /* _mmcam_dbg_log("Entered..."); */ - mmf_return_val_if_fail(name, FALSE); if (!_mmcamcorder_conf_get_category_size(handle, type, category, &count_value)) { - _mmcam_dbg_warn("No matched category... check it... categoty[%d]", category); + MMCAM_LOG_WARNING("No matched category... check it... categoty[%d]", category); return FALSE; } @@ -2134,7 +2070,6 @@ int _mmcamcorder_conf_get_default_element(MMHandleType handle, int type, int cat for (i = 0 ; i < count_value ; i++) { if (!strcmp(hcamcorder->conf_main_info_table[category][i].name, name)) { *element = hcamcorder->conf_main_info_table[category][i].value_element; - _mmcam_dbg_log("Get[%s] element[%p]", name, *element); return TRUE; } } @@ -2142,13 +2077,12 @@ int _mmcamcorder_conf_get_default_element(MMHandleType handle, int type, int cat for (i = 0 ; i < count_value ; i++) { if (!strcmp(hcamcorder->conf_ctrl_info_table[category][i].name, name)) { *element = hcamcorder->conf_ctrl_info_table[category][i].value_element; - _mmcam_dbg_log("Get[%s] element[%p]", name, *element); return TRUE; } } } - _mmcam_dbg_warn("Failed to get default element... check it... Type[%d],Category[%d],Name[%s]", type, category, name); + MMCAM_LOG_ERROR("Failed to get default element. Type[%d],Category[%d],Name[%s]", type, category, name); return FALSE; } @@ -2158,30 +2092,48 @@ int _mmcamcorder_conf_get_category_size(MMHandleType handle, int type, int categ mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); if (hcamcorder == NULL) { - _mmcam_dbg_err("handle is NULL"); + MMCAM_LOG_ERROR("handle is NULL"); return FALSE; } - /* - mmf_return_val_if_fail(conf_main_category_size, FALSE); - mmf_return_val_if_fail(conf_ctrl_category_size, FALSE); - */ - if (type == CONFIGURE_TYPE_MAIN) { mmf_return_val_if_fail(category < CONFIGURE_CATEGORY_MAIN_NUM, FALSE); - *size = (int)hcamcorder->conf_main_category_size[category]; } else { mmf_return_val_if_fail(category < CONFIGURE_CATEGORY_CTRL_NUM, FALSE); - *size = (int)hcamcorder->conf_ctrl_category_size[category]; } return TRUE; } -void -_mmcamcorder_conf_print_info(MMHandleType handle, camera_conf** configure_info) +void _mmcamcorder_conf_get_element_and_name(MMHandleType handle, camera_conf *conf, int category, + const char *name, type_element **element, const char **element_name) +{ + type_element *_element = NULL; + mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); + + if (!hcamcorder) { + MMCAM_LOG_ERROR("NULL handle"); + return; + } + + if (!_mmcamcorder_conf_get_element(handle, conf, + category, name, &_element)) { + MMCAM_LOG_WARNING("get [%s] failed", name); + return; + } + + if (element) + *element = _element; + + if (element_name) { + _mmcamcorder_conf_get_value_element_name(_element, element_name); + MMCAM_LOG_INFO("[%s] -> [%s]", name, *element_name); + } +} + +void _mmcamcorder_conf_print_info(MMHandleType handle, camera_conf** configure_info) { int i, j, k, type, category_type; @@ -2269,8 +2221,7 @@ _mmcamcorder_conf_print_info(MMHandleType handle, camera_conf** configure_info) } -static type_element * -__mmcamcorder_get_audio_codec_element(MMHandleType handle) +static type_element *__mmcamcorder_get_audio_codec_element(MMHandleType handle) { type_element *telement = NULL; const char *codec_type_str = NULL; @@ -2283,7 +2234,7 @@ __mmcamcorder_get_audio_codec_element(MMHandleType handle) mmf_return_val_if_fail(sc, NULL); - _mmcam_dbg_log(""); + MMCAM_LOG_INFO(""); /* Check element availability */ mm_camcorder_get_attributes(handle, NULL, MMCAM_AUDIO_ENCODER, &codec_type, NULL); @@ -2320,7 +2271,7 @@ __mmcamcorder_get_audio_codec_element(MMHandleType handle) codec_type_str = "VORBIS"; break; default: - _mmcam_dbg_err("Not supported audio codec[%d]", codec_type); + MMCAM_LOG_ERROR("Not supported audio codec[%d]", codec_type); return NULL; } @@ -2333,8 +2284,7 @@ __mmcamcorder_get_audio_codec_element(MMHandleType handle) } -static type_element * -__mmcamcorder_get_video_codec_element(MMHandleType handle) +static type_element *__mmcamcorder_get_video_codec_element(MMHandleType handle) { type_element *telement = NULL; const char *codec_type_str = NULL; @@ -2347,8 +2297,6 @@ __mmcamcorder_get_video_codec_element(MMHandleType handle) mmf_return_val_if_fail(sc, NULL); - _mmcam_dbg_log(""); - /* Check element availability */ mm_camcorder_get_attributes(handle, NULL, MMCAM_VIDEO_ENCODER, &codec_type, NULL); @@ -2372,7 +2320,7 @@ __mmcamcorder_get_video_codec_element(MMHandleType handle) codec_type_str = "THEORA"; break; default: - _mmcam_dbg_err("Not supported video codec[%d]", codec_type); + MMCAM_LOG_ERROR("Not supported video codec[%d]", codec_type); return NULL; } @@ -2385,8 +2333,7 @@ __mmcamcorder_get_video_codec_element(MMHandleType handle) } -static type_element * -__mmcamcorder_get_image_codec_element(MMHandleType handle) +static type_element *__mmcamcorder_get_image_codec_element(MMHandleType handle) { type_element *telement = NULL; const char *codec_type_str = NULL; @@ -2399,8 +2346,6 @@ __mmcamcorder_get_image_codec_element(MMHandleType handle) mmf_return_val_if_fail(sc, NULL); - _mmcam_dbg_log(""); - /* Check element availability */ mm_camcorder_get_attributes(handle, NULL, MMCAM_IMAGE_ENCODER, &codec_type, NULL); @@ -2448,7 +2393,7 @@ __mmcamcorder_get_image_codec_element(MMHandleType handle) codec_type_str = "XPM"; break; default: - _mmcam_dbg_err("Not supported image codec[%d]", codec_type); + MMCAM_LOG_ERROR("Not supported image codec[%d]", codec_type); return NULL; } @@ -2461,8 +2406,7 @@ __mmcamcorder_get_image_codec_element(MMHandleType handle) } -static type_element * -__mmcamcorder_get_file_format_element(MMHandleType handle) +static type_element *__mmcamcorder_get_file_format_element(MMHandleType handle) { type_element *telement = NULL; const char *mux_type_str = NULL; @@ -2475,8 +2419,6 @@ __mmcamcorder_get_file_format_element(MMHandleType handle) mmf_return_val_if_fail(sc, NULL); - _mmcam_dbg_log(""); - /* Check element availability */ mm_camcorder_get_attributes(handle, NULL, MMCAM_FILE_FORMAT, &file_type, NULL); @@ -2524,7 +2466,7 @@ __mmcamcorder_get_file_format_element(MMHandleType handle) mux_type_str = "M2TS"; break; default: - _mmcam_dbg_err("Not supported file format[%d]", file_type); + MMCAM_LOG_ERROR("Not supported file format[%d]", file_type); return NULL; } @@ -2537,13 +2479,10 @@ __mmcamcorder_get_file_format_element(MMHandleType handle) } -type_element * -_mmcamcorder_get_type_element(MMHandleType handle, int type) +type_element *_mmcamcorder_get_type_element(MMHandleType handle, int type) { type_element *telement = NULL; - _mmcam_dbg_log("type:%d", type); - switch (type) { case MM_CAM_AUDIO_ENCODER: telement = __mmcamcorder_get_audio_codec_element(handle); @@ -2558,7 +2497,7 @@ _mmcamcorder_get_type_element(MMHandleType handle, int type) telement = __mmcamcorder_get_file_format_element(handle); break; default: - _mmcam_dbg_log("Can't get element type form this profile.(%d)", type); + MMCAM_LOG_INFO("Can't get element type form this profile.(%d)", type); } return telement; @@ -2570,7 +2509,7 @@ int _mmcamcorder_get_audio_codec_format(MMHandleType handle, const char *name) int codec_index = MM_AUDIO_CODEC_INVALID; if (!name) { - _mmcam_dbg_err("name is NULL"); + MMCAM_LOG_ERROR("name is NULL"); return MM_AUDIO_CODEC_INVALID; } @@ -2595,7 +2534,7 @@ int _mmcamcorder_get_audio_codec_format(MMHandleType handle, const char *name) else if (!strcmp(name, "VORBIS")) codec_index = MM_AUDIO_CODEC_VORBIS; - /*_mmcam_dbg_log("audio codec index %d", codec_index);*/ + MMCAM_LOG_DEBUG("audio codec index %d", codec_index); return codec_index; } @@ -2607,7 +2546,7 @@ int _mmcamcorder_get_video_codec_format(MMHandleType handle, const char *name) int codec_index = MM_VIDEO_CODEC_INVALID; if (!name) { - _mmcam_dbg_err("name is NULL"); + MMCAM_LOG_ERROR("name is NULL"); return MM_VIDEO_CODEC_INVALID; } @@ -2624,7 +2563,7 @@ int _mmcamcorder_get_video_codec_format(MMHandleType handle, const char *name) else if (!strcmp(name, "THEORA")) codec_index = MM_VIDEO_CODEC_THEORA; - /*_mmcam_dbg_log("video codec index %d", codec_index);*/ + MMCAM_LOG_DEBUG("video codec index %d", codec_index); return codec_index; } @@ -2636,7 +2575,7 @@ int _mmcamcorder_get_image_codec_format(MMHandleType handle, const char *name) int codec_index = MM_IMAGE_CODEC_INVALID; if (!name) { - _mmcam_dbg_err("name is NULL"); + MMCAM_LOG_ERROR("name is NULL"); return MM_IMAGE_CODEC_INVALID; } @@ -2665,7 +2604,7 @@ int _mmcamcorder_get_image_codec_format(MMHandleType handle, const char *name) else if (!strcmp(name, "XPM")) codec_index = MM_IMAGE_CODEC_XPM; - _mmcam_dbg_log("image codec index %d", codec_index); + MMCAM_LOG_DEBUG("image codec index %d", codec_index); return codec_index; } @@ -2676,7 +2615,7 @@ int _mmcamcorder_get_mux_format(MMHandleType handle, const char *name) int mux_index = MM_FILE_FORMAT_INVALID; if (!name) { - _mmcam_dbg_err("name is NULL"); + MMCAM_LOG_ERROR("name is NULL"); return MM_FILE_FORMAT_INVALID; } @@ -2709,14 +2648,13 @@ int _mmcamcorder_get_mux_format(MMHandleType handle, const char *name) else if (!strcmp(name, "M2TS")) mux_index = MM_FILE_FORMAT_M2TS; - /*_mmcam_dbg_log("mux index %d", mux_index);*/ + MMCAM_LOG_DEBUG("mux index %d", mux_index); return mux_index; } -int -_mmcamcorder_get_format(MMHandleType handle, int conf_category, const char *name) +int _mmcamcorder_get_format(MMHandleType handle, int conf_category, const char *name) { int fmt = -1; @@ -2736,14 +2674,13 @@ _mmcamcorder_get_format(MMHandleType handle, int conf_category, const char *name fmt = _mmcamcorder_get_mux_format(handle, name); break; default: - _mmcam_dbg_log("Can't get format from this category.(%d)", conf_category); + MMCAM_LOG_ERROR("Can't get format from this category.(%d)", conf_category); } return fmt; } -int -_mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int ** format) +int _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int **format) { mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); camera_conf* configure_info = NULL; @@ -2752,8 +2689,6 @@ _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int ** mmf_return_val_if_fail(hcamcorder, 0); - /*_mmcam_dbg_log("conf_category:%d", conf_category);*/ - configure_info = hcamcorder->conf_main; if (configure_info->info[conf_category]) { @@ -2763,16 +2698,13 @@ _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int ** int count = configure_info->info[conf_category]->count; conf_detail *info = configure_info->info[conf_category]; - /*_mmcam_dbg_log("count[%d], info[%p]", count, info);*/ + MMCAM_LOG_DEBUG("conf_category[%d] : count[%d], info[%p]", + conf_category, count, info); if (count <= 0 || !info) return total_count; - arr = (int*) g_malloc0(count * sizeof(int)); - if (arr == NULL) { - _mmcam_dbg_err("malloc failed : %zu", count * sizeof(int)); - return 0; - } + arr = (int*)g_malloc0(count * sizeof(int)); for (i = 0 ; i < count ; i++) { if (info->detail_info[i] == NULL) @@ -2783,7 +2715,7 @@ _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int ** if (fmt >= 0) arr[total_count++] = fmt; - /*_mmcam_dbg_log("name:%s, fmt:%d", name, fmt);*/ + MMCAM_LOG_VERBOSE(" name:%s, fmt:%d", name, fmt); } }