Fix Svace issue
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_configure.c
index 667d3ca..20618ad 100644 (file)
 |    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_BUFFER_LINE_MAX      256
 
 char *get_new_string(char* src_string)
 {
@@ -189,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",
@@ -621,20 +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} },
+               { "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 */
@@ -660,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} },
        };
@@ -691,7 +729,9 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
                { "UseNoiseSuppressor",     CONFIGURE_VALUE_INT,     {.value_int = 0} },
                { "DropVideoFrame",         CONFIGURE_VALUE_INT,     {.value_int = 0} },
                { "PassFirstVideoFrame",    CONFIGURE_VALUE_INT,     {.value_int = 0} },
-               { "SupportDualStream",      CONFIGURE_VALUE_INT,     {.value_int = FALSE} },
+               { "SupportDualStream",      CONFIGURE_VALUE_INT,     {.value_int = 0} },
+               { "UseVideoscale",          CONFIGURE_VALUE_INT,     {.value_int = 0} },
+               { "VideoscaleElement",      CONFIGURE_VALUE_ELEMENT, {&_videoscale_element_default} }
        };
 
        /* [VideoEncoder] matching table */
@@ -776,12 +816,21 @@ 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} }
        };
 
        /* [Strobe] matching table */
@@ -789,23 +838,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 */
@@ -814,6 +866,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} },
@@ -825,10 +878,13 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
                { "VideoStabilization",   CONFIGURE_VALUE_INT_ARRAY, {NULL} },
                { "FaceZoomMode",         CONFIGURE_VALUE_INT_ARRAY, {NULL} },
                { "FaceZoomLevel",        CONFIGURE_VALUE_INT_RANGE, {NULL} },
+               { "PtzType",              CONFIGURE_VALUE_INT_ARRAY, {NULL} },
                { "PanMecha",             CONFIGURE_VALUE_INT_RANGE, {NULL} },
                { "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 */
@@ -850,7 +906,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;
@@ -895,12 +951,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;
 }
@@ -910,37 +962,33 @@ int _mmcamcorder_conf_get_info(MMHandleType handle, int type, const char *ConfFi
 {
        int ret = MM_ERROR_NONE;
        FILE *fp = NULL;
-       char conf_path[60] = {'\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 == NULL) {
-               _mmcam_dbg_warn("File open failed.[%s] retry...", conf_path);
+       if (!fp) {
+               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 == NULL)
-                       _mmcam_dbg_warn("open failed.[%s] errno [%d]", conf_path, errno);
+               if (!fp) {
+                       MMCAM_LOG_WARNING("open failed.[%s] errno [%d]", conf_path, errno);
+                       return MM_ERROR_CAMCORDER_NOT_SUPPORTED;
+               }
        }
 
-       if (fp != NULL) {
-               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;
-       }
+       ret = _mmcamcorder_conf_parse_info(handle, type, fp, configure_info);
+
+       fclose(fp);
 
-       _mmcam_dbg_log("Leave...");
+       MMCAM_LOG_INFO("Leave [0x%x]", ret);
 
        return ret;
 }
@@ -950,8 +998,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;
@@ -972,30 +1020,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 : %d", 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);
-               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;
@@ -1008,19 +1046,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);
@@ -1034,12 +1080,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;
                        }
 
@@ -1047,15 +1093,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;
@@ -1069,10 +1122,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;
                        }
@@ -1118,9 +1171,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 */
@@ -1135,7 +1188,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;
 }
@@ -1159,7 +1212,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);
 
@@ -1238,7 +1291,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;
                                        }
                                }
@@ -1256,7 +1309,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)
@@ -1267,26 +1320,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;
                        }
                }
@@ -1294,7 +1347,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;
                        }
                }
@@ -1316,29 +1369,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);
 
@@ -1347,13 +1389,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;
                }
 
@@ -1361,14 +1403,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 */
@@ -1379,7 +1421,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);
                                }
@@ -1388,14 +1430,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;
                        }
                }
@@ -1406,14 +1448,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:
@@ -1421,22 +1459,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:
@@ -1445,28 +1478,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;
@@ -1477,46 +1500,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;
                }
@@ -1525,15 +1530,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:
@@ -1542,26 +1543,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;
                }
@@ -1569,71 +1565,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 : %d", 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;
@@ -1653,7 +1621,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);
@@ -1668,18 +1636,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;
 }
@@ -1690,7 +1658,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);
@@ -1705,10 +1673,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;
                        }
                }
@@ -1716,18 +1682,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);
@@ -1742,10 +1707,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;
                        }
                }
@@ -1753,7 +1716,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;
 }
@@ -1764,7 +1727,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);
@@ -1779,11 +1742,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;
                        }
                }
@@ -1791,7 +1752,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;
 }
@@ -1801,7 +1762,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);
@@ -1816,29 +1777,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);
@@ -1853,10 +1813,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;
                        }
                }
@@ -1864,7 +1822,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;
 }
@@ -1874,7 +1832,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);
@@ -1889,139 +1847,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;
@@ -2029,16 +1970,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;
        }
 
@@ -2058,7 +1997,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;
 }
@@ -2071,16 +2010,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;
        }
 
@@ -2088,7 +2025,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;
                        }
                }
@@ -2096,13 +2032,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;
 }
@@ -2115,16 +2050,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;
        }
 
@@ -2132,7 +2065,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;
                        }
                }
@@ -2140,13 +2072,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;
 }
@@ -2156,30 +2087,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;
 
@@ -2267,8 +2216,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;
@@ -2281,7 +2229,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);
@@ -2318,7 +2266,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;
        }
 
@@ -2331,8 +2279,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;
@@ -2345,8 +2292,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);
 
@@ -2370,7 +2315,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;
        }
 
@@ -2383,8 +2328,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;
@@ -2397,8 +2341,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);
 
@@ -2446,7 +2388,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;
        }
 
@@ -2459,8 +2401,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;
@@ -2473,8 +2414,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);
 
@@ -2522,7 +2461,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;
        }
 
@@ -2535,13 +2474,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);
@@ -2556,7 +2492,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;
@@ -2568,7 +2504,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;
        }
 
@@ -2593,7 +2529,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;
 }
@@ -2605,7 +2541,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;
        }
 
@@ -2622,7 +2558,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;
 }
@@ -2634,7 +2570,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;
        }
 
@@ -2663,7 +2599,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;
 }
@@ -2674,7 +2610,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;
        }
 
@@ -2707,14 +2643,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;
 
@@ -2734,14 +2669,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;
@@ -2750,8 +2684,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]) {
@@ -2761,16 +2693,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 : %d", count * sizeof(int));
-                       return 0;
-               }
+               arr = (int*)g_malloc0(count * sizeof(int));
 
                for (i = 0 ; i < count ; i++) {
                        if (info->detail_info[i] == NULL)
@@ -2781,7 +2710,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);
                }
        }