Add new field "timestamp_nsec" in MMCamcorderVideoStreamDataType
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_attribute.c
index 2e001ff..a6e2ef6 100644 (file)
 #include "mm_camcorder_gstcommon.h"
 
 #include <gst/video/colorbalance.h>
-#include <gst/video/cameracontrol.h>
 #include <gst/video/videooverlay.h>
-#ifdef HAVE_WAYLAND
-#include <gst/wayland/wayland.h>
-#endif
 
 /*-----------------------------------------------------------------------
 |    MACRO DEFINITIONS:                                                        |
 -----------------------------------------------------------------------*/
 #define MMCAMCORDER_DEFAULT_CAMERA_WIDTH        640
 #define MMCAMCORDER_DEFAULT_CAMERA_HEIGHT       480
-#define MMCAMCORDER_DEFAULT_ENCODED_PREVIEW_BITRATE (1024*1024*10)
 #define MMCAMCORDER_DEFAULT_ENCODED_PREVIEW_GOP_INTERVAL 1000
+#define MMCAMCORDER_DEFAULT_REPLAY_GAIN_REFERENCE_LEVEL  89.0
 
 /*---------------------------------------------------------------------------------------
 |    GLOBAL VARIABLE DEFINITIONS for internal                                          |
@@ -48,7 +44,7 @@
 /*-----------------------------------------------------------------------
 |    LOCAL VARIABLE DEFINITIONS for internal                           |
 -----------------------------------------------------------------------*/
-/*     Readonly attributes list.
+/*     Readonly attributes list.
 *      If you want to make some attributes read only, write down here.
 *      It will make them read only after composing whole attributes.
 */
@@ -64,7 +60,10 @@ static int readonly_attributes[] = {
        MM_CAM_RECOMMEND_DISPLAY_ROTATION,
        MM_CAM_SUPPORT_ZSL_CAPTURE,
        MM_CAM_SUPPORT_ZERO_COPY_FORMAT,
-       MM_CAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB
+       MM_CAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB,
+       MM_CAM_PLATFORM_PRIVILEGE_CAMERA,
+       MM_CAM_VIDEOSRC_ELEMENT_NAME,
+       MM_CAM_AUDIOSRC_ELEMENT_NAME
 };
 
 /*-----------------------------------------------------------------------
@@ -74,7 +73,6 @@ static int readonly_attributes[] = {
 static bool __mmcamcorder_set_capture_resolution(MMHandleType handle, int width, int height);
 static int  __mmcamcorder_set_conf_to_valid_info(MMHandleType handle);
 static int  __mmcamcorder_release_conf_valid_info(MMHandleType handle);
-static bool __mmcamcorder_attrs_is_supported(MMHandleType handle, int idx);
 static int  __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_name, const char *attribute_name, va_list var_args);
 
 /*=======================================================================
@@ -84,22 +82,22 @@ static int  __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_
 |    GLOBAL FUNCTION DEFINITIONS:                                      |
 -----------------------------------------------------------------------*/
 MMHandleType
-_mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
+_mmcamcorder_alloc_attribute(MMHandleType handle)
 {
-       _mmcam_dbg_log( "" );
+       MMCAM_LOG_INFO("");
 
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
-       MMHandleType attrs = 0;
-       mmf_attrs_construct_info_t *attrs_const_info = NULL;
+       MMHandleType attrs = NULL;
+       MMAttrsConstructInfo *attrs_const_info;
        unsigned int attr_count = 0;
        unsigned int idx;
+       int ret = MM_ERROR_NONE;
 
        static int depth[] = {MM_CAMCORDER_AUDIO_FORMAT_PCM_U8, MM_CAMCORDER_AUDIO_FORMAT_PCM_S16_LE};
        static int flip_list[] = { MM_FLIP_NONE };
        static int rotation_list[] = { MM_VIDEO_INPUT_ROTATION_NONE };
        static int visible_values[] = { 0, 1 }; /*0: off, 1:on*/
-       static int tag_orientation_values[] =
-               {
+       static int tag_orientation_values[] = {
                        1,      /*The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.*/
                        2,      /*the 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.*/
                        3,      /*the 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.*/
@@ -111,25 +109,25 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                };
 
        if (hcamcorder == NULL) {
-               _mmcam_dbg_err("handle is NULL");
+               MMCAM_LOG_ERROR("handle is NULL");
                return 0;
        }
 
        /* Create attribute constructor */
-       _mmcam_dbg_log("start");
+       MMCAM_LOG_INFO("start");
 
-       /* alloc 'mmf_attrs_construct_info_t' */
+       /* alloc 'MMAttrsConstructInfo' */
        attr_count = MM_CAM_ATTRIBUTE_NUM;
-       attrs_const_info = malloc(attr_count * sizeof(mmf_attrs_construct_info_t));
+       attrs_const_info = malloc(attr_count * sizeof(MMAttrsConstructInfo));
        if (!attrs_const_info) {
-               _mmcam_dbg_err("Fail to alloc constructor.");
+               MMCAM_LOG_ERROR("Fail to alloc constructor.");
                return 0;
        }
 
        /* alloc default attribute info */
        hcamcorder->cam_attrs_const_info = (mm_cam_attr_construct_info *)malloc(sizeof(mm_cam_attr_construct_info) * attr_count);
        if (hcamcorder->cam_attrs_const_info == NULL) {
-               _mmcam_dbg_err("failed to alloc default attribute info");
+               MMCAM_LOG_ERROR("failed to alloc default attribute info");
                free(attrs_const_info);
                attrs_const_info = NULL;
                return 0;
@@ -137,11 +135,11 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
 
        /* basic attributes' info */
        mm_cam_attr_construct_info temp_info[] = {
-               //0
+               /* 0 */
                {
                        MM_CAM_MODE,                        /* ID */
                        "mode",                             /* Name */
-                       MMF_VALUE_TYPE_INT,                 /* Type */
+                       MM_ATTRS_TYPE_INT,                 /* Type */
                        MM_ATTRS_FLAG_RW,                   /* Flag */
                        {(void*)MM_CAMCORDER_MODE_VIDEO_CAPTURE},     /* Default value */
                        MM_ATTRS_VALID_TYPE_INT_RANGE,      /* Validity type */
@@ -152,7 +150,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_AUDIO_DEVICE,
                        "audio-device",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_AUDIO_DEVICE_MIC},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -163,7 +161,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_DEVICE_COUNT,
                        "camera-device-count",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_VIDEO_DEVICE_NUM},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -174,7 +172,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_AUDIO_ENCODER,
                        "audio-encoder",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_AUDIO_CODEC_AMR},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -185,7 +183,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_VIDEO_ENCODER,
                        "video-encoder",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_VIDEO_CODEC_MPEG4},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -196,7 +194,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_IMAGE_ENCODER,
                        "image-encoder",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_IMAGE_CODEC_JPEG},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -207,7 +205,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILE_FORMAT,
                        "file-format",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_FILE_FORMAT_MP4},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -218,9 +216,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_DEVICE_NAME,
                        "camera-device-name",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
@@ -229,7 +227,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_AUDIO_SAMPLERATE,
                        "audio-samplerate",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)8000},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -240,7 +238,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_AUDIO_FORMAT,
                        "audio-format",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_CAMCORDER_AUDIO_FORMAT_PCM_S16_LE},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -248,11 +246,11 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {ARRAY_SIZE(depth)},
                        NULL,
                },
-               //10
+               /* 10 */
                {
                        MM_CAM_AUDIO_CHANNEL,
                        "audio-channel",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)2},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -263,9 +261,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_AUDIO_VOLUME,
                        "audio-volume",
-                       MMF_VALUE_TYPE_DOUBLE,
+                       MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)1},
+                       {.value_double = 1.0},
                        MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
                        {.double_min = 0.0},
                        {.double_max = 10.0},
@@ -274,7 +272,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_AUDIO_INPUT_ROUTE,
                        "audio-input-route",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_AUDIOROUTE_USE_EXTERNAL_SETTING},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -285,7 +283,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILTER_SCENE_MODE,
                        "filter-scene-mode",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -296,7 +294,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILTER_BRIGHTNESS,
                        "filter-brightness",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)1},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -307,7 +305,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILTER_CONTRAST,
                        "filter-contrast",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -318,7 +316,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILTER_WB,
                        "filter-wb",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -329,7 +327,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILTER_COLOR_TONE,
                        "filter-color-tone",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -340,7 +338,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILTER_SATURATION,
                        "filter-saturation",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -351,7 +349,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_FILTER_HUE,
                        "filter-hue",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -359,11 +357,11 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {.int_max = -1},
                        _mmcamcorder_commit_filter,
                },
-               //20
+               /* 20 */
                {
                        MM_CAM_FILTER_SHARPNESS,
                        "filter-sharpness",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -374,20 +372,20 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_FORMAT,
                        "camera-format",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_PIXEL_FORMAT_YUYV},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
                        {0},
                        {0},
-                       NULL,
+                       _mmcamcorder_commit_camera_format,
                },
                {
                        MM_CAM_CAMERA_RECORDING_MOTION_RATE,
                        "camera-recording-motion-rate",
-                       MMF_VALUE_TYPE_DOUBLE,
+                       MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)1},
+                       {.value_double = 1.0},
                        MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
                        {.double_min = 0.0},
                        {.double_max = _MMCAMCORDER_MAX_DOUBLE},
@@ -396,7 +394,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_FPS,
                        "camera-fps",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)30},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -407,7 +405,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_WIDTH,
                        "camera-width",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MMCAMCORDER_DEFAULT_CAMERA_WIDTH},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -418,7 +416,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_HEIGHT,
                        "camera-height",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MMCAMCORDER_DEFAULT_CAMERA_HEIGHT},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -429,7 +427,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_DIGITAL_ZOOM,
                        "camera-digital-zoom",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)10},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -440,7 +438,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_OPTICAL_ZOOM,
                        "camera-optical-zoom",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -451,7 +449,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_FOCUS_MODE,
                        "camera-focus-mode",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_CAMCORDER_FOCUS_MODE_NONE},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -462,7 +460,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_AF_SCAN_RANGE,
                        "camera-af-scan-range",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -470,11 +468,11 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {0},
                        _mmcamcorder_commit_camera_af_scan_range,
                },
-               //30
+               /* 30 */
                {
                        MM_CAM_CAMERA_EXPOSURE_MODE,
                        "camera-exposure-mode",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -485,7 +483,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_EXPOSURE_VALUE,
                        "camera-exposure-value",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -496,7 +494,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_F_NUMBER,
                        "camera-f-number",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -507,7 +505,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_SHUTTER_SPEED,
                        "camera-shutter-speed",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -518,7 +516,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_ISO,
                        "camera-iso",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -529,7 +527,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_WDR,
                        "camera-wdr",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -540,7 +538,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_ANTI_HANDSHAKE,
                        "camera-anti-handshake",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -551,18 +549,18 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_FPS_AUTO,
                        "camera-fps-auto",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        {.int_min = 0},
                        {.int_max = 1},
-                       NULL,
+                       _mmcamcorder_commit_camera_fps,
                },
                {
                        MM_CAM_CAMERA_DELAY_ATTR_SETTING,
                        "camera-delay-attr-setting",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -573,30 +571,30 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_AUDIO_ENCODER_BITRATE,
                        "audio-encoder-bitrate",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        {.int_min = 0},
                        {.int_max = _MMCAMCORDER_MAX_INT},
-                       NULL,
+                       _mmcamcorder_commit_encoder_bitrate,
                },
-               // 40
+               /* 40 */
                {
                        MM_CAM_VIDEO_ENCODER_BITRATE,
                        "video-encoder-bitrate",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        {.int_min = 0},
                        {.int_max = _MMCAMCORDER_MAX_INT},
-                       NULL,
+                       _mmcamcorder_commit_encoder_bitrate,
                },
                {
                        MM_CAM_IMAGE_ENCODER_QUALITY,
                        "image-encoder-quality",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)95},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -607,7 +605,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_FORMAT,
                        "capture-format",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_PIXEL_FORMAT_ENCODED},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -618,7 +616,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_WIDTH,
                        "capture-width",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)1600},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -629,7 +627,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_HEIGHT,
                        "capture-height",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)1200},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -640,7 +638,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_COUNT,
                        "capture-count",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)1},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -651,7 +649,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_INTERVAL,
                        "capture-interval",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -662,7 +660,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_BREAK_CONTINUOUS_SHOT,
                        "capture-break-cont-shot",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -673,9 +671,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_HANDLE,
                        "display-handle",
-                       MMF_VALUE_TYPE_DATA,
+                       MM_ATTRS_TYPE_DATA,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
@@ -684,7 +682,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_DEVICE,
                        "display-device",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_DISPLAY_DEVICE_MAINLCD},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -692,13 +690,13 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {0},
                        NULL,
                },
-               // 50
+               /* 50 */
                {
                        MM_CAM_DISPLAY_SURFACE,
                        "display-surface",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)MM_DISPLAY_SURFACE_X},
+                       {(void*)MM_DISPLAY_SURFACE_OVERLAY},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
                        {0},
                        {0},
@@ -707,7 +705,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_RECT_X,
                        "display-rect-x",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -718,7 +716,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_RECT_Y,
                        "display-rect-y",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -729,29 +727,29 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_RECT_WIDTH,
                        "display-rect-width",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       {.int_min = 0},
+                       {.int_min = 1},
                        {.int_max = _MMCAMCORDER_MAX_INT},
                        _mmcamcorder_commit_display_rect,
                },
                {
                        MM_CAM_DISPLAY_RECT_HEIGHT,
                        "display-rect-height",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       {.int_min = 0},
+                       {.int_min = 1},
                        {.int_max = _MMCAMCORDER_MAX_INT},
                        _mmcamcorder_commit_display_rect,
                },
                {
                        MM_CAM_DISPLAY_SOURCE_X,
                        "display-src-x",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -762,7 +760,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_SOURCE_Y,
                        "display-src-y",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -773,7 +771,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_SOURCE_WIDTH,
                        "display-src-width",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -784,7 +782,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_SOURCE_HEIGHT,
                        "display-src-height",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -795,7 +793,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_ROTATION,
                        "display-rotation",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_DISPLAY_ROTATION_NONE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -803,10 +801,11 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {.int_max = MM_DISPLAY_ROTATION_270},
                        _mmcamcorder_commit_display_rotation,
                },
-               { // 60
+               /* 60 */
+               {
                        MM_CAM_DISPLAY_VISIBLE,
                        "display-visible",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)1},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -817,7 +816,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_SCALE,
                        "display-scale",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -828,7 +827,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_GEOMETRY_METHOD,
                        "display-geometry-method",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -839,9 +838,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_TARGET_FILENAME,
                        "target-filename",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
@@ -850,107 +849,107 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_TARGET_MAX_SIZE,
                        "target-max-size",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        {.int_min = 0},
                        {.int_max = _MMCAMCORDER_MAX_INT},
-                       NULL,
+                       _mmcamcorder_commit_recording_max_limit,
                },
                {
                        MM_CAM_TARGET_TIME_LIMIT,
                        "target-time-limit",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        {.int_min = 0},
                        {.int_max = _MMCAMCORDER_MAX_INT},
-                       NULL,
+                       _mmcamcorder_commit_recording_max_limit,
                },
                {
                        MM_CAM_TAG_ENABLE,
                        "tag-enable",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)0},
+                       {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       {.int_min = 0},
-                       {.int_max = 1},
-                       NULL,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_TAG_IMAGE_DESCRIPTION,
                        "tag-image-description",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_TAG_ORIENTATION,
                        "tag-orientation",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)1},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
                        {tag_orientation_values},
                        {ARRAY_SIZE(tag_orientation_values)},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_TAG_SOFTWARE,
                        "tag-software",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
-               //70
+               /* 70 */
                {
                        MM_CAM_TAG_LATITUDE,
                        "tag-latitude",
-                       MMF_VALUE_TYPE_DOUBLE,
+                       MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)0},
+                       {.value_double = 0.0},
                        MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
                        {.double_min = -360.0},
                        {.double_max = 360.0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_TAG_LONGITUDE,
                        "tag-longitude",
-                       MMF_VALUE_TYPE_DOUBLE,
+                       MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)0},
+                       {.value_double = 0.0},
                        MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
                        {.double_min = -360.0},
                        {.double_max = 360.0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_TAG_ALTITUDE,
                        "tag-altitude",
-                       MMF_VALUE_TYPE_DOUBLE,
+                       MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)0},
+                       {.value_double = 0.0},
                        MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
                        {.double_min = -999999.0},
                        {.double_max = 999999.0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_STROBE_CONTROL,
                        "strobe-control",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -961,7 +960,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_STROBE_CAPABILITIES,
                        "strobe-capabilities",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -972,7 +971,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_STROBE_MODE,
                        "strobe-mode",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -983,7 +982,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DETECT_MODE,
                        "detect-mode",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -994,7 +993,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DETECT_NUMBER,
                        "detect-number",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1005,7 +1004,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DETECT_FOCUS_SELECT,
                        "detect-focus-select",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1016,7 +1015,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DETECT_SELECT_NUMBER,
                        "detect-select-number",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1024,11 +1023,11 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {.int_max = -1},
                        _mmcamcorder_commit_detect,
                },
-               //80
+               /* 80 */
                {
                        MM_CAM_DETECT_STATUS,
                        "detect-status",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1039,7 +1038,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_ZERO_SYSTEMLAG,
                        "capture-zero-systemlag",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1050,7 +1049,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_AF_TOUCH_X,
                        "camera-af-touch-x",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1061,7 +1060,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_AF_TOUCH_Y,
                        "camera-af-touch-y",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1072,7 +1071,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_AF_TOUCH_WIDTH,
                        "camera-af-touch-width",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1083,7 +1082,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_AF_TOUCH_HEIGHT,
                        "camera-af-touch-height",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1094,9 +1093,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_FOCAL_LENGTH,
                        "camera-focal-length",
-                       MMF_VALUE_TYPE_DOUBLE,
+                       MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)0},
+                       {.value_double = 0.0},
                        MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
                        {.double_min = 0.0},
                        {.double_max = 1000.0},
@@ -1105,7 +1104,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_RECOMMEND_PREVIEW_FORMAT_FOR_CAPTURE,
                        "recommend-preview-format-for-capture",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_PIXEL_FORMAT_YUYV},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1116,7 +1115,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_RECOMMEND_PREVIEW_FORMAT_FOR_RECORDING,
                        "recommend-preview-format-for-recording",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_PIXEL_FORMAT_NV12},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1127,52 +1126,52 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_TAG_GPS_ENABLE,
                        "tag-gps-enable",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       {.int_min = 0},
-                       {.int_max = 1},
-                       NULL,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       _mmcamcorder_commit_tag,
                },
-               // 90
+               /* 90 */
                {
                        MM_CAM_TAG_GPS_TIME_STAMP,
                        "tag-gps-time-stamp",
-                       MMF_VALUE_TYPE_DOUBLE,
+                       MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)0},
+                       {.value_double = 0.0},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_TAG_GPS_DATE_STAMP,
                        "tag-gps-date-stamp",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_TAG_GPS_PROCESSING_METHOD,
                        "tag-gps-processing-method",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
-                       NULL,
+                       _mmcamcorder_commit_tag,
                },
                {
                        MM_CAM_CAMERA_ROTATION,
                        "camera-rotation",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_VIDEO_INPUT_ROTATION_NONE},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1183,9 +1182,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURED_SCREENNAIL,
                        "captured-screennail",
-                       MMF_VALUE_TYPE_DATA,
-                       MM_ATTRS_FLAG_READABLE,
-                       {(void*)NULL},
+                       MM_ATTRS_TYPE_DATA,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
@@ -1194,18 +1193,18 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURE_SOUND_ENABLE,
                        "capture-sound-enable",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)TRUE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       {.int_min = 0},
-                       {.int_max = 1},
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
                        _mmcamcorder_commit_capture_sound_enable,
                },
                {
                        MM_CAM_RECOMMEND_DISPLAY_ROTATION,
                        "recommend-display-rotation",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_DISPLAY_ROTATION_270},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1216,7 +1215,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_FLIP,
                        "camera-flip",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_FLIP_NONE},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1227,7 +1226,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_HDR_CAPTURE,
                        "camera-hdr-capture",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1238,7 +1237,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_MODE,
                        "display-mode",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_DISPLAY_MODE_DEFAULT},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1246,11 +1245,11 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {0},
                        _mmcamcorder_commit_display_mode,
                },
-               //100
+               /* 100 */
                {
                        MM_CAM_AUDIO_DISABLE,
                        "audio-disable",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1261,7 +1260,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_RECOMMEND_CAMERA_WIDTH,
                        "recommend-camera-width",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MMCAMCORDER_DEFAULT_CAMERA_WIDTH},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1272,7 +1271,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_RECOMMEND_CAMERA_HEIGHT,
                        "recommend-camera-height",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MMCAMCORDER_DEFAULT_CAMERA_HEIGHT},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1283,9 +1282,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAPTURED_EXIF_RAW_DATA,
                        "captured-exif-raw-data",
-                       MMF_VALUE_TYPE_DATA,
-                       MM_ATTRS_FLAG_READABLE,
-                       {(void*)NULL},
+                       MM_ATTRS_TYPE_DATA,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
@@ -1294,9 +1293,9 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_EVAS_SURFACE_SINK,
                        "display-evas-surface-sink",
-                       MMF_VALUE_TYPE_STRING,
-                       MM_ATTRS_FLAG_READABLE,
-                       {(void*)NULL},
+                       MM_ATTRS_TYPE_STRING,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
@@ -1305,7 +1304,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_EVAS_DO_SCALING,
                        "display-evas-do-scaling",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)TRUE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1316,7 +1315,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_FACING_DIRECTION,
                        "camera-facing-direction",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_CAMCORDER_CAMERA_FACING_DIRECTION_REAR},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1327,7 +1326,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_FLIP,
                        "display-flip",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_FLIP_NONE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1338,7 +1337,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_CAMERA_VIDEO_STABILIZATION,
                        "camera-video-stabilization",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_CAMCORDER_VIDEO_STABILIZATION_OFF},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1349,7 +1348,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_TAG_VIDEO_ORIENTATION,
                        "tag-video-orientation",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MM_CAMCORDER_TAG_VIDEO_ORT_NONE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1357,11 +1356,66 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {.int_max = MM_CAMCORDER_TAG_VIDEO_ORT_270},
                        NULL,
                },
-               //110
+               /* 110 */
+               {
+                       MM_CAM_CAMERA_PAN_MECHA,
+                       "camera-pan-mecha",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)0},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = 0},
+                       {.int_max = -1},
+                       _mmcamcorder_commit_camera_pan,
+               },
+               {
+                       MM_CAM_CAMERA_PAN_ELEC,
+                       "camera-pan-elec",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)0},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = 0},
+                       {.int_max = -1},
+                       _mmcamcorder_commit_camera_pan,
+               },
+               {
+                       MM_CAM_CAMERA_TILT_MECHA,
+                       "camera-tilt-mecha",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)0},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = 0},
+                       {.int_max = -1},
+                       _mmcamcorder_commit_camera_tilt,
+               },
+               {
+                       MM_CAM_CAMERA_TILT_ELEC,
+                       "camera-tilt-elec",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)0},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = 0},
+                       {.int_max = -1},
+                       _mmcamcorder_commit_camera_tilt,
+               },
+               {
+                       MM_CAM_CAMERA_PTZ_TYPE,
+                       "camera-ptz-type",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)0},
+                       MM_ATTRS_VALID_TYPE_INT_ARRAY,
+                       {0},
+                       {0},
+                       _mmcamcorder_commit_camera_ptz_type,
+               },
                {
                        MM_CAM_VIDEO_WIDTH,
                        "video-width",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1372,7 +1426,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_VIDEO_HEIGHT,
                        "video-height",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_ARRAY,
@@ -1383,7 +1437,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_SUPPORT_ZSL_CAPTURE,
                        "support-zsl-capture",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1394,7 +1448,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_SUPPORT_ZERO_COPY_FORMAT,
                        "support-zero-copy-format",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1405,7 +1459,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB,
                        "support-media-packet-preview-cb",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1413,32 +1467,33 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                        {.int_max = TRUE},
                        NULL,
                },
+               /* 120 */
                {
                        MM_CAM_ENCODED_PREVIEW_BITRATE,
                        "encoded-preview-bitrate",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)MMCAMCORDER_DEFAULT_ENCODED_PREVIEW_BITRATE},
+                       {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       0,
-                       _MMCAMCORDER_MAX_INT,
+                       {.int_min = 0},
+                       {.int_max = _MMCAMCORDER_MAX_INT},
                        _mmcamcorder_commit_encoded_preview_bitrate,
                },
                {
                        MM_CAM_ENCODED_PREVIEW_GOP_INTERVAL,
                        "encoded-preview-gop-interval",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)MMCAMCORDER_DEFAULT_ENCODED_PREVIEW_GOP_INTERVAL},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
-                       0,
-                       _MMCAMCORDER_MAX_INT,
+                       {.int_min = 0},
+                       {.int_max = _MMCAMCORDER_MAX_INT},
                        _mmcamcorder_commit_encoded_preview_gop_interval,
                },
                {
                        MM_CAM_RECORDER_TAG_ENABLE,
                        "recorder-tag-enable",
-                       MMF_VALUE_TYPE_INT,
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)FALSE},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
@@ -1449,36 +1504,222 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
                {
                        MM_CAM_DISPLAY_SOCKET_PATH,
                        "display-socket-path",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
                        NULL,
                },
                {
-                       MM_CAM_PID_FOR_SOUND_FOCUS,
-                       "pid-for-sound-focus",
-                       MMF_VALUE_TYPE_INT,
+                       MM_CAM_CLIENT_PID,
+                       "client-pid",
+                       MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        {(void*)0},
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        {.int_min = 0},
                        {.int_max = _MMCAMCORDER_MAX_INT},
-                       _mmcamcorder_commit_pid_for_sound_focus,
+                       NULL,
                },
-               //120
                {
                        MM_CAM_ROOT_DIRECTORY,
                        "root-directory",
-                       MMF_VALUE_TYPE_STRING,
+                       MM_ATTRS_TYPE_STRING,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       NULL,
+               },
+               {
+                       MM_CAM_SOUND_STREAM_INDEX,
+                       "sound-stream-index",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)-1},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = -1},
+                       {.int_max = _MMCAMCORDER_MAX_INT},
+                       NULL,
+               },
+               {
+                       MM_CAM_SOUND_STREAM_TYPE,
+                       "sound-stream-type",
+                       MM_ATTRS_TYPE_STRING,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       _mmcamcorder_commit_sound_stream_info,
+               },
+               {
+                       MM_CAM_DISPLAY_REUSE_HINT,
+                       "display-reuse-hint",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)FALSE},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       NULL,
+               },
+               {
+                       MM_CAM_DISPLAY_REUSE_ELEMENT,
+                       "display-reuse-element",
+                       MM_ATTRS_TYPE_DATA,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       NULL,
+               },
+               {
+                       MM_CAM_GDBUS_CONNECTION,
+                       "gdbus-connection",
+                       MM_ATTRS_TYPE_DATA,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       NULL,
+               },
+               {
+                       MM_CAM_AUDIO_REPLAY_GAIN_ENABLE,
+                       "audio-replay-gain-enable",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)FALSE},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       _mmcamcorder_commit_audio_replay_gain,
+               },
+               {
+                       MM_CAM_AUDIO_REPLAY_GAIN_REFERENCE_LEVEL,
+                       "audio-replay-gain-reference-level",
+                       MM_ATTRS_TYPE_DOUBLE,
+                       MM_ATTRS_FLAG_RW,
+                       {.value_double = MMCAMCORDER_DEFAULT_REPLAY_GAIN_REFERENCE_LEVEL},
+                       MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,
+                       {.double_min = 0.0},
+                       {.double_max = 150.0},
+                       _mmcamcorder_commit_audio_replay_gain,
+               },
+               {
+                       MM_CAM_SUPPORT_USER_BUFFER,
+                       "support-user-buffer",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)FALSE},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       NULL,
+               },
+               {
+                       MM_CAM_USER_BUFFER_FD,
+                       "user-buffer-fd",
+                       MM_ATTRS_TYPE_DATA,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       NULL,
+               },
+               {
+                       MM_CAM_PLATFORM_PRIVILEGE_CAMERA,
+                       "platform-privilege-camera",
+                       MM_ATTRS_TYPE_STRING,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       NULL,
+               },
+               {
+                       MM_CAM_STROBE_BRIGHTNESS,
+                       "strobe-brightness",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)1},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = 0},
+                       {.int_max = -1},
+                       _mmcamcorder_commit_strobe,
+               },
+               {
+                       MM_CAM_VIDEOSRC_ELEMENT_NAME,
+                       "videosrc-element-name",
+                       MM_ATTRS_TYPE_STRING,
+                       MM_ATTRS_FLAG_RW,
+                       {NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       NULL,
+               },
+               {
+                       MM_CAM_AUDIOSRC_ELEMENT_NAME,
+                       "audiosrc-element-name",
+                       MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
-                       {(void*)NULL},
+                       {NULL},
                        MM_ATTRS_VALID_TYPE_NONE,
                        {0},
                        {0},
                        NULL,
+               },
+               {
+                       MM_CAM_EXTRA_PREVIEW_ENABLE,
+                       "extra-preview-enable",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)FALSE},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       _mmcamcorder_commit_extra_preview,
+               },
+               {
+                       MM_CAM_CAMERA_FOCUS_LEVEL,
+                       "camera-focus-level",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)0},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = 0},
+                       {.int_max = -1},
+                       _mmcamcorder_commit_camera_focus_level,
+               },
+               {
+                       MM_CAM_SUPPORT_EXTRA_PREVIEW,
+                       "support-extra-preview",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)FALSE},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       NULL,
+               },
+               {
+                       MM_CAM_REQUEST_CODEC_CONFIG,
+                       "request-codec-config",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void*)FALSE},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       _mmcamcorder_commit_request_codec_config,
                }
        };
 
@@ -1487,7 +1728,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
        for (idx = 0 ; idx < attr_count ; idx++) {
                /* attribute order check. This should be same. */
                if (idx != hcamcorder->cam_attrs_const_info[idx].attrid) {
-                       _mmcam_dbg_err("Please check attributes order. Is the idx same with enum val?");
+                       MMCAM_LOG_ERROR("Please check attributes order. Is the idx same with enum val?");
                        free(attrs_const_info);
                        attrs_const_info = NULL;
                        free(hcamcorder->cam_attrs_const_info);
@@ -1502,19 +1743,20 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
        }
 
        /* Camcorder Attributes */
-       _mmcam_dbg_log("Create Camcorder Attributes[%p, %d]", attrs_const_info, attr_count);
+       MMCAM_LOG_INFO("Create Camcorder Attributes[%p, %d]", attrs_const_info, attr_count);
 
-       attrs = mmf_attrs_new_from_data("Camcorder_Attributes",
-                                       attrs_const_info,
-                                       attr_count,
-                                       _mmcamcorder_commit_camcorder_attrs,
-                                       (void *)handle);
+       ret = mm_attrs_new(attrs_const_info,
+               attr_count,
+               "Camcorder_Attributes",
+               _mmcamcorder_commit_camcorder_attrs,
+               (void *)handle,
+               &attrs);
 
        free(attrs_const_info);
        attrs_const_info = NULL;
 
-       if (attrs == 0) {
-               _mmcam_dbg_err("Fail to alloc attribute handle");
+       if (ret != MM_ERROR_NONE) {
+               MMCAM_LOG_ERROR("Fail to alloc attribute handle");
                free(hcamcorder->cam_attrs_const_info);
                hcamcorder->cam_attrs_const_info = NULL;
                return 0;
@@ -1522,50 +1764,47 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info )
 
        __mmcamcorder_set_conf_to_valid_info(handle);
 
-       for (idx = 0; idx < attr_count; idx++)
-       {
-/*             _mmcam_dbg_log("Valid type [%s:%d, %d, %d]", cam_attrs_const_info[idx].name, cam_attrs_const_info[idx].validity_type
-                       , cam_attrs_const_info[idx].validity_value1, cam_attrs_const_info[idx].validity_value2);
-*/
-               mmf_attrs_set_valid_type (attrs, idx, hcamcorder->cam_attrs_const_info[idx].validity_type);
+       for (idx = 0; idx < attr_count; idx++) {
+               mm_cam_attr_construct_info *attr_info = &hcamcorder->cam_attrs_const_info[idx];
 
-               switch (hcamcorder->cam_attrs_const_info[idx].validity_type)
-               {
-                       case MM_ATTRS_VALID_TYPE_INT_ARRAY:
-                               if (hcamcorder->cam_attrs_const_info[idx].validity_value_1.int_array &&
-                                   hcamcorder->cam_attrs_const_info[idx].validity_value_2.count > 0) {
-                                       mmf_attrs_set_valid_array(attrs, idx,
-                                                                 (const int *)(hcamcorder->cam_attrs_const_info[idx].validity_value_1.int_array),
-                                                                 hcamcorder->cam_attrs_const_info[idx].validity_value_2.count,
-                                                                 hcamcorder->cam_attrs_const_info[idx].default_value.value_int);
-                               }
+               mm_attrs_set_valid_type(attrs, idx, attr_info->validity_type);
+
+               switch (attr_info->validity_type) {
+               case MM_ATTRS_VALID_TYPE_INT_ARRAY:
+                       if (attr_info->validity_value_1.int_array &&
+                           attr_info->validity_value_2.count > 0) {
+                               mm_attrs_set_valid_array(attrs, idx,
+                                       (const int *)(attr_info->validity_value_1.int_array),
+                                       attr_info->validity_value_2.count,
+                                       attr_info->default_value.value_int);
+                       }
                        break;
-                       case MM_ATTRS_VALID_TYPE_INT_RANGE:
-                               mmf_attrs_set_valid_range(attrs, idx,
-                                                         hcamcorder->cam_attrs_const_info[idx].validity_value_1.int_min,
-                                                         hcamcorder->cam_attrs_const_info[idx].validity_value_2.int_max,
-                                                         hcamcorder->cam_attrs_const_info[idx].default_value.value_int);
+               case MM_ATTRS_VALID_TYPE_INT_RANGE:
+                       mm_attrs_set_valid_range(attrs, idx,
+                               attr_info->validity_value_1.int_min,
+                               attr_info->validity_value_2.int_max,
+                               attr_info->default_value.value_int);
                        break;
-                       case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
-                               if (hcamcorder->cam_attrs_const_info[idx].validity_value_1.double_array &&
-                                   hcamcorder->cam_attrs_const_info[idx].validity_value_2.count > 0) {
-                                       mmf_attrs_set_valid_double_array(attrs, idx,
-                                                                        (const double *)(hcamcorder->cam_attrs_const_info[idx].validity_value_1.double_array),
-                                                                        hcamcorder->cam_attrs_const_info[idx].validity_value_2.count,
-                                                                        hcamcorder->cam_attrs_const_info[idx].default_value.value_double);
-                               }
+               case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
+                       if (attr_info->validity_value_1.double_array &&
+                           attr_info->validity_value_2.count > 0) {
+                               mm_attrs_set_valid_double_array(attrs, idx,
+                                       (const double *)(attr_info->validity_value_1.double_array),
+                                       attr_info->validity_value_2.count,
+                                       attr_info->default_value.value_double);
+                       }
                        break;
-                       case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
-                               mmf_attrs_set_valid_double_range(attrs, idx,
-                                                                hcamcorder->cam_attrs_const_info[idx].validity_value_1.double_min,
-                                                                hcamcorder->cam_attrs_const_info[idx].validity_value_2.double_max,
-                                                                hcamcorder->cam_attrs_const_info[idx].default_value.value_double);
+               case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
+                       mm_attrs_set_valid_double_range(attrs, idx,
+                               attr_info->validity_value_1.double_min,
+                               attr_info->validity_value_2.double_max,
+                               attr_info->default_value.value_double);
                        break;
-                       case MM_ATTRS_VALID_TYPE_NONE:
+               case MM_ATTRS_VALID_TYPE_NONE:
                        break;
-                       case MM_ATTRS_VALID_TYPE_INVALID:
-                       default:
-                               _mmcam_dbg_err("Valid type error.");
+               case MM_ATTRS_VALID_TYPE_INVALID:
+               default:
+                       MMCAM_LOG_ERROR("Valid type error.");
                        break;
                }
        }
@@ -1582,22 +1821,24 @@ _mmcamcorder_dealloc_attribute(MMHandleType handle, MMHandleType attrs)
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
        if (hcamcorder == NULL) {
-               _mmcam_dbg_err("handle is NULL");
+               MMCAM_LOG_ERROR("handle is NULL");
                return;
        }
 
-       _mmcam_dbg_log("");
+       MMCAM_LOG_INFO("");
 
        if (attrs) {
-               mmf_attrs_free(attrs);
-               _mmcam_dbg_log("released attribute");
+               mm_attrs_free(attrs);
+               MMCAM_LOG_INFO("released attribute");
        }
 
        if (hcamcorder->cam_attrs_const_info) {
                free(hcamcorder->cam_attrs_const_info);
                hcamcorder->cam_attrs_const_info = NULL;
-               _mmcam_dbg_log("released attribute info");
+               MMCAM_LOG_INFO("released attribute info");
        }
+
+       return;
 }
 
 
@@ -1607,11 +1848,11 @@ _mmcamcorder_get_attributes(MMHandleType handle,  char **err_attr_name, const ch
        MMHandleType attrs = 0;
        int ret = MM_ERROR_NONE;
 
-       mmf_return_val_if_fail( handle, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
-//     mmf_return_val_if_fail( err_attr_name, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
+       mmf_return_val_if_fail(handle, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
+       /*mmf_return_val_if_fail(err_attr_name, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);*/
 
        attrs = MMF_CAMCORDER_ATTRS(handle);
-       mmf_return_val_if_fail( attrs, MM_ERROR_CAMCORDER_NOT_INITIALIZED );
+       mmf_return_val_if_fail(attrs, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
 
        ret = mm_attrs_get_valist(attrs, err_attr_name, attribute_name, var_args);
 
@@ -1624,39 +1865,66 @@ _mmcamcorder_set_attributes(MMHandleType handle, char **err_attr_name, const cha
 {
        MMHandleType attrs = 0;
        int ret = MM_ERROR_NONE;
+       int err_index = 0;
+       char *tmp_err_attr_name = NULL;
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       va_list var_args_copy;
 
-       mmf_return_val_if_fail( handle, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
-//     mmf_return_val_if_fail( err_attr_name, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
+       mmf_return_val_if_fail(handle, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
 
        if (!_MMCAMCORDER_TRYLOCK_CMD(handle)) {
-               _mmcam_dbg_err("Another command is running.");
+               MMCAM_LOG_ERROR("Another command is running.");
                return MM_ERROR_CAMCORDER_CMD_IS_RUNNING;
        }
 
+       /* copy var_args to keep original var_args */
+       va_copy(var_args_copy, var_args);
+
        attrs = MMF_CAMCORDER_ATTRS(handle);
        if (attrs) {
-               ret = __mmcamcorder_check_valid_pair( handle, err_attr_name, attribute_name, var_args );
+               ret = __mmcamcorder_check_valid_pair(handle, &tmp_err_attr_name, attribute_name, var_args);
        } else {
-               _mmcam_dbg_err("handle 0x%x, attrs is NULL, attr name [%s]", handle, attribute_name);
+               MMCAM_LOG_ERROR("handle %p, attrs is NULL, attr name [%s]", handle, attribute_name);
                ret = MM_ERROR_CAMCORDER_NOT_INITIALIZED;
        }
 
        if (ret == MM_ERROR_NONE) {
                hcamcorder->error_code = MM_ERROR_NONE;
-               ret = mm_attrs_set_valist(attrs, err_attr_name, attribute_name, var_args);
+               /* In 64bit environment, unexpected result is returned if var_args is used again. */
+               ret = mm_attrs_set_valist(attrs, &tmp_err_attr_name, attribute_name, var_args_copy);
        }
 
+       va_end(var_args_copy);
+
        _MMCAMCORDER_UNLOCK_CMD(handle);
 
        if (ret != MM_ERROR_NONE) {
+               if (ret == MM_ERROR_COMMON_OUT_OF_RANGE) {
+                       if (mm_attrs_get_index(attrs, tmp_err_attr_name, &err_index) == MM_ERROR_NONE &&
+                               _mmcamcorder_check_supported_attribute(handle, err_index)) {
+                               MMCAM_LOG_ERROR("[%s] is supported, but value is invalid",
+                                       tmp_err_attr_name ? tmp_err_attr_name : "NULL");
+                               ret = MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
+                       }
+               }
+
                if (hcamcorder->error_code != MM_ERROR_NONE) {
-                       _mmcam_dbg_err("error_code is not NONE. origin 0x%x, modified 0x%x", ret, hcamcorder->error_code);
+                       MMCAM_LOG_ERROR("error_code is set. ret 0x%x -> modified 0x%x", ret, hcamcorder->error_code);
                        ret = hcamcorder->error_code;
                        hcamcorder->error_code = MM_ERROR_NONE;
                }
 
-               _mmcam_dbg_err("failed error code 0x%x - handle %p", ret, (mmf_camcorder_t *)handle);
+               MMCAM_LOG_ERROR("failed error code 0x%x - handle %p", ret, (mmf_camcorder_t *)handle);
+       }
+
+       if (tmp_err_attr_name) {
+               if (!err_attr_name) {
+                       MMCAM_LOG_ERROR("set attribute[%s] error, but err name is NULL", tmp_err_attr_name);
+                       free(tmp_err_attr_name);
+                       tmp_err_attr_name = NULL;
+               } else {
+                       *err_attr_name = tmp_err_attr_name;
+               }
        }
 
        return ret;
@@ -1670,48 +1938,46 @@ _mmcamcorder_get_attribute_info(MMHandleType handle, const char *attr_name, MMCa
        MMAttrsInfo attrinfo;
        int ret = MM_ERROR_NONE;
 
-       mmf_return_val_if_fail( handle, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
-       mmf_return_val_if_fail( attr_name, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
-       mmf_return_val_if_fail( info, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
+       mmf_return_val_if_fail(handle, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
+       mmf_return_val_if_fail(attr_name, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
+       mmf_return_val_if_fail(info, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
 
        attrs = MMF_CAMCORDER_ATTRS(handle);
-       mmf_return_val_if_fail( attrs, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
+       mmf_return_val_if_fail(attrs, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
 
        ret = mm_attrs_get_info_by_name(attrs, attr_name, (MMAttrsInfo*)&attrinfo);
 
-       if (ret == MM_ERROR_NONE)
-       {
+       if (ret == MM_ERROR_NONE) {
                memset(info, 0x00, sizeof(MMCamAttrsInfo));
                info->type = attrinfo.type;
                info->flag = attrinfo.flag;
-               info->validity_type= attrinfo.validity_type;
+               info->validity_type = attrinfo.validity_type;
 
-               switch(attrinfo.validity_type)
-               {
-                       case MM_ATTRS_VALID_TYPE_INT_ARRAY:
-                               info->int_array.array = attrinfo.int_array.array;
-                               info->int_array.count = attrinfo.int_array.count;
-                               info->int_array.def = attrinfo.int_array.dval;
+               switch (attrinfo.validity_type) {
+               case MM_ATTRS_VALID_TYPE_INT_ARRAY:
+                       info->int_array.array = attrinfo.int_array.array;
+                       info->int_array.count = attrinfo.int_array.count;
+                       info->int_array.def = attrinfo.int_array.dval;
                        break;
-                       case MM_ATTRS_VALID_TYPE_INT_RANGE:
-                               info->int_range.min = attrinfo.int_range.min;
-                               info->int_range.max = attrinfo.int_range.max;
-                               info->int_range.def = attrinfo.int_range.dval;
+               case MM_ATTRS_VALID_TYPE_INT_RANGE:
+                       info->int_range.min = attrinfo.int_range.min;
+                       info->int_range.max = attrinfo.int_range.max;
+                       info->int_range.def = attrinfo.int_range.dval;
                        break;
-                       case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
-                               info->double_array.array = attrinfo.double_array.array;
-                               info->double_array.count = attrinfo.double_array.count;
-                               info->double_array.def = attrinfo.double_array.dval;
+               case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
+                       info->double_array.array = attrinfo.double_array.array;
+                       info->double_array.count = attrinfo.double_array.count;
+                       info->double_array.def = attrinfo.double_array.dval;
                        break;
-                       case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
-                               info->double_range.min = attrinfo.double_range.min;
-                               info->double_range.max = attrinfo.double_range.max;
-                               info->double_range.def = attrinfo.double_range.dval;
+               case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
+                       info->double_range.min = attrinfo.double_range.min;
+                       info->double_range.max = attrinfo.double_range.max;
+                       info->double_range.def = attrinfo.double_range.dval;
                        break;
-                       case MM_ATTRS_VALID_TYPE_NONE:
+               case MM_ATTRS_VALID_TYPE_NONE:
                        break;
-                       case MM_ATTRS_VALID_TYPE_INVALID:
-                       default:
+               case MM_ATTRS_VALID_TYPE_INVALID:
+               default:
                        break;
                }
        }
@@ -1721,7 +1987,7 @@ _mmcamcorder_get_attribute_info(MMHandleType handle, const char *attr_name, MMCa
 
 
 bool
-_mmcamcorder_commit_camcorder_attrs (int attr_idx, const char *attr_name, const mmf_value_t *value, void *commit_param)
+_mmcamcorder_commit_camcorder_attrs(int attr_idx, const char *attr_name, const MMAttrsValue *value, void *commit_param)
 {
        bool bret = FALSE;
        mmf_camcorder_t *hcamcorder = NULL;
@@ -1733,11 +1999,10 @@ _mmcamcorder_commit_camcorder_attrs (int attr_idx, const char *attr_name, const
 
        hcamcorder = MMF_CAMCORDER(commit_param);
 
-       if (hcamcorder->cam_attrs_const_info[attr_idx].attr_commit) {
+       if (hcamcorder->cam_attrs_const_info[attr_idx].attr_commit)
                bret = hcamcorder->cam_attrs_const_info[attr_idx].attr_commit((MMHandleType)commit_param, attr_idx, value);
-       } else {
+       else
                bret = TRUE;
-       }
 
        return bret;
 }
@@ -1751,7 +2016,7 @@ int __mmcamcorder_set_conf_to_valid_info(MMHandleType handle)
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
        if (hcamcorder == NULL) {
-               _mmcam_dbg_err("handle is NULL");
+               MMCAM_LOG_ERROR("handle is NULL");
                return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
        }
 
@@ -1786,16 +2051,16 @@ int __mmcamcorder_release_conf_valid_info(MMHandleType handle)
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
        if (hcamcorder == NULL) {
-               _mmcam_dbg_err("handle is NULL");
+               MMCAM_LOG_ERROR("handle is NULL");
                return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
        }
 
-       _mmcam_dbg_log("START");
+       MMCAM_LOG_INFO("START");
 
        /* Audio encoder info */
        allocated_memory = (int *)(hcamcorder->cam_attrs_const_info[MM_CAM_AUDIO_ENCODER].validity_value_1.int_array);
        if (allocated_memory) {
-               free(allocated_memory);
+               g_free(allocated_memory);
                hcamcorder->cam_attrs_const_info[MM_CAM_AUDIO_ENCODER].validity_value_1.int_array = NULL;
                hcamcorder->cam_attrs_const_info[MM_CAM_AUDIO_ENCODER].validity_value_2.count = 0;
        }
@@ -1803,7 +2068,7 @@ int __mmcamcorder_release_conf_valid_info(MMHandleType handle)
        /* Video encoder info */
        allocated_memory = (int *)(hcamcorder->cam_attrs_const_info[MM_CAM_VIDEO_ENCODER].validity_value_1.int_array);
        if (allocated_memory) {
-               free(allocated_memory);
+               g_free(allocated_memory);
                hcamcorder->cam_attrs_const_info[MM_CAM_VIDEO_ENCODER].validity_value_1.int_array = NULL;
                hcamcorder->cam_attrs_const_info[MM_CAM_VIDEO_ENCODER].validity_value_2.count = 0;
        }
@@ -1811,7 +2076,7 @@ int __mmcamcorder_release_conf_valid_info(MMHandleType handle)
        /* Image encoder info */
        allocated_memory = (int *)(hcamcorder->cam_attrs_const_info[MM_CAM_IMAGE_ENCODER].validity_value_1.int_array);
        if (allocated_memory) {
-               free(allocated_memory);
+               g_free(allocated_memory);
                hcamcorder->cam_attrs_const_info[MM_CAM_IMAGE_ENCODER].validity_value_1.int_array = NULL;
                hcamcorder->cam_attrs_const_info[MM_CAM_IMAGE_ENCODER].validity_value_2.count = 0;
        }
@@ -1819,26 +2084,28 @@ int __mmcamcorder_release_conf_valid_info(MMHandleType handle)
        /* File format info */
        allocated_memory = (int *)(hcamcorder->cam_attrs_const_info[MM_CAM_FILE_FORMAT].validity_value_1.int_array);
        if (allocated_memory) {
-               free(allocated_memory);
+               g_free(allocated_memory);
                hcamcorder->cam_attrs_const_info[MM_CAM_FILE_FORMAT].validity_value_1.int_array = NULL;
                hcamcorder->cam_attrs_const_info[MM_CAM_FILE_FORMAT].validity_value_2.count = 0;
        }
 
-       _mmcam_dbg_log("DONE");
+       MMCAM_LOG_INFO("DONE");
 
        return MM_ERROR_NONE;
 }
 
 
-bool _mmcamcorder_commit_capture_width (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_capture_width(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        MMHandleType attr = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
 
+       mmf_return_val_if_fail(handle && value, FALSE);
+
        attr = MMF_CAMCORDER_ATTRS(handle);
        mmf_return_val_if_fail(attr, FALSE);
 
-       /*_mmcam_dbg_log("(%d)", attr_idx);*/
+       /*MMCAM_LOG_INFO("(%d)", attr_idx);*/
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state <= MM_CAMCORDER_STATE_PREPARE) {
@@ -1859,13 +2126,13 @@ bool _mmcamcorder_commit_capture_width (MMHandleType handle, int attr_idx, const
 
                return TRUE;
        } else {
-               _mmcam_dbg_log("Capture resolution can't be set.(state=%d)", current_state);
+               MMCAM_LOG_INFO("Capture resolution can't be set.(state=%d)", current_state);
                return FALSE;
        }
 }
 
 
-bool _mmcamcorder_commit_capture_height (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_capture_height(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
 
@@ -1879,115 +2146,121 @@ bool _mmcamcorder_commit_capture_height (MMHandleType handle, int attr_idx, cons
 
                return __mmcamcorder_set_capture_resolution(handle, capture_width, capture_height);
        } else {
-               _mmcam_dbg_log("Capture resolution can't be set.(state=%d)", current_state);
+               MMCAM_LOG_INFO("Capture resolution can't be set.(state=%d)", current_state);
 
                return FALSE;
        }
 }
 
 
-bool _mmcamcorder_commit_capture_break_cont_shot (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_capture_break_cont_shot(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
-       int current_state = _mmcamcorder_get_state( handle);
-       int ivalue = value->value.i_val;
-
-       mmf_camcorder_t        *hcamcorder = MMF_CAMCORDER(handle);
+       int current_state = 0;
+       int ivalue = 0;
        _MMCamcorderSubContext *sc = NULL;
-       GstCameraControl       *control = NULL;
-       type_element           *VideosrcElement = NULL;
+       _MMCamcorderImageInfo *info = NULL;
+       GstCameraControl *control = NULL;
 
-       const char *videosrc_name = NULL;
+       mmf_return_val_if_fail(handle && value, FALSE);
 
-       _mmcamcorder_conf_get_element(handle, hcamcorder->conf_main,
-                                     CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
-                                     "VideosrcElement",
-                                     &VideosrcElement );
-       _mmcamcorder_conf_get_value_element_name(VideosrcElement, &videosrc_name);
+       current_state = _mmcamcorder_get_state(handle);
+       ivalue = value->value.i_val;
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
        if (!sc)
                return TRUE;
 
+       info = sc->info_image;
+       if (!info) {
+               MMCAM_LOG_ERROR("info image is NULL");
+               return FALSE;
+       }
+
        if (ivalue && current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               if (info->capture_send_count > 0) {
+                       info->capturing = FALSE;
+                       MMCAM_LOG_WARNING("capturing -> FALSE and skip capture callback since now");
+               }
+
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_warn("Can't cast Video source into camera control.");
+                       MMCAM_LOG_WARNING("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
                control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control) {
                        gst_camera_control_set_capture_command(control, GST_CAMERA_CONTROL_CAPTURE_COMMAND_STOP_MULTISHOT);
-                       _mmcam_dbg_warn("Commit Break continuous shot : Set command OK. current state[%d]", current_state);
+                       MMCAM_LOG_WARNING("Commit Break continuous shot : Set command OK. current state[%d]", current_state);
                } else {
-                       _mmcam_dbg_warn("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_WARNING("cast CAMERA_CONTROL failed");
                }
        } else {
-               _mmcam_dbg_warn( "Commit Break continuous shot : No effect. value[%d],current state[%d]", ivalue, current_state );
+               MMCAM_LOG_WARNING("Commit Break continuous shot : No effect. value[%d],current state[%d]", ivalue, current_state);
        }
 
        return TRUE;
 }
 
 
-bool _mmcamcorder_commit_capture_count(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_capture_count(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int mode = MM_CAMCORDER_MODE_VIDEO_CAPTURE;
        int current_state = MM_CAMCORDER_STATE_NONE;
-
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
-       mmf_return_val_if_fail(hcamcorder, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        current_state = _mmcamcorder_get_state(handle);
        mm_camcorder_get_attributes(handle, NULL, MMCAM_MODE, &mode, NULL);
 
-       _mmcam_dbg_log("current state %d, mode %d, set count %d",
-                      current_state, mode, value->value.i_val);
+       MMCAM_LOG_INFO("current state %d, mode %d, set count %d",
+               current_state, mode, value->value.i_val);
 
        if (mode != MM_CAMCORDER_MODE_AUDIO &&
            current_state != MM_CAMCORDER_STATE_CAPTURING) {
                return TRUE;
        } else {
-               _mmcam_dbg_err("Invalid mode[%d] or state[%d]", mode, current_state);
+               MMCAM_LOG_ERROR("Invalid mode[%d] or state[%d]", mode, current_state);
                return FALSE;
        }
 }
 
 
-bool _mmcamcorder_commit_capture_sound_enable(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_capture_sound_enable(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
-       mmf_return_val_if_fail(hcamcorder, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
-       _mmcam_dbg_log("shutter sound policy: %d", hcamcorder->shutter_sound_policy);
+       MMCAM_LOG_INFO("shutter sound policy: %d", hcamcorder->shutter_sound_policy);
 
        /* return error when disable shutter sound if policy is TRUE */
        if (!value->value.i_val &&
            hcamcorder->shutter_sound_policy == VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY_ON) {
-               _mmcam_dbg_err("not permitted DISABLE SHUTTER SOUND");
+               MMCAM_LOG_ERROR("not permitted DISABLE SHUTTER SOUND");
                return FALSE;
        } else {
-               _mmcam_dbg_log("set value [%d] success", value->value.i_val);
+               MMCAM_LOG_INFO("set value [%d] success", value->value.i_val);
                return TRUE;
        }
 }
 
 
-bool _mmcamcorder_commit_audio_volume (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_audio_volume(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        _MMCamcorderSubContext *sc = NULL;
        bool bret = FALSE;
 
+       mmf_return_val_if_fail(handle && value, FALSE);
+
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
-       current_state = _mmcamcorder_get_state( handle);
+       current_state = _mmcamcorder_get_state(handle);
 
-       if ((current_state == MM_CAMCORDER_STATE_RECORDING)||(current_state == MM_CAMCORDER_STATE_PAUSED)) {
+       if ((current_state == MM_CAMCORDER_STATE_RECORDING) || (current_state == MM_CAMCORDER_STATE_PAUSED)) {
                double mslNewVal = 0;
                mslNewVal = value->value.d_val;
 
@@ -2001,10 +2274,10 @@ bool _mmcamcorder_commit_audio_volume (MMHandleType handle, int attr_idx, const
                        }
                }
 
-               _mmcam_dbg_log("Commit : volume(%f)", mslNewVal);
+               MMCAM_LOG_INFO("Commit : volume(%f)", mslNewVal);
                bret = TRUE;
        } else {
-               _mmcam_dbg_log("Commit : nothing to commit. status(%d)", current_state);
+               MMCAM_LOG_INFO("Commit : nothing to commit. status(%d)", current_state);
                bret = TRUE;
        }
 
@@ -2012,81 +2285,112 @@ bool _mmcamcorder_commit_audio_volume (MMHandleType handle, int attr_idx, const
 }
 
 
-bool _mmcamcorder_commit_camera_fps (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_format(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       int current_state = MM_CAMCORDER_STATE_NONE;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state > MM_CAMCORDER_STATE_READY) {
+               MMCAM_LOG_ERROR("invalid state %d", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+
+bool _mmcamcorder_commit_camera_fps(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        MMCamAttrsInfo fps_info;
        int resolution_width = 0;
        int resolution_height = 0;
-       int i;
-       int ret;
+       int i = 0;
+       int ret = 0;
+       int current_state = MM_CAMCORDER_STATE_NONE;
 
-       _mmcam_dbg_log("FPS(%d)", value->value.i_val);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state > MM_CAMCORDER_STATE_PREPARE) {
+               MMCAM_LOG_ERROR("invalid state %d", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
+       }
+
+       if (attr_idx == MM_CAM_CAMERA_FPS_AUTO)
+               return TRUE;
+
+       MMCAM_LOG_INFO("FPS(%d)", value->value.i_val);
 
        ret = mm_camcorder_get_attributes(handle, NULL,
-                                         MMCAM_CAMERA_WIDTH, &resolution_width,
-                                         MMCAM_CAMERA_HEIGHT, &resolution_height,
-                                         NULL);
+               MMCAM_CAMERA_WIDTH, &resolution_width,
+               MMCAM_CAMERA_HEIGHT, &resolution_height,
+               NULL);
 
-       if(ret != MM_ERROR_NONE) {
-               _mmcam_dbg_err("FAILED : coult not get resolution values.");
+       if (ret != MM_ERROR_NONE) {
+               MMCAM_LOG_ERROR("FAILED : coult not get resolution values.");
                return FALSE;
        }
 
        ret = mm_camcorder_get_fps_list_by_resolution(handle, resolution_width, resolution_height, &fps_info);
        if (ret != MM_ERROR_NONE) {
-               _mmcam_dbg_err("FAILED : coult not get FPS values by resolution.");
+               MMCAM_LOG_ERROR("FAILED : coult not get FPS values by resolution.");
                return FALSE;
        }
 
        for (i = 0 ; i < fps_info.int_array.count ; i++) {
-               if(value->value.i_val == fps_info.int_array.array[i]) {
+               if (value->value.i_val == fps_info.int_array.array[i])
                        return TRUE;
-               }
        }
 
-       _mmcam_dbg_err("FAILED : %d is not supported FPS", value->value.i_val);
+       MMCAM_LOG_ERROR("FAILED : %d is not supported FPS", value->value.i_val);
+
        return FALSE;
 }
 
 
-bool _mmcamcorder_commit_camera_recording_motion_rate(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_recording_motion_rate(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        current_state = _mmcamcorder_get_state(handle);
-
        if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_warn("invalid state %d", current_state);
+               MMCAM_LOG_WARNING("invalid state %d", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
 
        /* Verify recording motion rate */
        if (value->value.d_val > 0.0) {
                sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-               if (!sc) {
+               if (!sc)
                        return TRUE;
-               }
 
                /* set is_slow flag */
-               if (value->value.d_val != _MMCAMCORDER_DEFAULT_RECORDING_MOTION_RATE) {
+               if (value->value.d_val != _MMCAMCORDER_DEFAULT_RECORDING_MOTION_RATE)
                        sc->is_modified_rate = TRUE;
-               } else {
+               else
                        sc->is_modified_rate = FALSE;
-               }
 
-               _mmcam_dbg_log("Set slow motion rate %lf", value->value.d_val);
+               MMCAM_LOG_INFO("Set slow motion rate %lf", value->value.d_val);
                return TRUE;
        } else {
-               _mmcam_dbg_warn("Failed to set recording motion rate %lf", value->value.d_val);
+               MMCAM_LOG_WARNING("Failed to set recording motion rate %lf", value->value.d_val);
                return FALSE;
        }
 }
 
 
-bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        MMHandleType attr = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
@@ -2094,22 +2398,21 @@ bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const m
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(hcamcorder, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
        attr = MMF_CAMCORDER_ATTRS(handle);
        mmf_return_val_if_fail(attr, FALSE);
 
-       _mmcam_dbg_log("Width(%d)", value->value.i_val);
+       MMCAM_LOG_INFO("Width(%d)", value->value.i_val);
 
        current_state = _mmcamcorder_get_state(handle);
 
        if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_log("Resolution can't be changed.(state=%d)", current_state);
+               MMCAM_LOG_INFO("Resolution can't be changed.(state=%d)", current_state);
                return FALSE;
        } else {
                int flags = MM_ATTRS_FLAG_NONE;
@@ -2124,26 +2427,34 @@ bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const m
                        int codec_type = MM_IMAGE_CODEC_JPEG;
 
                        mm_camcorder_get_attributes(handle, NULL,
-                                                   MMCAM_CAMERA_HEIGHT, &height,
-                                                   MMCAM_CAMERA_FORMAT, &preview_format,
-                                                   MMCAM_IMAGE_ENCODER, &codec_type,
-                                                   NULL);
+                               MMCAM_CAMERA_HEIGHT, &height,
+                               MMCAM_CAMERA_FORMAT, &preview_format,
+                               MMCAM_IMAGE_ENCODER, &codec_type,
+                               NULL);
 
                        if (current_state == MM_CAMCORDER_STATE_PREPARE) {
                                if (hcamcorder->resolution_changed == FALSE) {
-                                       _mmcam_dbg_log("no need to restart preview");
+                                       MMCAM_LOG_INFO("no need to restart preview");
                                        return TRUE;
                                }
 
                                hcamcorder->resolution_changed = FALSE;
 
-                               if (!pthread_mutex_trylock(&(hcamcorder->restart_preview_lock))) {
-                                       _mmcam_dbg_log("restart preview");
+                               if (g_mutex_trylock(&hcamcorder->restart_preview_lock)) {
+                                       MMCAM_LOG_INFO("restart preview");
 
                                        MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", TRUE);
                                        MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", TRUE);
 
-                                       _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
+                                       if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+                                               _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
+
+                                       /* check decoder recreation */
+                                       if (!_mmcamcorder_recreate_decoder_for_encoded_preview(handle)) {
+                                               MMCAM_LOG_ERROR("_mmcamcorder_recreate_decoder_for_encoded_preview failed");
+                                               g_mutex_unlock(&hcamcorder->restart_preview_lock);
+                                               return FALSE;
+                                       }
 
                                        /* get preview format */
                                        sc->info_image->preview_format = preview_format;
@@ -2153,12 +2464,13 @@ bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const m
                                        MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", FALSE);
                                        MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", FALSE);
 
-                                       _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
+                                       if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+                                               _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
 
                                        /* unlock */
-                                       pthread_mutex_unlock(&(hcamcorder->restart_preview_lock));
+                                       g_mutex_unlock(&hcamcorder->restart_preview_lock);
                                } else {
-                                       _mmcam_dbg_err("currently locked for preview restart");
+                                       MMCAM_LOG_ERROR("currently locked for preview restart");
                                        return FALSE;
                                }
                        } else {
@@ -2176,7 +2488,7 @@ bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const m
 }
 
 
-bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int ret = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
@@ -2184,21 +2496,21 @@ bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(hcamcorder, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
        attr = MMF_CAMCORDER_ATTRS(hcamcorder);
        mmf_return_val_if_fail(attr, FALSE);
 
-       _mmcam_dbg_log("Height(%d)", value->value.i_val);
+       MMCAM_LOG_INFO("Height(%d)", value->value.i_val);
        current_state = _mmcamcorder_get_state(handle);
 
        if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_log("Resolution can't be changed.(state=%d)", current_state);
+               MMCAM_LOG_INFO("Resolution can't be changed.(state=%d)", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        } else {
                int width = 0;
@@ -2208,32 +2520,40 @@ bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const
                int video_stabilization = 0;
 
                mm_camcorder_get_attributes(handle, NULL,
-                                           MMCAM_CAMERA_WIDTH, &width,
-                                           MMCAM_CAMERA_FORMAT, &preview_format,
-                                           MMCAM_IMAGE_ENCODER, &codec_type,
-                                           MMCAM_CAMERA_VIDEO_STABILIZATION, &video_stabilization,
-                                           NULL);
+                       MMCAM_CAMERA_WIDTH, &width,
+                       MMCAM_CAMERA_FORMAT, &preview_format,
+                       MMCAM_IMAGE_ENCODER, &codec_type,
+                       MMCAM_CAMERA_VIDEO_STABILIZATION, &video_stabilization,
+                       NULL);
 
                sc->info_video->preview_width = width;
                sc->info_video->preview_height = height;
 
                if (current_state == MM_CAMCORDER_STATE_PREPARE) {
                        if (hcamcorder->resolution_changed == FALSE) {
-                               _mmcam_dbg_log("no need to restart preview");
+                               MMCAM_LOG_INFO("no need to restart preview");
                                return TRUE;
                        }
 
                        hcamcorder->resolution_changed = FALSE;
 
-                       if (!pthread_mutex_trylock(&(hcamcorder->restart_preview_lock))) {
-                               _mmcam_dbg_log("restart preview");
+                       if (g_mutex_trylock(&hcamcorder->restart_preview_lock)) {
+                               MMCAM_LOG_INFO("restart preview");
 
-                               _mmcam_dbg_log("set empty buffers");
+                               MMCAM_LOG_INFO("set empty buffers");
 
                                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", TRUE);
                                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", TRUE);
 
-                               _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
+                               if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+                                       _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
+
+                               /* check decoder recreation */
+                               if (!_mmcamcorder_recreate_decoder_for_encoded_preview(handle)) {
+                                       MMCAM_LOG_ERROR("_mmcamcorder_recreate_decoder_for_encoded_preview failed");
+                                       g_mutex_unlock(&hcamcorder->restart_preview_lock);
+                                       return FALSE;
+                               }
 
                                /* get preview format */
                                sc->info_image->preview_format = preview_format;
@@ -2244,12 +2564,13 @@ bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const
                                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", FALSE);
                                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", FALSE);
 
-                               _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
+                               if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+                                       _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
 
                                /* unlock */
-                               pthread_mutex_unlock(&(hcamcorder->restart_preview_lock));
+                               g_mutex_unlock(&hcamcorder->restart_preview_lock);
                        } else {
-                               _mmcam_dbg_err("currently locked for preview restart");
+                               MMCAM_LOG_ERROR("currently locked for preview restart");
                                return FALSE;
                        }
                } else {
@@ -2264,88 +2585,289 @@ bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const
 }
 
 
-bool _mmcamcorder_commit_video_size(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_video_size(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
-       mmf_return_val_if_fail(hcamcorder, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_err("Video Resolution can't be changed.(state=%d)", current_state);
+               MMCAM_LOG_ERROR("Video Resolution can't be changed.(state=%d)", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        } else {
-               _mmcam_dbg_warn("Video Resolution %d [attr_idx %d] ",
-                               value->value.i_val, attr_idx);
+               MMCAM_LOG_WARNING("Video Resolution %d [attr_idx %d] ",
+                       value->value.i_val, attr_idx);
                return TRUE;
        }
 }
 
 
-bool _mmcamcorder_commit_camera_zoom (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_zoom(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
        int current_state = MM_CAMCORDER_STATE_NONE;
        GstCameraControl *control = NULL;
-       int zoom_level = value->value.i_val;
-       int zoom_type;
+       int zoom_level = 0;
+       int zoom_type = 0;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
-       _mmcam_dbg_log("(%d)", attr_idx);
+       zoom_level = value->value.i_val;
+
+       MMCAM_LOG_INFO("(%d)", attr_idx);
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("will be applied when preview starts");
+               MMCAM_LOG_INFO("will be applied when preview starts");
                return TRUE;
        } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
-               _mmcam_dbg_warn("Can not set while CAPTURING");
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
 
-       if (attr_idx == MM_CAM_CAMERA_OPTICAL_ZOOM) {
+       if (attr_idx == MM_CAM_CAMERA_OPTICAL_ZOOM)
                zoom_type = GST_CAMERA_CONTROL_OPTICAL_ZOOM;
-       } else {
+       else
                zoom_type = GST_CAMERA_CONTROL_DIGITAL_ZOOM;
-       }
 
        if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
                int ret = FALSE;
 
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_log("Can't cast Video source into camera control.");
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
-               control = GST_CAMERA_CONTROL (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+               control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                        return FALSE;
                }
 
                ret = gst_camera_control_set_zoom(control, zoom_type, zoom_level);
                if (ret) {
-                       _mmcam_dbg_log("Succeed in operating Zoom[%d].", zoom_level);
+                       MMCAM_LOG_INFO("Succeed in operating Zoom[%d].", zoom_level);
                        return TRUE;
                } else {
-                       _mmcam_dbg_warn("Failed to operate Zoom. Type[%d],Level[%d]", zoom_type, zoom_level);
+                       MMCAM_LOG_WARNING("Failed to operate Zoom. Type[%d],Level[%d]", zoom_type, zoom_level);
                }
        } else {
-               _mmcam_dbg_log("pointer of video src is null");
+               MMCAM_LOG_INFO("pointer of video src is null");
+       }
+
+       return FALSE;
+}
+
+
+bool _mmcamcorder_commit_camera_ptz_type(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       _MMCamcorderSubContext *sc = NULL;
+       int current_state = MM_CAMCORDER_STATE_NONE;
+
+       GstCameraControl *CameraControl = NULL;
+       GstCameraControlChannel *CameraControlChannel = NULL;
+       const GList *controls = NULL;
+       const GList *item = NULL;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       mmf_return_val_if_fail(sc, TRUE);
+
+       MMCAM_LOG_INFO("ptz type : %d", value->value.i_val);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state < MM_CAMCORDER_STATE_PREPARE ||
+           current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("invalid state[%d]", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
+       }
+
+       if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
+               if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
+                       return FALSE;
+               }
+
+               CameraControl = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+               if (CameraControl == NULL) {
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
+                       return FALSE;
+               }
+
+               controls = gst_camera_control_list_channels(CameraControl);
+               if (controls == NULL) {
+                       MMCAM_LOG_ERROR("gst_camera_control_list_channels failed");
+                       return FALSE;
+               }
+
+               for (item = controls ; item && item->data ; item = item->next) {
+                       CameraControlChannel = item->data;
+                       MMCAM_LOG_INFO("CameraControlChannel->label %s", CameraControlChannel->label);
+                       if (!strcmp(CameraControlChannel->label, "ptz_type")) {
+                               if (gst_camera_control_set_value(CameraControl, CameraControlChannel, value->value.i_val)) {
+                                       MMCAM_LOG_WARNING("set ptz type %d done", value->value.i_val);
+                                       return TRUE;
+                               } else {
+                                       MMCAM_LOG_ERROR("failed to set ptz type %d", value->value.i_val);
+                                       return FALSE;
+                               }
+                       }
+               }
+
+               MMCAM_LOG_WARNING("failed to find ptz type control channel");
+       }
+
+       return FALSE;
+}
+
+
+bool _mmcamcorder_commit_camera_pan(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       _MMCamcorderSubContext *sc = NULL;
+       int current_state = MM_CAMCORDER_STATE_NONE;
+
+       GstCameraControl *CameraControl = NULL;
+       GstCameraControlChannel *CameraControlChannel = NULL;
+       const GList *controls = NULL;
+       const GList *item = NULL;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       mmf_return_val_if_fail(sc, TRUE);
+
+       MMCAM_LOG_INFO("pan : %d", value->value.i_val);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state < MM_CAMCORDER_STATE_PREPARE ||
+           current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("invalid state[%d]", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
+       }
+
+       if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
+               if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
+                       return FALSE;
+               }
+
+               CameraControl = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+               if (CameraControl == NULL) {
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
+                       return FALSE;
+               }
+
+               controls = gst_camera_control_list_channels(CameraControl);
+               if (controls == NULL) {
+                       MMCAM_LOG_ERROR("gst_camera_control_list_channels failed");
+                       return FALSE;
+               }
+
+               for (item = controls ; item && item->data ; item = item->next) {
+                       CameraControlChannel = item->data;
+                       MMCAM_LOG_INFO("CameraControlChannel->label %s", CameraControlChannel->label);
+                       if (!strcmp(CameraControlChannel->label, "pan")) {
+                               if (gst_camera_control_set_value(CameraControl, CameraControlChannel, value->value.i_val)) {
+                                       MMCAM_LOG_WARNING("set pan %d done", value->value.i_val);
+                                       return TRUE;
+                               } else {
+                                       MMCAM_LOG_ERROR("failed to set pan %d", value->value.i_val);
+                                       return FALSE;
+                               }
+                       }
+               }
+
+               MMCAM_LOG_WARNING("failed to find pan control channel");
+       }
+
+       return FALSE;
+}
+
+
+bool _mmcamcorder_commit_camera_tilt(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       _MMCamcorderSubContext *sc = NULL;
+       int current_state = MM_CAMCORDER_STATE_NONE;
+
+       GstCameraControl *CameraControl = NULL;
+       GstCameraControlChannel *CameraControlChannel = NULL;
+       const GList *controls = NULL;
+       const GList *item = NULL;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       mmf_return_val_if_fail(sc, TRUE);
+
+       MMCAM_LOG_INFO("tilt : %d", value->value.i_val);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state < MM_CAMCORDER_STATE_PREPARE ||
+           current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("invalid state[%d]", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
+       }
+
+       if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
+               if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
+                       return FALSE;
+               }
+
+               CameraControl = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+               if (CameraControl == NULL) {
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
+                       return FALSE;
+               }
+
+               controls = gst_camera_control_list_channels(CameraControl);
+               if (controls == NULL) {
+                       MMCAM_LOG_ERROR("gst_camera_control_list_channels failed");
+                       return FALSE;
+               }
+
+               for (item = controls ; item && item->data ; item = item->next) {
+                       CameraControlChannel = item->data;
+                       MMCAM_LOG_INFO("CameraControlChannel->label %s", CameraControlChannel->label);
+                       if (!strcmp(CameraControlChannel->label, "tilt")) {
+                               if (gst_camera_control_set_value(CameraControl, CameraControlChannel, value->value.i_val)) {
+                                       MMCAM_LOG_WARNING("set tilt %d done", value->value.i_val);
+                                       return TRUE;
+                               } else {
+                                       MMCAM_LOG_ERROR("failed to set tilt %d", value->value.i_val);
+                                       return FALSE;
+                               }
+                       }
+               }
+
+               MMCAM_LOG_WARNING("failed to find tilt control channel");
        }
 
        return FALSE;
 }
 
 
-bool _mmcamcorder_commit_camera_focus_mode (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_focus_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        MMHandleType attr = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
        GstCameraControl *control = NULL;
        int mslVal;
@@ -2353,6 +2875,8 @@ bool _mmcamcorder_commit_camera_focus_mode (MMHandleType handle, int attr_idx, c
        int cur_focus_mode = 0;
        int cur_focus_range = 0;
 
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
        attr = MMF_CAMCORDER_ATTRS(handle);
        mmf_return_val_if_fail(attr, FALSE);
 
@@ -2360,18 +2884,22 @@ bool _mmcamcorder_commit_camera_focus_mode (MMHandleType handle, int attr_idx, c
        if (!sc)
                return TRUE;
 
-       _mmcam_dbg_log("Focus mode(%d)", value->value.i_val);
+       MMCAM_LOG_INFO("Focus mode(%d)", value->value.i_val);
 
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_NULL) {
-               _mmcam_dbg_log("Focus mode will be changed later.(state=%d)", current_state);
+               MMCAM_LOG_INFO("Focus mode will be changed later.(state=%d)", current_state);
                return TRUE;
+       } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
        if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
@@ -2379,18 +2907,18 @@ bool _mmcamcorder_commit_camera_focus_mode (MMHandleType handle, int attr_idx, c
                MMCamAttrsInfo info;
 
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_log("Can't cast Video source into camera control.");
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
-               control = GST_CAMERA_CONTROL (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+               control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                        return FALSE;
                }
 
                mslVal = value->value.i_val;
-               set_focus_mode = _mmcamcorder_convert_msl_to_sensor( handle, attr_idx, mslVal );
+               set_focus_mode = _mmcamcorder_convert_msl_to_sensor(handle, attr_idx, mslVal);
 
                mm_camcorder_get_attribute_info(handle, MMCAM_CAMERA_AF_SCAN_RANGE, &info);
                flags = info.flag;
@@ -2399,29 +2927,75 @@ bool _mmcamcorder_commit_camera_focus_mode (MMHandleType handle, int attr_idx, c
                        if (gst_camera_control_get_focus(control, &cur_focus_mode, &cur_focus_range)) {
                                if (set_focus_mode != cur_focus_mode) {
                                        if (gst_camera_control_set_focus(control, set_focus_mode, cur_focus_range)) {
-                                               _mmcam_dbg_log("Succeed in setting AF mode[%d]", mslVal);
+                                               MMCAM_LOG_INFO("Succeed in setting AF mode[%d]", mslVal);
                                                return TRUE;
                                        } else {
-                                               _mmcam_dbg_warn("Failed to set AF mode[%d]", mslVal);
+                                               MMCAM_LOG_WARNING("Failed to set AF mode[%d]", mslVal);
                                        }
                                } else {
-                                       _mmcam_dbg_log("No need to set AF mode. Current[%d]", mslVal);
+                                       MMCAM_LOG_INFO("No need to set AF mode. Current[%d]", mslVal);
                                        return TRUE;
                                }
                        } else {
-                               _mmcam_dbg_warn("Failed to get AF mode, so do not set new AF mode[%d]", mslVal);
+                               MMCAM_LOG_WARNING("Failed to get AF mode, so do not set new AF mode[%d]", mslVal);
                        }
                }
        } else {
-               _mmcam_dbg_log("pointer of video src is null");
+               MMCAM_LOG_INFO("pointer of video src is null");
        }
 
        return TRUE;
 }
 
 
-bool _mmcamcorder_commit_camera_af_scan_range (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_focus_level(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
+       int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       _MMCamcorderSubContext *sc = NULL;
+       GstCameraControl *control = NULL;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       if (!sc)
+               return TRUE;
+
+       MMCAM_LOG_INFO("Focus level[%d]", value->value.i_val);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state < MM_CAMCORDER_STATE_READY) {
+               MMCAM_LOG_INFO("Focus level will be set later.(state=%d)", current_state);
+               return TRUE;
+       } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
+       }
+
+       if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
+               MMCAM_LOG_ERROR("Can't cast Video source into camera control.");
+               return FALSE;
+       }
+
+       control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+       if (control == NULL) {
+               MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
+               return FALSE;
+       }
+
+       if (!gst_camera_control_set_focus_level(control, value->value.i_val)) {
+               MMCAM_LOG_ERROR("set focus level[%d[ failed", value->value.i_val);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+
+bool _mmcamcorder_commit_camera_af_scan_range(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
        GstCameraControl *control = NULL;
        int current_state = MM_CAMCORDER_STATE_NONE;
@@ -2432,15 +3006,17 @@ bool _mmcamcorder_commit_camera_af_scan_range (MMHandleType handle, int attr_idx
        int msl_mode = MM_CAMCORDER_FOCUS_MODE_NONE;
        int converted_mode = 0;
 
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
        if (!sc)
                return TRUE;
 
-       _mmcam_dbg_log("(%d)", attr_idx);
+       MMCAM_LOG_INFO("(%d)", attr_idx);
 
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
@@ -2449,50 +3025,55 @@ bool _mmcamcorder_commit_camera_af_scan_range (MMHandleType handle, int attr_idx
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_log("It doesn't need to change dynamically.(state=%d)", current_state);
+               MMCAM_LOG_INFO("It doesn't need to change dynamically.(state=%d)", current_state);
                return TRUE;
+       } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
        if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_log("Can't cast Video source into camera control.");
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
-               control = GST_CAMERA_CONTROL (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+               control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                        return FALSE;
                }
 
                mm_camcorder_get_attributes(handle, NULL, MMCAM_CAMERA_FOCUS_MODE, &msl_mode, NULL);
-               converted_mode = _mmcamcorder_convert_msl_to_sensor( handle, MM_CAM_CAMERA_FOCUS_MODE, msl_mode );
+               converted_mode = _mmcamcorder_convert_msl_to_sensor(handle, MM_CAM_CAMERA_FOCUS_MODE, msl_mode);
 
                if (gst_camera_control_get_focus(control, &cur_focus_mode, &cur_focus_range)) {
                        if ((newVal != cur_focus_range) || (converted_mode != cur_focus_mode)) {
                                if (gst_camera_control_set_focus(control, converted_mode, newVal)) {
-                                       //_mmcam_dbg_log("Succeed in setting AF mode[%d]", mslVal);
+                                       /*MMCAM_LOG_INFO("Succeed in setting AF mode[%d]", mslVal);*/
                                        return TRUE;
                                } else {
-                                       _mmcam_dbg_warn("Failed to set AF mode[%d]", mslVal);
+                                       MMCAM_LOG_WARNING("Failed to set AF mode[%d]", mslVal);
                                }
                        } else {
-                               //_mmcam_dbg_log("No need to set AF mode. Current[%d]", mslVal);
+                               /*MMCAM_LOG_INFO("No need to set AF mode. Current[%d]", mslVal);*/
                                return TRUE;
                        }
                } else {
-                       _mmcam_dbg_warn("Failed to get AF mode, so do not set new AF mode[%d]", mslVal);
+                       MMCAM_LOG_WARNING("Failed to get AF mode, so do not set new AF mode[%d]", mslVal);
                }
        } else {
-               _mmcam_dbg_log("pointer of video src is null");
+               MMCAM_LOG_INFO("pointer of video src is null");
        }
 
        return FALSE;
 }
 
 
-bool _mmcamcorder_commit_camera_af_touch_area (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_af_touch_area(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
        GstCameraControl *control = NULL;
        GstCameraControlRectType set_area = { 0, 0, 0, 0 };
@@ -2508,35 +3089,40 @@ bool _mmcamcorder_commit_camera_af_touch_area (MMHandleType handle, int attr_idx
        MMCamAttrsInfo info_w;
        MMCamAttrsInfo info_h;
 
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
-       _mmcam_dbg_log("(%d)", attr_idx);
+       MMCAM_LOG_INFO("(%d)", attr_idx);
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_log("It doesn't need to change dynamically.(state=%d)", current_state);
+               MMCAM_LOG_INFO("It doesn't need to change dynamically.(state=%d)", current_state);
                return TRUE;
+       } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
        ret = mm_camcorder_get_attributes(handle, NULL,
-                                         MMCAM_CAMERA_FOCUS_MODE, &focus_mode,
-                                         NULL);
+               MMCAM_CAMERA_FOCUS_MODE, &focus_mode,
+               NULL);
        if (ret != MM_ERROR_NONE) {
-               _mmcam_dbg_warn("Failed to get FOCUS MODE.[%x]", ret);
+               MMCAM_LOG_WARNING("Failed to get FOCUS MODE.[%x]", ret);
                return FALSE;
        }
 
        if ((focus_mode != MM_CAMCORDER_FOCUS_MODE_TOUCH_AUTO) && (focus_mode != MM_CAMCORDER_FOCUS_MODE_CONTINUOUS)) {
-               _mmcam_dbg_warn("Focus mode is NOT TOUCH AUTO or CONTINUOUS(current[%d]). return FALSE", focus_mode);
+               MMCAM_LOG_WARNING("Focus mode is NOT TOUCH AUTO or CONTINUOUS(current[%d]). return FALSE", focus_mode);
                return FALSE;
        }
 
        if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_log("Can't cast Video source into camera control.");
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
@@ -2552,13 +3138,13 @@ bool _mmcamcorder_commit_camera_af_touch_area (MMHandleType handle, int attr_idx
                        if (!((info_y.flag|info_w.flag|info_h.flag) & MM_ATTRS_FLAG_MODIFIED)) {
                                set_area.x = value->value.i_val;
                                mm_camcorder_get_attributes(handle, NULL,
-                                                           MMCAM_CAMERA_AF_TOUCH_Y, &set_area.y,
-                                                           MMCAM_CAMERA_AF_TOUCH_WIDTH, &set_area.width,
-                                                           MMCAM_CAMERA_AF_TOUCH_HEIGHT, &set_area.height,
-                                                           NULL);
+                                       MMCAM_CAMERA_AF_TOUCH_Y, &set_area.y,
+                                       MMCAM_CAMERA_AF_TOUCH_WIDTH, &set_area.width,
+                                       MMCAM_CAMERA_AF_TOUCH_HEIGHT, &set_area.height,
+                                       NULL);
                                do_set = TRUE;
                        } else {
-                               _mmcam_dbg_log("Just store AF area[x:%d]", value->value.i_val);
+                               MMCAM_LOG_INFO("Just store AF area[x:%d]", value->value.i_val);
                                return TRUE;
                        }
                        break;
@@ -2568,13 +3154,13 @@ bool _mmcamcorder_commit_camera_af_touch_area (MMHandleType handle, int attr_idx
                        if (!((info_w.flag|info_h.flag) & MM_ATTRS_FLAG_MODIFIED)) {
                                set_area.y = value->value.i_val;
                                mm_camcorder_get_attributes(handle, NULL,
-                                                           MMCAM_CAMERA_AF_TOUCH_X, &set_area.x,
-                                                           MMCAM_CAMERA_AF_TOUCH_WIDTH, &set_area.width,
-                                                           MMCAM_CAMERA_AF_TOUCH_HEIGHT, &set_area.height,
-                                                           NULL);
+                                       MMCAM_CAMERA_AF_TOUCH_X, &set_area.x,
+                                       MMCAM_CAMERA_AF_TOUCH_WIDTH, &set_area.width,
+                                       MMCAM_CAMERA_AF_TOUCH_HEIGHT, &set_area.height,
+                                       NULL);
                                do_set = TRUE;
                        } else {
-                               _mmcam_dbg_log( "Just store AF area[y:%d]", value->value.i_val );
+                               MMCAM_LOG_INFO("Just store AF area[y:%d]", value->value.i_val);
                                return TRUE;
                        }
                        break;
@@ -2583,23 +3169,23 @@ bool _mmcamcorder_commit_camera_af_touch_area (MMHandleType handle, int attr_idx
                        if (!(info_h.flag & MM_ATTRS_FLAG_MODIFIED)) {
                                set_area.width = value->value.i_val;
                                mm_camcorder_get_attributes(handle, NULL,
-                                                           MMCAM_CAMERA_AF_TOUCH_X, &set_area.x,
-                                                           MMCAM_CAMERA_AF_TOUCH_Y, &set_area.y,
-                                                           MMCAM_CAMERA_AF_TOUCH_HEIGHT, &set_area.height,
-                                                           NULL);
+                                       MMCAM_CAMERA_AF_TOUCH_X, &set_area.x,
+                                       MMCAM_CAMERA_AF_TOUCH_Y, &set_area.y,
+                                       MMCAM_CAMERA_AF_TOUCH_HEIGHT, &set_area.height,
+                                       NULL);
                                do_set = TRUE;
                        } else {
-                               _mmcam_dbg_log("Just store AF area[width:%d]", value->value.i_val);
+                               MMCAM_LOG_INFO("Just store AF area[width:%d]", value->value.i_val);
                                return TRUE;
                        }
                        break;
                case MM_CAM_CAMERA_AF_TOUCH_HEIGHT:
                        set_area.height = value->value.i_val;
                        mm_camcorder_get_attributes(handle, NULL,
-                                                   MMCAM_CAMERA_AF_TOUCH_X, &set_area.x,
-                                                   MMCAM_CAMERA_AF_TOUCH_Y, &set_area.y,
-                                                   MMCAM_CAMERA_AF_TOUCH_WIDTH, &set_area.width,
-                                                   NULL);
+                               MMCAM_CAMERA_AF_TOUCH_X, &set_area.x,
+                               MMCAM_CAMERA_AF_TOUCH_Y, &set_area.y,
+                               MMCAM_CAMERA_AF_TOUCH_WIDTH, &set_area.width,
+                               NULL);
                        do_set = TRUE;
                        break;
                default:
@@ -2610,13 +3196,13 @@ bool _mmcamcorder_commit_camera_af_touch_area (MMHandleType handle, int attr_idx
                        _MMCamcorderVideoInfo *info = sc->info_video;
 
                        if (info == NULL) {
-                               _mmcam_dbg_err("video info is NULL");
+                               MMCAM_LOG_ERROR("video info is NULL");
                                return FALSE;
                        }
 
-                       control = GST_CAMERA_CONTROL (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+                       control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                        if (control == NULL) {
-                               _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                               MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                                return FALSE;
                        }
 
@@ -2630,96 +3216,107 @@ bool _mmcamcorder_commit_camera_af_touch_area (MMHandleType handle, int attr_idx
                                        ratio_width = (float)info->video_width / (float)info->preview_width;
                                        ratio_height = (float)info->video_height / (float)info->preview_height;
 
-                                       _mmcam_dbg_log("original area %d,%d,%dx%d, resolution ratio : width %f, height %f",
-                                                      set_area.x, set_area.y, set_area.width, set_area.height, ratio_width, ratio_height);
+                                       MMCAM_LOG_INFO("original area %d,%d,%dx%d, resolution ratio : width %f, height %f",
+                                               set_area.x, set_area.y, set_area.width, set_area.height, ratio_width, ratio_height);
 
                                        set_area.x = (int)((float)set_area.x * ratio_width);
                                        set_area.y = (int)((float)set_area.y * ratio_height);
                                        set_area.width = (int)((float)set_area.width * ratio_width);
                                        set_area.height = (int)((float)set_area.height * ratio_height);
 
-                                       if (set_area.width <= 0) {
+                                       if (set_area.width <= 0)
                                                set_area.width = 1;
-                                       }
-                                       if (set_area.height <= 0) {
+
+                                       if (set_area.height <= 0)
                                                set_area.height = 1;
-                                       }
 
-                                       _mmcam_dbg_log("converted area %d,%d,%dx%d",
-                                                      set_area.x, set_area.y, set_area.width, set_area.height);
+                                       MMCAM_LOG_INFO("converted area %d,%d,%dx%d",
+                                               set_area.x, set_area.y, set_area.width, set_area.height);
                                } else {
-                                       _mmcam_dbg_warn("invalid preview size %dx%d, skip AF area converting",
-                                                       info->preview_width, info->preview_height);
+                                       MMCAM_LOG_WARNING("invalid preview size %dx%d, skip AF area converting",
+                                               info->preview_width, info->preview_height);
                                }
                        }
 
                        ret = gst_camera_control_get_auto_focus_area(control, &get_area);
                        if (!ret) {
-                               _mmcam_dbg_warn( "Failed to get AF area" );
+                               MMCAM_LOG_WARNING("Failed to get AF area");
                                return FALSE;
                        }
 
                        /* width and height are not supported now */
                        if (get_area.x == set_area.x && get_area.y == set_area.y) {
-                               _mmcam_dbg_log("No need to set AF area[x,y:%d,%d]",
-                                              get_area.x, get_area.y);
+                               MMCAM_LOG_INFO("No need to set AF area[x,y:%d,%d]",
+                                       get_area.x, get_area.y);
                                return TRUE;
                        }
 
                        ret = gst_camera_control_set_auto_focus_area(control, set_area);
                        if (ret) {
-                               _mmcam_dbg_log("Succeed to set AF area[%d,%d,%dx%d]",
-                                              set_area.x, set_area.y, set_area.width, set_area.height);
+                               MMCAM_LOG_INFO("Succeed to set AF area[%d,%d,%dx%d]",
+                                       set_area.x, set_area.y, set_area.width, set_area.height);
                                return TRUE;
                        } else {
-                               _mmcam_dbg_warn("Failed to set AF area[%d,%d,%dx%d]",
-                                               set_area.x, set_area.y, set_area.width, set_area.height);
+                               MMCAM_LOG_WARNING("Failed to set AF area[%d,%d,%dx%d]",
+                                       set_area.x, set_area.y, set_area.width, set_area.height);
                        }
                }
        } else {
-               _mmcam_dbg_log("pointer of video src is null");
+               MMCAM_LOG_INFO("pointer of video src is null");
        }
 
        return FALSE;
 }
 
 
-bool _mmcamcorder_commit_camera_capture_mode (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_capture_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        GstCameraControl *control = NULL;
-       int ivalue = value->value.i_val;
-       int mslVal1 = 0, mslVal2 = 0;
-       int newVal1 = 0, newVal2 = 0;
+       int ivalue = 0;
+       int mslVal1 = 0;
+       int mslVal2 = 0;
+       int newVal1 = 0;
+       int newVal2 = 0;
        int exposure_type = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
        int scene_mode = MM_CAMCORDER_SCENE_MODE_NORMAL;
        gboolean check_scene_mode = FALSE;
 
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
        if (!sc)
                return TRUE;
 
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
-       current_state = _mmcamcorder_get_state( handle);
+       current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
+               MMCAM_LOG_INFO("will be applied when preview starts");
                return TRUE;
+       } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
+       ivalue = value->value.i_val;
+
        if (attr_idx == MM_CAM_CAMERA_F_NUMBER) {
                exposure_type = GST_CAMERA_CONTROL_F_NUMBER;
-               mslVal1 = newVal1 = MM_CAMCORDER_GET_NUMERATOR( ivalue );
-               mslVal2 = newVal2 = MM_CAMCORDER_GET_DENOMINATOR( ivalue );
+               mslVal1 = newVal1 = MM_CAMCORDER_GET_NUMERATOR(ivalue);
+               mslVal2 = newVal2 = MM_CAMCORDER_GET_DENOMINATOR(ivalue);
        } else if (attr_idx == MM_CAM_CAMERA_SHUTTER_SPEED) {
                exposure_type = GST_CAMERA_CONTROL_SHUTTER_SPEED;
-               mslVal1 = newVal1 = MM_CAMCORDER_GET_NUMERATOR( ivalue );
-               mslVal2 = newVal2 = MM_CAMCORDER_GET_DENOMINATOR( ivalue );
+               mslVal1 = newVal1 = MM_CAMCORDER_GET_NUMERATOR(ivalue);
+               mslVal2 = newVal2 = MM_CAMCORDER_GET_DENOMINATOR(ivalue);
        } else if (attr_idx == MM_CAM_CAMERA_ISO) {
                exposure_type = GST_CAMERA_CONTROL_ISO;
                mslVal1 = ivalue;
@@ -2732,14 +3329,13 @@ bool _mmcamcorder_commit_camera_capture_mode (MMHandleType handle, int attr_idx,
                check_scene_mode = TRUE;
        } else if (attr_idx == MM_CAM_CAMERA_EXPOSURE_VALUE) {
                exposure_type = GST_CAMERA_CONTROL_EXPOSURE_VALUE;
-               mslVal1 = newVal1 = MM_CAMCORDER_GET_NUMERATOR( ivalue );
-               mslVal2 = newVal2 = MM_CAMCORDER_GET_DENOMINATOR( ivalue );
+               mslVal1 = newVal1 = ivalue;
        }
 
        if (check_scene_mode) {
                mm_camcorder_get_attributes(handle, NULL, MMCAM_FILTER_SCENE_MODE, &scene_mode, NULL);
                if (scene_mode != MM_CAMCORDER_SCENE_MODE_NORMAL) {
-                       _mmcam_dbg_warn("can not set [%d] when scene mode is NOT normal.", attr_idx);
+                       MMCAM_LOG_WARNING("can not set [%d] when scene mode is NOT normal.", attr_idx);
                        return FALSE;
                }
        }
@@ -2748,60 +3344,61 @@ bool _mmcamcorder_commit_camera_capture_mode (MMHandleType handle, int attr_idx,
                int ret = 0;
 
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_log("Can't cast Video source into camera control.");
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
-               control = GST_CAMERA_CONTROL (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+               control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                        return FALSE;
                }
 
                ret = gst_camera_control_set_exposure(control, exposure_type, newVal1, newVal2);
                if (ret) {
-                       _mmcam_dbg_log("Succeed in setting exposure. Type[%d],value1[%d],value2[%d]", exposure_type, mslVal1, mslVal2 );
+                       MMCAM_LOG_INFO("Succeed in setting exposure. Type[%d],value1[%d],value2[%d]", exposure_type, mslVal1, mslVal2);
                        return TRUE;
                } else {
-                       _mmcam_dbg_warn("Failed to set exposure. Type[%d],value1[%d],value2[%d]", exposure_type, mslVal1, mslVal2 );
+                       MMCAM_LOG_WARNING("Failed to set exposure. Type[%d],value1[%d],value2[%d]", exposure_type, mslVal1, mslVal2);
                }
        } else {
-               _mmcam_dbg_log("pointer of video src is null");
+               MMCAM_LOG_INFO("pointer of video src is null");
        }
 
        return FALSE;
 }
 
 
-bool _mmcamcorder_commit_camera_wdr (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_wdr(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        GstCameraControl *control = NULL;
        int mslVal = 0;
        int newVal = 0;
        int cur_value = 0;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
        int current_state = MM_CAMCORDER_STATE_NONE;
 
-       mmf_return_val_if_fail(handle && value, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
        /* check current state */
-       current_state = _mmcamcorder_get_state( handle);
+       current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("will be applied when preview starts");
+               MMCAM_LOG_INFO("will be applied when preview starts");
                return TRUE;
        } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
-               _mmcam_dbg_warn("Can not set while CAPTURING");
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
 
@@ -2810,55 +3407,59 @@ bool _mmcamcorder_commit_camera_wdr (MMHandleType handle, int attr_idx, const mm
 
        if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_log("Can't cast Video source into camera control.");
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
                control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                        return FALSE;
                }
 
                if (gst_camera_control_get_wdr(control, &cur_value)) {
                        if (newVal != cur_value) {
                                if (gst_camera_control_set_wdr(control, newVal)) {
-                                       _mmcam_dbg_log( "Success - set wdr[%d]", mslVal );
+                                       MMCAM_LOG_INFO("Success - set wdr[%d]", mslVal);
                                        return TRUE;
                                } else {
-                                       _mmcam_dbg_warn("Failed to set WDR. NewVal[%d],CurVal[%d]", newVal, cur_value);
+                                       MMCAM_LOG_WARNING("Failed to set WDR. NewVal[%d],CurVal[%d]", newVal, cur_value);
                                }
                        } else {
-                               _mmcam_dbg_log( "No need to set new WDR. Current[%d]", mslVal );
+                               MMCAM_LOG_INFO("No need to set new WDR. Current[%d]", mslVal);
                                return TRUE;
                        }
                } else {
-                       _mmcam_dbg_warn( "Failed to get WDR." );
+                       MMCAM_LOG_WARNING("Failed to get WDR.");
                }
        } else {
-               _mmcam_dbg_log("pointer of video src is null");
+               MMCAM_LOG_INFO("pointer of video src is null");
        }
 
        return FALSE;
 }
 
 
-bool _mmcamcorder_commit_camera_anti_handshake(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_anti_handshake(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("It doesn't need to change dynamically.(state=%d)", current_state);
+               MMCAM_LOG_INFO("It doesn't need to change dynamically.(state=%d)", current_state);
                return TRUE;
        } else if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_err("Invaild state (state %d)", current_state);
+               MMCAM_LOG_ERROR("Invalid state (state %d)", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
 
@@ -2866,16 +3467,59 @@ bool _mmcamcorder_commit_camera_anti_handshake(MMHandleType handle, int attr_idx
 }
 
 
-bool _mmcamcorder_commit_camera_video_stabilization(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_encoder_bitrate(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
+       int audio_enc = 0;
+       int bitrate = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       _MMCamcorderSubContext *sc = NULL;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       bitrate = value->value.i_val;
+
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       if (!sc || !sc->encode_element) {
+               MMCAM_LOG_INFO("will be applied later - idx %d, bitrate %d", attr_idx, bitrate);
+               return TRUE;
+       }
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state >= MM_CAMCORDER_STATE_RECORDING) {
+               MMCAM_LOG_ERROR("Can not set while RECORDING - attr idx %d", attr_idx);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
+       }
+
+       if (attr_idx == MM_CAM_AUDIO_ENCODER_BITRATE) {
+               mm_camcorder_get_attributes(handle, NULL, MMCAM_AUDIO_ENCODER, &audio_enc, NULL);
+
+               _mmcamcorder_set_encoder_bitrate(MM_CAMCORDER_ENCODER_TYPE_AUDIO, audio_enc,
+                       bitrate, sc->encode_element[_MMCAMCORDER_ENCSINK_AENC].gst);
+       } else {
+               _mmcamcorder_set_encoder_bitrate(MM_CAMCORDER_ENCODER_TYPE_VIDEO, 0,
+                       bitrate, sc->encode_element[_MMCAMCORDER_ENCSINK_VENC].gst);
+       }
+
+       return TRUE;
+}
+
+
+bool _mmcamcorder_commit_camera_video_stabilization(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("It doesn't need to change dynamically.(state=%d)", current_state);
+               MMCAM_LOG_INFO("It doesn't need to change dynamically.(state=%d)", current_state);
                return TRUE;
        } else if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_err("Invaild state (state %d)", current_state);
+               MMCAM_LOG_ERROR("Invalid state (state %d)", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
 
@@ -2883,16 +3527,20 @@ bool _mmcamcorder_commit_camera_video_stabilization(MMHandleType handle, int att
 }
 
 
-bool _mmcamcorder_commit_camera_rotate(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_rotate(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
-       _mmcam_dbg_log("rotate(%d)", value->value.i_val);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       MMCAM_LOG_INFO("rotate(%d)", value->value.i_val);
 
        current_state = _mmcamcorder_get_state(handle);
 
        if (current_state > MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_err("camera rotation setting failed.(state=%d)", current_state);
+               MMCAM_LOG_ERROR("camera rotation setting failed.(state=%d)", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        } else {
                return _mmcamcorder_set_videosrc_rotation(handle, value->value.i_val);
@@ -2900,94 +3548,95 @@ bool _mmcamcorder_commit_camera_rotate(MMHandleType handle, int attr_idx, const
 }
 
 
-bool _mmcamcorder_commit_image_encoder_quality(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_image_encoder_quality(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
 
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
+       } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
 
-       _mmcam_dbg_log("Image encoder quality(%d)", value->value.i_val);
+       MMCAM_LOG_INFO("Image encoder quality(%d)", value->value.i_val);
 
        if (current_state == MM_CAMCORDER_STATE_PREPARE) {
                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "capture-jpg-quality", value->value.i_val);
                return TRUE;
        } else {
-               _mmcam_dbg_err("invalid state %d", current_state);
+               MMCAM_LOG_ERROR("invalid state %d", current_state);
                return FALSE;
        }
 }
 
 
-bool _mmcamcorder_commit_target_filename(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_target_filename(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
-       _MMCamcorderSubContext *sc = NULL;
-       const char * filename = NULL;
-       int size = 0;
-
-       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
-               return TRUE;
-       }
+       mmf_return_val_if_fail(handle && value, FALSE);
 
        /* get string */
-       filename = mmf_value_get_string(value, &size);
-       if (filename == NULL) {
-               _mmcam_dbg_err("NULL filename");
+       if (!value->value.s_val) {
+               MMCAM_LOG_ERROR("NULL filename");
                return FALSE;
        }
 
-       if (sc->info_video) {
-               if (sc->info_video->filename) {
-                       free(sc->info_video->filename);
-                       sc->info_video->filename = NULL;
-               }
-               sc->info_video->filename = strdup(filename);
-               if (sc->info_video->filename == NULL) {
-                       _mmcam_dbg_err("failed to strdup filename [%s]", filename);
-                       return FALSE;
-               }
-       }
+       MMCAM_LOG_INFO("set filename [%s]", value->value.s_val);
 
-       if (sc->encode_element && sc->encode_element[_MMCAMCORDER_ENCSINK_SINK].gst) {
-               _mmcam_dbg_log("new file location set.[%s] filesink %p", filename, sc->encode_element[_MMCAMCORDER_ENCSINK_SINK].gst);
-               MMCAMCORDER_G_OBJECT_SET_POINTER(sc->encode_element[_MMCAMCORDER_ENCSINK_SINK].gst, "location", filename);
-               _mmcam_dbg_log("new file location set.(%s)", filename);
-       } else {
-               _mmcam_dbg_log("element is not created yet. [%s] will be set later...", filename);
+       return TRUE;
+}
+
+
+bool _mmcamcorder_commit_recording_max_limit(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state >= MM_CAMCORDER_STATE_RECORDING) {
+               MMCAM_LOG_ERROR("Can not set while RECORDING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
        return TRUE;
 }
 
 
+static int __color_channel_item_compare_func(gconstpointer data, gconstpointer user_data)
+{
+       GstColorBalanceChannel *Colorchannel = (GstColorBalanceChannel *)data;
+       MMCAM_LOG_VERBOSE("check[%s], input[%s]", Colorchannel->label, (char *)user_data);
+       return strcmp(Colorchannel->label, user_data);
+}
 
-
-bool _mmcamcorder_commit_filter (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_filter(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        GstColorBalance *balance = NULL;
        GstColorBalanceChannel *Colorchannel = NULL;
-       const GList *controls = NULL;
-       const GList *item = NULL;
+       GList *controls = NULL;
+       GList *item = NULL;
        int newVal = 0;
-       int mslNewVal = 0;
+       int mslVal = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
        const char *control_label = NULL;
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
@@ -2996,10 +3645,16 @@ bool _mmcamcorder_commit_filter (MMHandleType handle, int attr_idx, const mmf_va
        int scene_mode = MM_CAMCORDER_SCENE_MODE_NORMAL;
        gboolean check_scene_mode = FALSE;
 
-       if (hcamcorder == NULL) {
-               _mmcam_dbg_log("handle is NULL");
-               return FALSE;
-       }
+       int wb_temp_table[] = {
+               [MM_CAMCORDER_WHITE_BALANCE_DAYLIGHT] = 5200,
+               [MM_CAMCORDER_WHITE_BALANCE_CLOUDY] = 6000,
+               [MM_CAMCORDER_WHITE_BALANCE_FLUORESCENT] = 4000,
+               [MM_CAMCORDER_WHITE_BALANCE_INCANDESCENT] = 3200,
+               [MM_CAMCORDER_WHITE_BALANCE_SHADE] = 7000,
+               [MM_CAMCORDER_WHITE_BALANCE_FLASH] = 6000
+       };
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
        if (!sc)
@@ -3007,289 +3662,308 @@ bool _mmcamcorder_commit_filter (MMHandleType handle, int attr_idx, const mmf_va
 
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("will be applied when preview starts");
+               MMCAM_LOG_INFO("will be applied when preview starts");
                return TRUE;
        } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
-               _mmcam_dbg_warn("Can not set while CAPTURING");
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
 
        if (value->type != MM_ATTRS_TYPE_INT) {
-               _mmcam_dbg_warn("Mismatched value type (%d)", value->type);
+               MMCAM_LOG_WARNING("Mismatched value type (%d)", value->type);
                return FALSE;
-       } else {
-               mslNewVal = value->value.i_val;
        }
 
+       mslVal = value->value.i_val;
+
        switch (attr_idx) {
        case MM_CAM_FILTER_BRIGHTNESS:
                control_label = "brightness";
                check_scene_mode = TRUE;
                break;
-
        case MM_CAM_FILTER_CONTRAST:
                control_label = "contrast";
                break;
-
        case MM_CAM_FILTER_WB:
                control_label = "white balance";
                check_scene_mode = TRUE;
                break;
-
        case MM_CAM_FILTER_COLOR_TONE:
                control_label = "color tone";
                break;
-
        case MM_CAM_FILTER_SATURATION:
                control_label = "saturation";
                check_scene_mode = TRUE;
                break;
-
        case MM_CAM_FILTER_HUE:
                control_label = "hue";
                break;
-
        case MM_CAM_FILTER_SHARPNESS:
                control_label = "sharpness";
                check_scene_mode = TRUE;
                break;
        default:
-               _mmcam_dbg_err("unknown attribute index %d", attr_idx);
+               MMCAM_LOG_ERROR("unknown attribute index %d", attr_idx);
                return FALSE;
        }
 
        if (check_scene_mode) {
                mm_camcorder_get_attributes(handle, NULL, MMCAM_FILTER_SCENE_MODE, &scene_mode, NULL);
                if (scene_mode != MM_CAMCORDER_SCENE_MODE_NORMAL) {
-                       _mmcam_dbg_warn("can not set %s when scene mode is NOT normal.", control_label);
+                       MMCAM_LOG_WARNING("can not set %s when scene mode is NOT normal.", control_label);
                        return FALSE;
                }
        }
 
-       newVal = _mmcamcorder_convert_msl_to_sensor(handle, attr_idx, mslNewVal);
-       if (newVal == _MMCAMCORDER_SENSOR_ENUM_NONE) {
+       newVal = _mmcamcorder_convert_msl_to_sensor(handle, attr_idx, mslVal);
+       if (newVal == _MMCAMCORDER_SENSOR_ENUM_NONE)
                return FALSE;
-       }
-
-       /*_mmcam_dbg_log("label(%s): MSL(%d)->Sensor(%d)", control_label, mslNewVal, newVal);*/
 
        if (!GST_IS_COLOR_BALANCE(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-               _mmcam_dbg_log("Can't cast Video source into color balance.");
+               MMCAM_LOG_INFO("Can't cast Video source into color balance.");
                return TRUE;
        }
 
        balance = GST_COLOR_BALANCE(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
        if (balance == NULL) {
-               _mmcam_dbg_err("cast COLOR_BALANCE failed");
+               MMCAM_LOG_ERROR("cast COLOR_BALANCE failed");
                return FALSE;
        }
 
-       controls = gst_color_balance_list_channels(balance);
+       controls = (GList *)gst_color_balance_list_channels(balance);
        if (controls == NULL) {
-               _mmcam_dbg_log("There is no list of colorbalance controls");
+               MMCAM_LOG_INFO("There is no list of colorbalance controls");
                return FALSE;
        }
 
-       for (item = controls ; item && item->data ; item = item->next) {
+_CHECK_AGAIN:
+       MMCAM_LOG_DEBUG("attr[%d] label[%s]: MSL[%d] -> Sensor[%d]",
+               attr_idx, control_label, mslVal, newVal);
+
+       item = g_list_find_custom(controls, control_label, __color_channel_item_compare_func);
+       if (item) {
                Colorchannel = item->data;
-               //_mmcam_dbg_log("Getting name of CID=(%s), input CID=(%s)", Colorchannel->label, control_label);
+               gst_color_balance_set_value(balance, Colorchannel, newVal);
+               MMCAM_LOG_INFO("Set complete - %s[msl:%d,real:%d]", Colorchannel->label, mslVal, newVal);
+               return TRUE;
+       }
 
-               if (!strcmp(Colorchannel->label, control_label)) {
-                       gst_color_balance_set_value (balance, Colorchannel, newVal);
-                       _mmcam_dbg_log("Set complete - %s[msl:%d,real:%d]", Colorchannel->label, mslNewVal, newVal);
-                       break;
+       if (attr_idx == MM_CAM_FILTER_WB && !strcmp(control_label, "white balance")) {
+               if (mslVal == MM_CAMCORDER_WHITE_BALANCE_AUTOMATIC) {
+                       newVal = 1;
+                       control_label = "white_balance_temperature_auto";
+                       goto _CHECK_AGAIN;
+               } else {
+                       newVal = wb_temp_table[mslVal];
+                       control_label = "white_balance_temperature";
+                       goto _CHECK_AGAIN;
                }
        }
 
-       if (item == NULL) {
-               _mmcam_dbg_err("failed to find color channel item");
-               return FALSE;
-       }
+       MMCAM_LOG_ERROR("failed to find color channel item");
 
-       return TRUE;
+       return FALSE;
 }
 
 
-bool _mmcamcorder_commit_filter_scene_mode (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_filter_scene_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
+       int mslVal = 0;
+       int newVal = 0;
+       int current_state = MM_CAMCORDER_STATE_NONE;
        GstCameraControl *control = NULL;
-       int mslVal = value->value.i_val;
-       int newVal = _mmcamcorder_convert_msl_to_sensor( handle, MM_CAM_FILTER_SCENE_MODE, mslVal );
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
-       int current_state = MM_CAMCORDER_STATE_NONE;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
        if (!sc)
                return TRUE;
 
+       mslVal = value->value.i_val;
+       newVal = _mmcamcorder_convert_msl_to_sensor(handle, MM_CAM_FILTER_SCENE_MODE, mslVal);
+
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("It doesn't need to change dynamically.(state=%d)", current_state);
+               MMCAM_LOG_INFO("It doesn't need to change dynamically.(state=%d)", current_state);
                return TRUE;
+       } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
        if (sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
                int ret = 0;
 
                if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-                       _mmcam_dbg_log("Can't cast Video source into camera control.");
+                       MMCAM_LOG_INFO("Can't cast Video source into camera control.");
                        return TRUE;
                }
 
                control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                        return FALSE;
                }
 
                ret = gst_camera_control_set_exposure(control, GST_CAMERA_CONTROL_PROGRAM_MODE, newVal, 0);
                if (ret) {
-                       _mmcam_dbg_log("Succeed in setting program mode[%d].", mslVal);
+                       MMCAM_LOG_INFO("Succeed in setting program mode[%d].", mslVal);
 
                        if (mslVal == MM_CAMCORDER_SCENE_MODE_NORMAL) {
                                unsigned int i = 0;
                                int attr_idxs[] = {
-                                       MM_CAM_CAMERA_ISO
-                                       , MM_CAM_FILTER_BRIGHTNESS
-                                       , MM_CAM_FILTER_WB
-                                       , MM_CAM_FILTER_SATURATION
-                                       , MM_CAM_FILTER_SHARPNESS
-                                       , MM_CAM_FILTER_COLOR_TONE
-                                       MM_CAM_CAMERA_EXPOSURE_MODE
+                                       MM_CAM_CAMERA_ISO,
+                                       MM_CAM_FILTER_BRIGHTNESS,
+                                       MM_CAM_FILTER_WB,
+                                       MM_CAM_FILTER_SATURATION,
+                                       MM_CAM_FILTER_SHARPNESS,
+                                       MM_CAM_FILTER_COLOR_TONE,
+                                       MM_CAM_CAMERA_EXPOSURE_MODE
                                };
-                               mmf_attrs_t *attr = (mmf_attrs_t *)MMF_CAMCORDER_ATTRS(handle);
+                               MMHandleType attrs = MMF_CAMCORDER_ATTRS(handle);
 
                                for (i = 0 ; i < ARRAY_SIZE(attr_idxs) ; i++) {
-                                       if (__mmcamcorder_attrs_is_supported((MMHandleType)attr, attr_idxs[i])) {
-                                               mmf_attribute_set_modified(&(attr->items[attr_idxs[i]]));
-                                       }
+                                       if (_mmcamcorder_check_supported_attribute(handle, attr_idxs[i]))
+                                               mm_attrs_set_modified(attrs, attr_idxs[i]);
                                }
                        }
 
                        return TRUE;
                } else {
-                       _mmcam_dbg_log( "Failed to set program mode[%d].", mslVal );
+                       MMCAM_LOG_INFO("Failed to set program mode[%d].", mslVal);
                }
        } else {
-               _mmcam_dbg_warn("pointer of video src is null");
+               MMCAM_LOG_WARNING("pointer of video src is null");
        }
 
        return FALSE;
 }
 
 
-bool _mmcamcorder_commit_filter_flip (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_filter_flip(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
-       _mmcam_dbg_warn("Filter Flip(%d)", value->value.i_val);
+       mmf_return_val_if_fail(handle && value, FALSE);
+
+       MMCAM_LOG_WARNING("Filter Flip(%d)", value->value.i_val);
+
        return TRUE;
 }
 
 
-bool _mmcamcorder_commit_audio_input_route (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_audio_input_route(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
-       _mmcam_dbg_log("Commit : Do nothing. this attr will be removed soon.");
+       mmf_return_val_if_fail(handle && value, FALSE);
+
+       MMCAM_LOG_INFO("Commit : Do nothing. this attr will be removed soon.");
 
        return TRUE;
 }
 
 
-bool _mmcamcorder_commit_audio_disable(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_audio_disable(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        current_state = _mmcamcorder_get_state(handle);
        if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_warn("Can NOT Disable AUDIO. invalid state %d", current_state);
+               MMCAM_LOG_WARNING("Can NOT set disable[%d] AUDIO. invalid state %d",
+                       value->value.i_val, current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        } else {
-               _mmcam_dbg_log("Disable AUDIO when Recording");
+               MMCAM_LOG_INFO("Set disable[%d] AUDIO when Recording", value->value.i_val);
                return TRUE;
        }
 }
 
 
-bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        const char *videosink_name = NULL;
-       void *p_handle = NULL;
+       void *dp_handle = NULL;
+       MMCamWindowInfo *window_info = NULL;
 
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
        }
 
-       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       dp_handle = value->value.p_val;
+       if (!dp_handle) {
+               MMCAM_LOG_WARNING("Display handle is NULL");
+               return FALSE;
+       }
 
-       p_handle = value->value.p_val;
-       if (p_handle) {
-               /* get videosink name */
-               _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
-               if (videosink_name == NULL) {
-                       _mmcam_dbg_err("Please check videosink element in configuration file");
-                       return FALSE;
-               }
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
 
-               _mmcam_dbg_log("Commit : videosinkname[%s]", videosink_name);
-
-               if (!strcmp(videosink_name, "xvimagesink") ||
-                   !strcmp(videosink_name, "ximagesink")) {
-                       _mmcam_dbg_log("Commit : Set XID[%x]", *(int*)(p_handle));
-                       gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), *(int*)(p_handle));
-               } else if (!strcmp(videosink_name, "evasimagesink") ||
-                          !strcmp(videosink_name, "evaspixmapsink")) {
-                       _mmcam_dbg_log("Commit : Set evas object [%p]", p_handle);
-                       MMCAMCORDER_G_OBJECT_SET_POINTER(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "evas-object", p_handle);
-#ifdef HAVE_WAYLAND
-               } else if (!strcmp(videosink_name, "waylandsink")) {
-                       MMCamWaylandInfo *wl_info = (MMCamWaylandInfo *)p_handle;
-                       GstContext *context = NULL;
-
-                       context = gst_wayland_display_handle_context_new((struct wl_display *)wl_info->display);
-                       if (context) {
-                               gst_element_set_context(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, context);
-                       } else {
-                               _mmcam_dbg_warn("gst_wayland_display_handle_context_new failed");
-                       }
+       /* get videosink name */
+       _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
+       if (!videosink_name) {
+               MMCAM_LOG_ERROR("Please check videosink element in configuration file");
+               return FALSE;
+       }
 
-                       gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)wl_info->surface);
-                       gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst),
-                                                              wl_info->window_x,
-                                                              wl_info->window_y,
-                                                              wl_info->window_width,
-                                                              wl_info->window_height);
-#endif /* HAVE_WAYLAND */
-               } else {
-                       _mmcam_dbg_warn("Commit : Nothing to commit with this element[%s]", videosink_name);
-                       return FALSE;
-               }
+       MMCAM_LOG_INFO("Commit : videosinkname[%s]", videosink_name);
+
+       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "ximagesink")) {
+               MMCAM_LOG_INFO("Commit : Set XID[%x]", *(int *)(dp_handle));
+               gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), *(int *)(dp_handle));
+       } else if (!strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink")) {
+               MMCAM_LOG_INFO("Commit : Set evas object [%p]", dp_handle);
+               MMCAMCORDER_G_OBJECT_SET_POINTER(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "evas-object", dp_handle);
+       } else if (!strcmp(videosink_name, "tizenwlsink")) {
+               window_info = (MMCamWindowInfo *)dp_handle;
+               MMCAM_LOG_INFO("wayland global surface id : %d", window_info->surface_id);
+               gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)window_info->surface_id);
+       } else if (!strcmp(videosink_name, "directvideosink")) {
+               window_info = (MMCamWindowInfo *)dp_handle;
+               MMCAM_LOG_INFO("wayland global surface id : %d, x,y,w,h (%d,%d,%d,%d)",
+                       window_info->surface_id,
+                       window_info->rect.x,
+                       window_info->rect.y,
+                       window_info->rect.width,
+                       window_info->rect.height);
+               gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)window_info->surface_id);
+               gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst),
+                       window_info->rect.x,
+                       window_info->rect.y,
+                       window_info->rect.width,
+                       window_info->rect.height);
        } else {
-               _mmcam_dbg_warn("Display handle is NULL");
+               MMCAM_LOG_WARNING("Commit : Nothing to commit with this element[%s]", videosink_name);
                return FALSE;
        }
 
@@ -3297,7 +3971,7 @@ bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const
 }
 
 
-bool _mmcamcorder_commit_display_mode(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        const char *videosink_name = NULL;
@@ -3305,18 +3979,18 @@ bool _mmcamcorder_commit_display_mode(MMHandleType handle, int attr_idx, const m
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
        }
 
@@ -3324,74 +3998,74 @@ bool _mmcamcorder_commit_display_mode(MMHandleType handle, int attr_idx, const m
 
        _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
        if (videosink_name == NULL) {
-               _mmcam_dbg_err("Please check videosink element in configuration file");
+               MMCAM_LOG_ERROR("Please check videosink element in configuration file");
                return FALSE;
        }
 
-       _mmcam_dbg_log("Commit : videosinkname[%s]", videosink_name);
+       MMCAM_LOG_INFO("Commit : videosinkname[%s]", videosink_name);
 
-       if (!strcmp(videosink_name, "xvimagesink")) {
-               _mmcam_dbg_log("Commit : display mode [%d]", value->value.i_val);
+       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "tizenwlsink")) {
+               MMCAM_LOG_INFO("Commit : display mode [%d]", value->value.i_val);
                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "display-mode", value->value.i_val);
-               return TRUE;
        } else {
-               _mmcam_dbg_warn("Commit : This element [%s] does not support display mode", videosink_name);
-               return FALSE;
+               MMCAM_LOG_WARNING("[%s] does not support display mode, but no error", videosink_name);
        }
+
+       return TRUE;
 }
 
 
-bool _mmcamcorder_commit_display_rotation(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_rotation(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
 
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later [rotate:%d]", value->value.i_val);
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later [rotate:%d]", value->value.i_val);
                return TRUE;
        }
 
-       return _mmcamcorder_set_display_rotation(handle, value->value.i_val);
+       return _mmcamcorder_set_display_rotation(handle, value->value.i_val, _MMCAMCORDER_VIDEOSINK_SINK);
 }
 
 
-bool _mmcamcorder_commit_display_flip(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_flip(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
 
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later [flip:%d]", value->value.i_val);
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later [flip:%d]", value->value.i_val);
                return TRUE;
        }
 
-       return _mmcamcorder_set_display_flip(handle, value->value.i_val);
+       return _mmcamcorder_set_display_flip(handle, value->value.i_val, _MMCAMCORDER_VIDEOSINK_SINK);
 }
 
 
-bool _mmcamcorder_commit_display_visible(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_visible(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        const char *videosink_name = NULL;
@@ -3399,18 +4073,18 @@ bool _mmcamcorder_commit_display_visible(MMHandleType handle, int attr_idx, cons
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
        }
 
@@ -3419,23 +4093,24 @@ bool _mmcamcorder_commit_display_visible(MMHandleType handle, int attr_idx, cons
        /* Get videosink name */
        _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
        if (videosink_name == NULL) {
-               _mmcam_dbg_err("Please check videosink element in configuration file");
+               MMCAM_LOG_ERROR("Please check videosink element in configuration file");
                return FALSE;
        }
 
-       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "evasimagesink") ||
-           !strcmp(videosink_name, "evaspixmapsink")) {
+       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "tizenwlsink") ||
+               !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "evasimagesink") ||
+               !strcmp(videosink_name, "directvideosink")) {
                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "visible", value->value.i_val);
-               _mmcam_dbg_log("Set visible [%d] done.", value->value.i_val);
-               return TRUE;
+               MMCAM_LOG_INFO("Set visible [%d] done.", value->value.i_val);
        } else {
-               _mmcam_dbg_warn("videosink[%s] does not support VISIBLE.", videosink_name);
-               return FALSE;
+               MMCAM_LOG_WARNING("[%s] does not support VISIBLE, but no error", videosink_name);
        }
+
+       return TRUE;
 }
 
 
-bool _mmcamcorder_commit_display_geometry_method (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_geometry_method(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int method = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
@@ -3444,18 +4119,18 @@ bool _mmcamcorder_commit_display_geometry_method (MMHandleType handle, int attr_
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
        }
 
@@ -3464,66 +4139,58 @@ bool _mmcamcorder_commit_display_geometry_method (MMHandleType handle, int attr_
        /* Get videosink name */
        _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
        if (videosink_name == NULL) {
-               _mmcam_dbg_err("Please check videosink element in configuration file");
+               MMCAM_LOG_ERROR("Please check videosink element in configuration file");
                return FALSE;
        }
 
-       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "evasimagesink") ||
-           !strcmp(videosink_name, "evaspixmapsink")) {
+       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "tizenwlsink") ||
+           !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "evasimagesink") ||
+           !strcmp(videosink_name, "directvideosink")) {
                method = value->value.i_val;
-               MMCAMCORDER_G_OBJECT_SET( sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "display-geometry-method", method);
-               return TRUE;
+               MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "display-geometry-method", method);
        } else {
-               _mmcam_dbg_warn("videosink[%s] does not support geometry method.", videosink_name);
-               return FALSE;
+               MMCAM_LOG_WARNING("[%s] does not support geometry method, but no error", videosink_name);
        }
+
+       return TRUE;
 }
 
 
-bool _mmcamcorder_commit_display_rect(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_rect(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
-       int method = 0;
+       int ret = MM_ERROR_NONE;
        const char *videosink_name = NULL;
 
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
        }
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
 
-       /* check current method */
-       mm_camcorder_get_attributes(handle, NULL,
-                                   MMCAM_DISPLAY_GEOMETRY_METHOD, &method,
-                                   NULL);
-       if (method != MM_DISPLAY_METHOD_CUSTOM_ROI) {
-               _mmcam_dbg_log("current method[%d] is not supported rect", method);
-               return FALSE;
-       }
-
        /* Get videosink name */
        _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
        if (videosink_name == NULL) {
-               _mmcam_dbg_err("Please check videosink element in configuration file");
+               MMCAM_LOG_ERROR("Please check videosink element in configuration file");
                return FALSE;
        }
 
-       if (!strcmp(videosink_name, "xvimagesink") ||
-           !strcmp(videosink_name, "evaspixmapsink")) {
+       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "tizenwlsink") ||
+           !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "directvideosink")) {
                int rect_x = 0;
                int rect_y = 0;
                int rect_width = 0;
@@ -3532,11 +4199,11 @@ bool _mmcamcorder_commit_display_rect(MMHandleType handle, int attr_idx, const m
                MMCamAttrsInfo info;
 
                mm_camcorder_get_attributes(handle, NULL,
-                                           MMCAM_DISPLAY_RECT_X, &rect_x,
-                                           MMCAM_DISPLAY_RECT_Y, &rect_y,
-                                           MMCAM_DISPLAY_RECT_WIDTH, &rect_width,
-                                           MMCAM_DISPLAY_RECT_HEIGHT, &rect_height,
-                                           NULL);
+                       MMCAM_DISPLAY_RECT_X, &rect_x,
+                       MMCAM_DISPLAY_RECT_Y, &rect_y,
+                       MMCAM_DISPLAY_RECT_WIDTH, &rect_width,
+                       MMCAM_DISPLAY_RECT_HEIGHT, &rect_height,
+                       NULL);
                switch (attr_idx) {
                case MM_CAM_DISPLAY_RECT_X:
                        mm_camcorder_get_attribute_info(handle, MMCAM_DISPLAY_RECT_Y, &info);
@@ -3569,30 +4236,38 @@ bool _mmcamcorder_commit_display_rect(MMHandleType handle, int attr_idx, const m
                        rect_height = value->value.i_val;
                        break;
                default:
-                       _mmcam_dbg_err("Wrong attr_idx!");
+                       MMCAM_LOG_ERROR("Wrong attr_idx!");
                        return FALSE;
                }
 
                if (!(flags & MM_ATTRS_FLAG_MODIFIED)) {
-                       _mmcam_dbg_log("RECT(x,y,w,h) = (%d,%d,%d,%d)",
-                                      rect_x, rect_y, rect_width, rect_height);
-                       g_object_set(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst,
-                                    "dst-roi-x", rect_x,
-                                    "dst-roi-y", rect_y,
-                                    "dst-roi-w", rect_width,
-                                    "dst-roi-h", rect_height,
-                                    NULL);
-               }
+                       MMCAM_LOG_INFO("RECT(x,y,w,h) = (%d,%d,%d,%d)", rect_x, rect_y, rect_width, rect_height);
 
-               return TRUE;
+                       if (!strcmp(videosink_name, "tizenwlsink")) {
+                           ret = gst_video_overlay_set_display_roi_area(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst),
+                                       rect_x, rect_y, rect_width, rect_height);
+                               if (!ret) {
+                                       MMCAM_LOG_ERROR("FAILED : could not set display roi area.");
+                                       return FALSE;
+                               }
+                       } else {
+                           g_object_set(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst,
+                                       "dst-roi-x", rect_x,
+                                       "dst-roi-y", rect_y,
+                                       "dst-roi-w", rect_width,
+                                       "dst-roi-h", rect_height,
+                                       NULL);
+                       }
+               }
        } else {
-               _mmcam_dbg_warn("videosink[%s] does not support display rect.", videosink_name);
-               return FALSE;
+               MMCAM_LOG_WARNING("[%s] does not support display rect, but no error", videosink_name);
        }
+
+       return TRUE;
 }
 
 
-bool _mmcamcorder_commit_display_scale(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_scale(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int zoom = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
@@ -3602,18 +4277,18 @@ bool _mmcamcorder_commit_display_scale(MMHandleType handle, int attr_idx, const
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
        }
 
@@ -3622,46 +4297,46 @@ bool _mmcamcorder_commit_display_scale(MMHandleType handle, int attr_idx, const
        /* Get videosink name */
        _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
        if (videosink_name == NULL) {
-               _mmcam_dbg_err("Please check videosink element in configuration file");
+               MMCAM_LOG_ERROR("Please check videosink element in configuration file");
                return FALSE;
        }
 
        zoom = value->value.i_val;
-       if (!strcmp(videosink_name, "xvimagesink")) {
+       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "tizenwlsink")) {
                vs_element = sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst;
 
                MMCAMCORDER_G_OBJECT_SET(vs_element, "zoom", (float)(zoom + 1));
-               _mmcam_dbg_log("Set display zoom to %d", zoom + 1);
+               MMCAM_LOG_INFO("Set display zoom to %d", zoom + 1);
 
                return TRUE;
        } else {
-               _mmcam_dbg_warn("videosink[%s] does not support scale", videosink_name);
+               MMCAM_LOG_WARNING("videosink[%s] does not support scale", videosink_name);
                return FALSE;
        }
 }
 
 
-bool _mmcamcorder_commit_display_evas_do_scaling(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_display_evas_do_scaling(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        int do_scaling = 0;
        const char *videosink_name = NULL;
 
-       mmf_camcorder_t *hcamcorder= MMF_CAMCORDER( handle);
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       mmf_return_val_if_fail(handle, FALSE);
+       mmf_return_val_if_fail(handle && value, FALSE);
 
        /* check type */
        if (hcamcorder->type == MM_CAMCORDER_MODE_AUDIO) {
-               _mmcam_dbg_err("invalid mode %d", hcamcorder->type);
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
        /* check current state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("NOT initialized. this will be applied later");
+               MMCAM_LOG_INFO("NOT initialized. this will be applied later");
                return TRUE;
        }
 
@@ -3672,88 +4347,68 @@ bool _mmcamcorder_commit_display_evas_do_scaling(MMHandleType handle, int attr_i
        /* Get videosink name */
        _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
        if (videosink_name == NULL) {
-               _mmcam_dbg_err("Please check videosink element in configuration file");
+               MMCAM_LOG_ERROR("Please check videosink element in configuration file");
                return FALSE;
        }
 
        if (!strcmp(videosink_name, "evaspixmapsink")) {
                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "origin-size", !do_scaling);
-               _mmcam_dbg_log("Set origin-size to %d", !(value->value.i_val));
+               MMCAM_LOG_INFO("Set origin-size to %d", !(value->value.i_val));
                return TRUE;
        } else {
-               _mmcam_dbg_warn("videosink[%s] does not support scale", videosink_name);
+               MMCAM_LOG_WARNING("videosink[%s] does not support scale", videosink_name);
                return FALSE;
        }
 }
 
 
-bool _mmcamcorder_commit_strobe (MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_strobe(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
-       bool bret = FALSE;
        _MMCamcorderSubContext *sc = NULL;
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        int strobe_type, mslVal, newVal, cur_value;
        int current_state = MM_CAMCORDER_STATE_NONE;
-       int set_flash_state = -1;
 
-       if (hcamcorder == NULL) {
-               _mmcam_dbg_err("NULL handle");
-               return FALSE;
-       }
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
        if (!sc)
                return TRUE;
 
-       /*_mmcam_dbg_log( "Commit : strobe attribute(%d)", attr_idx );*/
+       /*MMCAM_LOG_INFO( "Commit : strobe attribute(%d)", attr_idx );*/
 
        mslVal = value->value.i_val;
 
        /* check flash state */
        if (attr_idx == MM_CAM_STROBE_MODE) {
-               int flash_brightness = 0;
+               int led_brightness = 0;
 
-               /* get current flash brightness */
-               if (_mmcamcorder_get_device_flash_brightness(&flash_brightness) != MM_ERROR_NONE) {
-                       _mmcam_dbg_err("_mmcamcorder_get_device_flash_brightness failed");
+               if (_mmcamcorder_get_device_led_brightness(hcamcorder->gdbus_conn, &led_brightness) != MM_ERROR_NONE) {
+                       MMCAM_LOG_ERROR("_mmcamcorder_get_device_led_brightness failed");
                        hcamcorder->error_code = MM_ERROR_COMMON_INVALID_PERMISSION;
                        return FALSE;
                }
 
-               _mmcam_dbg_log("flash brightness %d", flash_brightness);
+               MMCAM_LOG_INFO("LED brightness[%d] from deviced", led_brightness);
 
-               if (flash_brightness > 0 &&
+               if (led_brightness > 0 &&
                    mslVal != MM_CAMCORDER_STROBE_MODE_OFF) {
-                       /* other module already turned on flash */
+                       /* other module already turned on LED */
                        hcamcorder->error_code = MM_ERROR_CAMCORDER_DEVICE_BUSY;
-                       _mmcam_dbg_err("other module already turned on flash. avoid to set flash mode here.");
+                       MMCAM_LOG_ERROR("other module already turned on LED. avoid to set strobe mode here.");
                        return FALSE;
-               } else {
-                       /* flash is OFF state, this case will set flash state key */
-                       if (mslVal == MM_CAMCORDER_STROBE_MODE_OFF) {
-                               set_flash_state = VCONFKEY_CAMERA_FLASH_STATE_OFF;
-                       } else {
-                               set_flash_state = VCONFKEY_CAMERA_FLASH_STATE_ON;
-                       }
-
-                       _mmcam_dbg_log("keep going, and will set flash state key %d", set_flash_state);
                }
+
+               MMCAM_LOG_INFO("keep going");
        }
 
        /* check state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("It doesn't need to change dynamically.(state=%d)", current_state);
-
-               if (set_flash_state != -1) {
-                       _mmcam_dbg_log("set VCONFKEY_CAMERA_FLASH_STATE : %d", set_flash_state);
-                       vconf_set_int(VCONFKEY_CAMERA_FLASH_STATE, set_flash_state);
-                       vconf_set_int(VCONFKEY_CAMERA_PID, (int)getpid());
-               }
-
+               MMCAM_LOG_INFO("It doesn't need to change dynamically.(state=%d)", current_state);
                return TRUE;
        } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
-               _mmcam_dbg_warn("invalid state[capturing]");
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
                hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
@@ -3770,111 +4425,106 @@ bool _mmcamcorder_commit_strobe (MMHandleType handle, int attr_idx, const mmf_va
        case MM_CAM_STROBE_MODE:
                /* check whether set or not */
                if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-                       _mmcam_dbg_log("skip set value %d", mslVal);
+                       MMCAM_LOG_INFO("skip set value %d", mslVal);
                        return TRUE;
                }
 
                strobe_type = GST_CAMERA_CONTROL_STROBE_MODE;
                newVal = _mmcamcorder_convert_msl_to_sensor(handle, MM_CAM_STROBE_MODE, mslVal);
                break;
+       case MM_CAM_STROBE_BRIGHTNESS:
+               strobe_type = GST_CAMERA_CONTROL_STROBE_BRIGHTNESS;
+               newVal = mslVal;
+               break;
        default:
-               _mmcam_dbg_err("Commit : strobe attribute(attr_idx(%d) is out of range)", attr_idx);
+               MMCAM_LOG_ERROR("invalid attribute[%d]", attr_idx);
                return FALSE;
        }
 
        GstCameraControl *control = NULL;
        if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-               _mmcam_dbg_err("Can't cast Video source into camera control.");
-               bret = FALSE;
-       } else {
-               control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
-               if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
-                       return FALSE;
-               }
+               MMCAM_LOG_ERROR("Can't cast Video source into camera control.");
+               return FALSE;
+       }
 
-               if (gst_camera_control_get_strobe(control, strobe_type, &cur_value)) {
-                       if (newVal != cur_value) {
-                               if (gst_camera_control_set_strobe(control, strobe_type, newVal)) {
-                                       _mmcam_dbg_log("Succeed in setting strobe. Type[%d],value[%d]", strobe_type, mslVal);
-                                       bret = TRUE;
-                               } else {
-                                       _mmcam_dbg_warn("Set strobe failed. Type[%d],value[%d]", strobe_type, mslVal);
-                                       bret = FALSE;
-                               }
-                       } else {
-                               _mmcam_dbg_log("No need to set strobe. Type[%d],value[%d]", strobe_type, mslVal);
-                               bret = TRUE;
-                       }
-               } else {
-                       _mmcam_dbg_warn("Failed to get strobe. Type[%d]", strobe_type);
-                       bret = FALSE;
-               }
+       control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+       if (control == NULL) {
+               MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
+               return FALSE;
+       }
+
+       if (!gst_camera_control_get_strobe(control, strobe_type, &cur_value)) {
+               MMCAM_LOG_WARNING("Failed to get strobe. Type[%d]", strobe_type);
+               return FALSE;
        }
 
-       if (bret == TRUE && set_flash_state != -1) {
-               _mmcam_dbg_log("set VCONFKEY_CAMERA_FLASH_STATE : %d", set_flash_state);
-               vconf_set_int(VCONFKEY_CAMERA_FLASH_STATE, set_flash_state);
-               vconf_set_int(VCONFKEY_CAMERA_PID, (int)getpid());
+       if (newVal == cur_value) {
+               MMCAM_LOG_INFO("No need to set strobe. Type[%d],value[%d]", strobe_type, mslVal);
+               return TRUE;
        }
 
-       return bret;
+       if (!gst_camera_control_set_strobe(control, strobe_type, newVal)) {
+               MMCAM_LOG_WARNING("Set strobe failed. Type[%d],value[%d]", strobe_type, mslVal);
+               return FALSE;
+       }
+
+       MMCAM_LOG_INFO("Succeed in setting strobe. Type[%d],value[%d]", strobe_type, mslVal);
+
+       return TRUE;
 }
 
 
-bool _mmcamcorder_commit_camera_flip(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_flip(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int ret = 0;
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
 
-       if ((void *)handle == NULL) {
-               _mmcam_dbg_warn("handle is NULL");
-               return FALSE;
-       }
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
-       _mmcam_dbg_log("Commit : flip %d", value->value.i_val);
+       MMCAM_LOG_INFO("Commit : flip %d", value->value.i_val);
 
        /* state check */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state > MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_err("Can not set camera FLIP horizontal at state %d", current_state);
+               MMCAM_LOG_ERROR("Can not set camera FLIP horizontal at state %d", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        } else if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("Pipeline is not created yet. This will be set when create pipeline.");
+               MMCAM_LOG_INFO("Pipeline is not created yet. This will be set when create pipeline.");
                return TRUE;
        }
 
        ret = _mmcamcorder_set_videosrc_flip(handle, value->value.i_val);
 
-       _mmcam_dbg_log("ret %d", ret);
+       MMCAM_LOG_INFO("ret %d", ret);
 
        return ret;
 }
 
 
-bool _mmcamcorder_commit_camera_hdr_capture(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_camera_hdr_capture(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int set_hdr_mode = MM_CAMCORDER_HDR_OFF;
        int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
 
-       if ((void *)handle == NULL) {
-               _mmcam_dbg_warn("handle is NULL");
-               return FALSE;
-       }
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
 
-       /*_mmcam_dbg_log("Commit : HDR Capture %d", value->value.i_val);*/
+       /*MMCAM_LOG_INFO("Commit : HDR Capture %d", value->value.i_val);*/
 
        /* check whether set or not */
        if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-               _mmcam_dbg_log("skip set value %d", value->value.i_val);
+               MMCAM_LOG_INFO("skip set value %d", value->value.i_val);
                return TRUE;
        }
 
        /* state check */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state > MM_CAMCORDER_STATE_PREPARE) {
-               _mmcam_dbg_err("can NOT set HDR capture at state %d", current_state);
+               MMCAM_LOG_ERROR("can NOT set HDR capture at state %d", current_state);
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
                return FALSE;
        }
 
@@ -3883,11 +4533,11 @@ bool _mmcamcorder_commit_camera_hdr_capture(MMHandleType handle, int attr_idx, c
 
                set_hdr_mode = value->value.i_val;
                mm_camcorder_get_attributes(handle, NULL,
-                                           MMCAM_CAMERA_HDR_CAPTURE, &current_value,
-                                           NULL);
+                       MMCAM_CAMERA_HDR_CAPTURE, &current_value,
+                       NULL);
 
                if (set_hdr_mode == current_value) {
-                       _mmcam_dbg_log("same HDR value : %d, do nothing", set_hdr_mode);
+                       MMCAM_LOG_INFO("same HDR value : %d, do nothing", set_hdr_mode);
                        return TRUE;
                }
 
@@ -3899,6 +4549,12 @@ bool _mmcamcorder_commit_camera_hdr_capture(MMHandleType handle, int attr_idx, c
 
                                _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
 
+                               /* check decoder recreation */
+                               if (!_mmcamcorder_recreate_decoder_for_encoded_preview(handle)) {
+                                       MMCAM_LOG_ERROR("_mmcamcorder_recreate_decoder_for_encoded_preview failed");
+                                       return FALSE;
+                               }
+
                                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", FALSE);
                                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", FALSE);
                        }
@@ -3906,13 +4562,12 @@ bool _mmcamcorder_commit_camera_hdr_capture(MMHandleType handle, int attr_idx, c
                        set_hdr_mode = value->value.i_val;
                        MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "hdr-capture", set_hdr_mode);
                        sc->info_image->hdr_capture_mode = set_hdr_mode;
-                       _mmcam_dbg_log("set HDR mode : %d", set_hdr_mode);
+                       MMCAM_LOG_INFO("set HDR mode : %d", set_hdr_mode);
 
-                       if (current_state == MM_CAMCORDER_STATE_PREPARE) {
+                       if (current_state == MM_CAMCORDER_STATE_PREPARE)
                                _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
-                       }
                } else {
-                       _mmcam_dbg_err("sc is NULL. can not set HDR capture");
+                       MMCAM_LOG_ERROR("sc is NULL. can not set HDR capture");
                        return FALSE;
                }
        }
@@ -3921,7 +4576,7 @@ bool _mmcamcorder_commit_camera_hdr_capture(MMHandleType handle, int attr_idx, c
 }
 
 
-bool _mmcamcorder_commit_detect(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_detect(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        bool bret = FALSE;
        _MMCamcorderSubContext *sc = NULL;
@@ -3931,22 +4586,18 @@ bool _mmcamcorder_commit_detect(MMHandleType handle, int attr_idx, const mmf_val
        int current_state = MM_CAMCORDER_STATE_NONE;
        GstCameraControl *control = NULL;
 
-       if ((void *)handle == NULL) {
-               _mmcam_dbg_warn("handle is NULL");
-               return FALSE;
-       }
+       mmf_return_val_if_fail(handle && value, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
-       /*_mmcam_dbg_log("Commit : detect attribute(%d)", attr_idx);*/
+       /*MMCAM_LOG_INFO("Commit : detect attribute(%d)", attr_idx);*/
 
        /* state check */
-       current_state = _mmcamcorder_get_state( handle);
+       current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("will be applied when preview starts");
+               MMCAM_LOG_INFO("will be applied when preview starts");
                return TRUE;
        }
 
@@ -3956,7 +4607,7 @@ bool _mmcamcorder_commit_detect(MMHandleType handle, int attr_idx, const mmf_val
        case MM_CAM_DETECT_MODE:
                /* check whether set or not */
                if (!_mmcamcorder_check_supported_attribute(handle, attr_idx)) {
-                       _mmcam_dbg_log("skip set value %d", set_value);
+                       MMCAM_LOG_INFO("skip set value %d", set_value);
                        return TRUE;
                }
 
@@ -3975,37 +4626,37 @@ bool _mmcamcorder_commit_detect(MMHandleType handle, int attr_idx, const mmf_val
                detect_type = GST_CAMERA_CONTROL_FACE_DETECT_STATUS;
                break;
        default:
-               _mmcam_dbg_err("Commit : strobe attribute(attr_idx(%d) is out of range)", attr_idx);
+               MMCAM_LOG_ERROR("Commit : strobe attribute(attr_idx(%d) is out of range)", attr_idx);
                return FALSE;
        }
 
        if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
-               _mmcam_dbg_err("Can't cast Video source into camera control.");
+               MMCAM_LOG_ERROR("Can't cast Video source into camera control.");
                bret = FALSE;
        } else {
                control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
                if (control == NULL) {
-                       _mmcam_dbg_err("cast CAMERA_CONTROL failed");
+                       MMCAM_LOG_ERROR("cast CAMERA_CONTROL failed");
                        return FALSE;
                }
 
                if (gst_camera_control_get_detect(control, detect_type, &current_value)) {
                        if (current_value == set_value) {
-                               _mmcam_dbg_log("No need to set detect(same). Type[%d],value[%d]", detect_type, set_value);
+                               MMCAM_LOG_INFO("No need to set detect(same). Type[%d],value[%d]", detect_type, set_value);
                                bret = TRUE;
                        } else {
                                if (!gst_camera_control_set_detect(control, detect_type, set_value)) {
-                                       _mmcam_dbg_warn("Set detect failed. Type[%d],value[%d]",
-                                                       detect_type, set_value);
+                                       MMCAM_LOG_WARNING("Set detect failed. Type[%d],value[%d]",
+                                               detect_type, set_value);
                                        bret = FALSE;
                                } else {
-                                       _mmcam_dbg_log("Set detect success. Type[%d],value[%d]",
-                                                      detect_type, set_value);
+                                       MMCAM_LOG_INFO("Set detect success. Type[%d],value[%d]",
+                                               detect_type, set_value);
                                        bret = TRUE;
                                }
                        }
                } else {
-                       _mmcam_dbg_warn("Get detect failed. Type[%d]", detect_type);
+                       MMCAM_LOG_WARNING("Get detect failed. Type[%d]", detect_type);
                        bret = FALSE;
                }
        }
@@ -4014,29 +4665,18 @@ bool _mmcamcorder_commit_detect(MMHandleType handle, int attr_idx, const mmf_val
 }
 
 
-bool _mmcamcorder_commit_encoded_preview_bitrate(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_encoded_preview_bitrate(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
-       int preview_format = MM_PIXEL_FORMAT_NV12;
-
-       if ((void *)handle == NULL) {
-               _mmcam_dbg_warn("handle is NULL");
-               return FALSE;
-       }
 
-       _mmcam_dbg_log("Commit : encoded preview bitrate - %d", value->value.i_val);
+       mmf_return_val_if_fail(handle && value, FALSE);
 
-       /* check preview format */
-       mm_camcorder_get_attributes(handle, NULL, MMCAM_CAMERA_FORMAT, &preview_format, NULL);
-       if (preview_format != MM_PIXEL_FORMAT_ENCODED_H264) {
-               _mmcam_dbg_err("current preview format[%d] is not encoded format", preview_format);
-               return FALSE;
-       }
+       MMCAM_LOG_INFO("Commit : encoded preview bitrate - %d", value->value.i_val);
 
        /* check state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("will be applied when preview starts");
+               MMCAM_LOG_INFO("will be applied when preview starts");
                return TRUE;
        }
 
@@ -4044,29 +4684,26 @@ bool _mmcamcorder_commit_encoded_preview_bitrate(MMHandleType handle, int attr_i
 }
 
 
-bool _mmcamcorder_commit_encoded_preview_gop_interval(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_encoded_preview_gop_interval(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        int preview_format = MM_PIXEL_FORMAT_NV12;
 
-       if ((void *)handle == NULL) {
-               _mmcam_dbg_warn("handle is NULL");
-               return FALSE;
-       }
+       mmf_return_val_if_fail(handle && value, FALSE);
 
-       _mmcam_dbg_log("Commit : encoded preview I-frame interval - %d", value->value.i_val);
+       MMCAM_LOG_INFO("Commit : encoded preview I-frame interval - %d", value->value.i_val);
 
        /* check preview format */
        mm_camcorder_get_attributes(handle, NULL, MMCAM_CAMERA_FORMAT, &preview_format, NULL);
-       if (preview_format != MM_PIXEL_FORMAT_ENCODED_H264) {
-               _mmcam_dbg_err("current preview format[%d] is not encoded format", preview_format);
+       if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format)) {
+               MMCAM_LOG_ERROR("current preview format[%d] is not encoded format", preview_format);
                return FALSE;
        }
 
        /* check state */
        current_state = _mmcamcorder_get_state(handle);
        if (current_state < MM_CAMCORDER_STATE_READY) {
-               _mmcam_dbg_log("will be applied when preview starts");
+               MMCAM_LOG_INFO("will be applied when preview starts");
                return TRUE;
        }
 
@@ -4074,241 +4711,312 @@ bool _mmcamcorder_commit_encoded_preview_gop_interval(MMHandleType handle, int a
 }
 
 
-bool _mmcamcorder_commit_pid_for_sound_focus(MMHandleType handle, int attr_idx, const mmf_value_t *value)
+bool _mmcamcorder_commit_sound_stream_info(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
-       int new_pid = 0;
-       int current_state = MM_CAMCORDER_STATE_NONE;
-       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       int stream_index = 0;
+       char *stream_type = NULL;
+       _MMCamcorderSubContext *sc = NULL;
 
-       if (hcamcorder == NULL) {
-               _mmcam_dbg_warn("handle is NULL");
+       mmf_return_val_if_fail(handle && value, FALSE);
+
+       stream_type = value->value.s_val;
+       if (!stream_type) {
+               MMCAM_LOG_ERROR("NULL string");
                return FALSE;
        }
 
-       /* state check */
-       current_state = _mmcamcorder_get_state( handle);
-       if (current_state > MM_CAMCORDER_STATE_NULL) {
-               _mmcam_dbg_log("invalid state %d", current_state);
+       mm_camcorder_get_attributes(handle, NULL,
+               MMCAM_SOUND_STREAM_INDEX, &stream_index,
+               NULL);
+       if (stream_index < 0) {
+               MMCAM_LOG_ERROR("invalid stream index %d", stream_index);
                return FALSE;
        }
 
-       new_pid = value->value.i_val;
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       if (!sc || !sc->encode_element ||
+           !sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst) {
+               MMCAM_LOG_WARNING("audiosrc element is not initialized, it will be set later");
+               return TRUE;
+       }
 
-       _mmcam_dbg_log("Commit : pid %d, current sound_focus_register %d, sound_focus_id %d",
-                      new_pid, hcamcorder->sound_focus_register, hcamcorder->sound_focus_id);
+       MMCAM_LOG_WARNING("Commit : sound stream info - type %s, index %d", stream_type, stream_index);
 
-       /* unregister sound focus before set new one */
-       if (hcamcorder->sound_focus_register && hcamcorder->sound_focus_id > 0) {
-               if (MM_ERROR_NONE != mm_sound_unregister_focus(hcamcorder->sound_focus_id)) {
-                       _mmcam_dbg_err("mm_sound_unregister_focus[id %d] failed", hcamcorder->sound_focus_id);
-               } else {
-                       _mmcam_dbg_log("mm_sound_unregister_focus[id %d] done", hcamcorder->sound_focus_id);
-               }
-       } else {
-               _mmcam_dbg_log("no need to unregister sound focus");
+       return _mmcamcorder_set_sound_stream_info(sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst, stream_type, stream_index);
+}
+
+
+bool _mmcamcorder_commit_tag(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       int current_state = MM_CAMCORDER_STATE_NONE;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state == MM_CAMCORDER_STATE_CAPTURING) {
+               MMCAM_LOG_ERROR("Can not set while CAPTURING");
+               hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+               return FALSE;
        }
 
-       /* register sound focus */
-       if (hcamcorder->sound_focus_register) {
-               hcamcorder->sound_focus_id = 0;
-               if (MM_ERROR_NONE != mm_sound_focus_get_id(&hcamcorder->sound_focus_id)) {
-                       _mmcam_dbg_err("mm_sound_focus_get_uniq failed");
-                       hcamcorder->error_code = MM_ERROR_POLICY_BLOCKED;
+       return TRUE;
+}
+
+bool _mmcamcorder_commit_audio_replay_gain(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       if (attr_idx == MM_CAM_AUDIO_REPLAY_GAIN_ENABLE) {
+               /* Replay gain enable */
+               int current_state = MM_CAMCORDER_STATE_NONE;
+               int audio_disable = FALSE;
+
+               current_state = _mmcamcorder_get_state(handle);
+               if (current_state >= MM_CAMCORDER_STATE_RECORDING) {
+                       MMCAM_LOG_ERROR("Can not set replay gain enable [state : %d]", current_state);
+                       hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_STATE;
+                       return FALSE;
+               }
+
+               mm_camcorder_get_attributes(handle, NULL,
+                       MMCAM_AUDIO_DISABLE, &audio_disable,
+                       NULL);
+
+               if (audio_disable) {
+                       MMCAM_LOG_ERROR("audio is disabled");
+                       hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_CONDITION;
                        return FALSE;
                }
 
-               if (MM_ERROR_NONE != mm_sound_register_focus_for_session(hcamcorder->sound_focus_id,
-                                                                        new_pid,
-                                                                        "media",
-                                                                        _mmcamcorder_sound_focus_cb,
-                                                                        hcamcorder)) {
-                       _mmcam_dbg_err("mm_sound_register_focus failed");
-                       hcamcorder->error_code = MM_ERROR_POLICY_BLOCKED;
+               MMCAM_LOG_INFO("set replay gain enable : %d", value->value.i_val);
+       } else if (attr_idx == MM_CAM_AUDIO_REPLAY_GAIN_REFERENCE_LEVEL) {
+               /* Replay gain reference level */
+               int replay_gain_enable = FALSE;
+
+               mm_camcorder_get_attributes(handle, NULL,
+                       MMCAM_AUDIO_REPLAY_GAIN_ENABLE, &replay_gain_enable,
+                       NULL);
+
+               if (replay_gain_enable == FALSE) {
+                       MMCAM_LOG_ERROR("replay gain is disabled");
+                       hcamcorder->error_code = MM_ERROR_CAMCORDER_INVALID_CONDITION;
                        return FALSE;
                }
 
-               _mmcam_dbg_log("mm_sound_register_focus done - id %d, session type %d, flags 0x%x",
-                              hcamcorder->sound_focus_id, hcamcorder->session_type, hcamcorder->session_flags);
+               MMCAM_LOG_INFO("set reference level for replay gain : %lf dB", value->value.d_val);
        } else {
-               _mmcam_dbg_log("no need to register sound focus");
+               MMCAM_LOG_ERROR("unknown attribute id %d", attr_idx);
+               return FALSE;
        }
 
        return TRUE;
 }
 
 
-static bool
-__mmcamcorder_attrs_is_supported(MMHandleType handle, int idx)
+bool _mmcamcorder_commit_extra_preview(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
 {
-       mmf_attrs_t *attr = (mmf_attrs_t*)handle;
-       int flag;
+       int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       _MMCamcorderSubContext *sc = NULL;
 
-       if (mm_attrs_get_flags(handle, idx, &flag) == MM_ERROR_NONE) {
-               if (flag == MM_ATTRS_FLAG_NONE) {
-                       return FALSE;
-               }
-       } else {
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       if (hcamcorder->type != MM_CAMCORDER_MODE_VIDEO_CAPTURE) {
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
                return FALSE;
        }
 
-       if (attr->items[idx].value_spec.type == MM_ATTRS_VALID_TYPE_INT_RANGE) {
-               int min, max;
-               mm_attrs_get_valid_range((MMHandleType)attr, idx, &min, &max);
-               if (max < min) {
-                       return FALSE;
-               }
-       } else if (attr->items[idx].value_spec.type == MM_ATTRS_VALID_TYPE_INT_ARRAY) {
-               int count;
-               int *array;
-               mm_attrs_get_valid_array((MMHandleType)attr, idx, &count, &array);
-               if (count == 0) {
-                       return FALSE;
-               }
+       MMCAM_LOG_INFO("Enable extra preview(%d)", value->value.i_val);
+
+       hcamcorder->extra_preview.is_enabled = (gboolean)value->value.i_val;
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state < MM_CAMCORDER_STATE_READY) {
+               MMCAM_LOG_INFO("will be set when preview is started");
+               return TRUE;
        }
 
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       mmf_return_val_if_fail(sc, FALSE);
+
+       MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "extra-preview", value->value.i_val);
+
+       MMCAM_LOG_INFO("done");
+
        return TRUE;
 }
 
 
-bool
-_mmcamcorder_set_attribute_to_camsensor(MMHandleType handle)
+bool _mmcamcorder_commit_request_codec_config(MMHandleType handle, int attr_idx, const MMAttrsValue *value)
+{
+       int ret = MM_ERROR_NONE;
+       int current_state = MM_CAMCORDER_STATE_NONE;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       _MMCamcorderSubContext *sc = NULL;
+
+       mmf_return_val_if_fail(hcamcorder && value, FALSE);
+
+       if (hcamcorder->type != MM_CAMCORDER_MODE_VIDEO_CAPTURE) {
+               MMCAM_LOG_ERROR("invalid mode %d", hcamcorder->type);
+               return FALSE;
+       }
+
+       MMCAM_LOG_INFO("Request codec config");
+
+       current_state = _mmcamcorder_get_state(handle);
+       if (current_state < MM_CAMCORDER_STATE_READY) {
+               MMCAM_LOG_INFO("invalid state[%d]", current_state);
+               return FALSE;
+       }
+
+       sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+       mmf_return_val_if_fail(sc, FALSE);
+
+       ret = _mmcamcorder_request_codec_config(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
+       if (ret != MM_ERROR_NONE) {
+               hcamcorder->error_code = ret;
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+
+bool _mmcamcorder_set_attribute_to_camsensor(MMHandleType handle)
 {
-       mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
-       mmf_attrs_t *attr = NULL;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       MMHandleType attrs;
 
        int scene_mode = MM_CAMCORDER_SCENE_MODE_NORMAL;
 
-       unsigned int i = 0 ;
+       unsigned int i = 0;
        int ret = TRUE;
        int attr_idxs_default[] = {
-               MM_CAM_CAMERA_DIGITAL_ZOOM
-               , MM_CAM_CAMERA_OPTICAL_ZOOM
-               , MM_CAM_CAMERA_WDR
-               , MM_CAM_FILTER_CONTRAST
-               , MM_CAM_FILTER_HUE
-               , MM_CAM_STROBE_MODE
-               , MM_CAM_DETECT_MODE
+               MM_CAM_CAMERA_DIGITAL_ZOOM,
+               MM_CAM_CAMERA_OPTICAL_ZOOM,
+               MM_CAM_CAMERA_WDR,
+               MM_CAM_FILTER_CONTRAST,
+               MM_CAM_FILTER_HUE,
+               MM_CAM_DETECT_MODE,
+               MM_CAM_STROBE_BRIGHTNESS
        };
 
        int attr_idxs_extra[] = {
-               MM_CAM_CAMERA_ISO
-               , MM_CAM_FILTER_BRIGHTNESS
-               , MM_CAM_FILTER_WB
-               , MM_CAM_FILTER_SATURATION
-               , MM_CAM_FILTER_SHARPNESS
-               , MM_CAM_FILTER_COLOR_TONE
-               MM_CAM_CAMERA_EXPOSURE_MODE
+               MM_CAM_CAMERA_ISO,
+               MM_CAM_FILTER_BRIGHTNESS,
+               MM_CAM_FILTER_WB,
+               MM_CAM_FILTER_SATURATION,
+               MM_CAM_FILTER_SHARPNESS,
+               MM_CAM_FILTER_COLOR_TONE,
+               MM_CAM_CAMERA_EXPOSURE_MODE
        };
 
        mmf_return_val_if_fail(hcamcorder, FALSE);
 
-       _mmcam_dbg_log("Set all attribute again.");
+       MMCAM_LOG_INFO("commit some attributes again");
 
-       attr = (mmf_attrs_t *)MMF_CAMCORDER_ATTRS(handle);
-       if (attr == NULL) {
-               _mmcam_dbg_err("Get attribute handle failed.");
+       attrs = MMF_CAMCORDER_ATTRS(handle);
+       if (attrs == NULL) {
+               MMCAM_LOG_ERROR("Get attribute handle failed.");
                return FALSE;
-       } else {
-               /* Get Scene mode */
-               mm_camcorder_get_attributes(handle, NULL, MMCAM_FILTER_SCENE_MODE, &scene_mode, NULL);
-
-               _mmcam_dbg_log("attribute count(%d)", attr->count);
+       }
 
-               for (i = 0 ; i < ARRAY_SIZE(attr_idxs_default) ; i++) {
-                       if (__mmcamcorder_attrs_is_supported((MMHandleType)attr, attr_idxs_default[i])) {
-                               mmf_attribute_set_modified(&(attr->items[attr_idxs_default[i]]));
-                       }
-               }
+       /* Get Scene mode */
+       mm_camcorder_get_attributes(handle, NULL, MMCAM_FILTER_SCENE_MODE, &scene_mode, NULL);
 
-               /* Set extra if scene mode is NORMAL */
-               if (scene_mode == MM_CAMCORDER_SCENE_MODE_NORMAL) {
-                       for (i = 0 ; i < ARRAY_SIZE(attr_idxs_extra) ; i++) {
-                               if (__mmcamcorder_attrs_is_supported((MMHandleType)attr, attr_idxs_extra[i])) {
-                                       mmf_attribute_set_modified(&(attr->items[attr_idxs_extra[i]]));
-                               }
-                       }
-               } else {
-                       /* Set scene mode if scene mode is NOT NORMAL */
-                       if (__mmcamcorder_attrs_is_supported((MMHandleType)attr, MM_CAM_FILTER_SCENE_MODE)) {
-                               mmf_attribute_set_modified(&(attr->items[MM_CAM_FILTER_SCENE_MODE]));
-                       }
-               }
+       for (i = 0 ; i < ARRAY_SIZE(attr_idxs_default) ; i++) {
+               if (_mmcamcorder_check_supported_attribute(handle, attr_idxs_default[i]))
+                       mm_attrs_set_modified(attrs, attr_idxs_default[i]);
+       }
 
-               if (mmf_attrs_commit((MMHandleType)attr) == -1) {
-                       ret = FALSE;
-               } else {
-                       ret = TRUE;
+       /* Set extra if scene mode is NORMAL */
+       if (scene_mode == MM_CAMCORDER_SCENE_MODE_NORMAL) {
+               for (i = 0 ; i < ARRAY_SIZE(attr_idxs_extra) ; i++) {
+                       if (_mmcamcorder_check_supported_attribute(handle, attr_idxs_extra[i]))
+                               mm_attrs_set_modified(attrs, attr_idxs_extra[i]);
                }
+       } else {
+               /* Set scene mode if scene mode is NOT NORMAL */
+               if (_mmcamcorder_check_supported_attribute(handle, MM_CAM_FILTER_SCENE_MODE))
+                       mm_attrs_set_modified(attrs, MM_CAM_FILTER_SCENE_MODE);
        }
 
-       _mmcam_dbg_log("Done.");
+       if (mm_attrs_commit_all(attrs) == -1)
+               ret = FALSE;
+       else
+               ret = TRUE;
+
+       MMCAM_LOG_INFO("Done.");
 
        return ret;
 }
 
 
-int _mmcamcorder_lock_readonly_attributes(MMHandleType handle)
+bool _mmcamcorder_set_attribute_to_camsensor2(MMHandleType handle)
 {
-       mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
-       int table_size = 0;
-       int i = 0;
-       mmf_attrs_t *attr = NULL;
-       int nerror = MM_ERROR_NONE ;
-
-       mmf_return_val_if_fail(hcamcorder, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       MMHandleType attrs;
+       unsigned int i = 0;
+       int ret = TRUE;
+       int attr_idxs[] = {
+               MM_CAM_STROBE_MODE,
+               MM_CAM_CAMERA_PTZ_TYPE,
+               MM_CAM_CAMERA_PAN_MECHA,
+               MM_CAM_CAMERA_PAN_ELEC,
+               MM_CAM_CAMERA_TILT_MECHA,
+               MM_CAM_CAMERA_TILT_ELEC
+       };
 
-       attr = (mmf_attrs_t*) MMF_CAMCORDER_ATTRS(handle);
-       mmf_return_val_if_fail(attr, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
+       mmf_return_val_if_fail(hcamcorder, FALSE);
 
-       _mmcam_dbg_log("");
+       MMCAM_LOG_INFO("commit some attribute again[2]");
 
-       table_size = ARRAY_SIZE(readonly_attributes);
-       _mmcam_dbg_log("%d", table_size);
-       for (i = 0; i < table_size; i++)
-       {
-               int sCategory = readonly_attributes[i];
+       attrs = MMF_CAMCORDER_ATTRS(handle);
+       if (attrs == NULL) {
+               MMCAM_LOG_ERROR("Get attribute handle failed.");
+               return FALSE;
+       }
 
-               mmf_attribute_set_readonly(&(attr->items[sCategory]));
+       for (i = 0 ; i < ARRAY_SIZE(attr_idxs) ; i++) {
+               if (_mmcamcorder_check_supported_attribute(handle, attr_idxs[i]))
+                       mm_attrs_set_modified(attrs, attr_idxs[i]);
        }
 
-       return nerror;
+       if (mm_attrs_commit_all(attrs) == -1)
+               ret = FALSE;
+       else
+               ret = TRUE;
+
+       MMCAM_LOG_INFO("Done.");
+
+       return ret;
 }
 
 
-int _mmcamcorder_set_disabled_attributes(MMHandleType handle)
+int _mmcamcorder_lock_readonly_attributes(MMHandleType handle)
 {
-       mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
-       //int table_size = 0;
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+       MMHandleType attrs;
+       int table_size = 0;
        int i = 0;
-       mmf_attrs_t *attr = NULL;
-       type_string_array * disabled_attr = NULL;
-       int cnt_str = 0;
-       int nerror = MM_ERROR_NONE ;
+       int nerror = MM_ERROR_NONE;
 
        mmf_return_val_if_fail(hcamcorder, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
 
-       attr = (mmf_attrs_t*) MMF_CAMCORDER_ATTRS(handle);
-       mmf_return_val_if_fail(attr, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
-
-       _mmcam_dbg_log("");
-
-       /* add gst_param */
-       _mmcamcorder_conf_get_value_string_array(hcamcorder->conf_main,
-                                                CONFIGURE_CATEGORY_MAIN_GENERAL,
-                                                "DisabledAttributes",
-                                                &disabled_attr);
-       if (disabled_attr != NULL && disabled_attr->value) {
-               cnt_str = disabled_attr->count;
-               for (i = 0; i < cnt_str; i++) {
-                       int idx = 0;
-                       _mmcam_dbg_log("[%d]%s", i, disabled_attr->value[i] );
-                       nerror = mm_attrs_get_index((MMHandleType)attr, disabled_attr->value[i], &idx);
-                       if (nerror == MM_ERROR_NONE) {
-                               mmf_attribute_set_disabled(&(attr->items[idx]));
-                       } else {
-                               _mmcam_dbg_warn("No ATTR named %s[%d]",disabled_attr->value[i], i);
-                       }
-               }
+       attrs = MMF_CAMCORDER_ATTRS(handle);
+       mmf_return_val_if_fail(attrs, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
+
+       MMCAM_LOG_INFO("");
+
+       table_size = ARRAY_SIZE(readonly_attributes);
+       MMCAM_LOG_INFO("%d", table_size);
+       for (i = 0; i < table_size; i++) {
+               int sCategory = readonly_attributes[i];
+
+               mm_attrs_set_readonly(attrs, sCategory);
        }
 
        return nerror;
@@ -4327,23 +5035,22 @@ static bool __mmcamcorder_set_capture_resolution(MMHandleType handle, int width,
        mmf_return_val_if_fail(hcamcorder, FALSE);
 
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
-       if (!sc) {
+       if (!sc)
                return TRUE;
-       }
 
        current_state = _mmcamcorder_get_state(handle);
 
        if (sc->element && sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst) {
                if (current_state <= MM_CAMCORDER_STATE_PREPARE) {
-                       _mmcam_dbg_log("set capture width and height [%dx%d] to camera plugin", width, height);
+                       MMCAM_LOG_INFO("set capture width and height [%dx%d] to camera plugin", width, height);
                        MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "capture-width", width);
                        MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "capture-height", height);
                } else {
-                       _mmcam_dbg_warn("invalid state[%d]", current_state);
+                       MMCAM_LOG_WARNING("invalid state[%d]", current_state);
                        return FALSE;
                }
        } else {
-               _mmcam_dbg_log("element is not created yet");
+               MMCAM_LOG_INFO("element is not created yet");
        }
 
        return TRUE;
@@ -4375,16 +5082,15 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
        };
 
        if (hcamcorder == NULL || attribute_name == NULL) {
-               _mmcam_dbg_warn("handle[%p] or attribute_name[%p] is NULL.",
-                               hcamcorder, attribute_name );
+               MMCAM_LOG_WARNING("handle[%p] or attribute_name[%p] is NULL.",
+                       hcamcorder, attribute_name);
                return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
        }
 
-       if (err_attr_name) {
+       if (err_attr_name)
                *err_attr_name = NULL;
-       }
 
-       //_mmcam_dbg_log( "ENTER" );
+       /*MMCAM_LOG_INFO( "ENTER" );*/
 
        attrs = MMF_CAMCORDER_ATTRS(handle);
 
@@ -4394,25 +5100,22 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
                int idx = -1;
                MMAttrsType attr_type = MM_ATTRS_TYPE_INVALID;
 
-               /*_mmcam_dbg_log("NAME : %s", name);*/
+               /*MMCAM_LOG_INFO("NAME : %s", name);*/
 
                /* attribute name check */
                if ((ret = mm_attrs_get_index(attrs, name, &idx)) != MM_ERROR_NONE) {
-                       if (err_attr_name) {
+                       if (err_attr_name)
                                *err_attr_name = strdup(name);
-                       }
 
-                       if (ret == (int)MM_ERROR_COMMON_OUT_OF_ARRAY) { //to avoid confusing
+                       if (ret == (int)MM_ERROR_COMMON_OUT_OF_ARRAY)
                                return MM_ERROR_COMMON_ATTR_NOT_EXIST;
-                       } else {
+                       else
                                return ret;
-                       }
                }
 
                /* type check */
-               if ((ret = mm_attrs_get_type(attrs, idx, &attr_type)) != MM_ERROR_NONE) {
+               if ((ret = mm_attrs_get_type(attrs, idx, &attr_type)) != MM_ERROR_NONE)
                        return ret;
-               }
 
                switch (attr_type) {
                case MM_ATTRS_TYPE_INT:
@@ -4422,18 +5125,16 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
                                for (j = 0 ; j < 2 ; j++) {
                                        if (!strcmp(name, check_pair_name[i][j])) {
                                                check_pair_value[i][j] = va_arg((var_args), int);
-                                               _mmcam_dbg_log("%s : %d", check_pair_name[i][j], check_pair_value[i][j]);
+                                               MMCAM_LOG_INFO("%s : %d", check_pair_name[i][j], check_pair_value[i][j]);
                                                matched = TRUE;
                                                break;
                                        }
                                }
-                               if (matched) {
+                               if (matched)
                                        break;
-                               }
                        }
-                       if (matched == FALSE) {
+                       if (matched == FALSE)
                                va_arg((var_args), int);
-                       }
                        break;
                }
                case MM_ATTRS_TYPE_DOUBLE:
@@ -4449,10 +5150,10 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
                        break;
                case MM_ATTRS_TYPE_INVALID:
                default:
-                       _mmcam_dbg_err("Not supported attribute type(%d, name:%s)", attr_type, name);
-                       if (err_attr_name) {
+                       MMCAM_LOG_ERROR("Not supported attribute type(%d, name:%s)", attr_type, name);
+                       if (err_attr_name)
                                *err_attr_name = strdup(name);
-                       }
+
                        return  MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
                }
 
@@ -4481,23 +5182,23 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
 
                        check_result = FALSE;
 
-                       for( j = 0 ; j < attr_info_0.int_array.count ; j++ ) {
+                       for (j = 0 ; j < attr_info_0.int_array.count ; j++) {
                                if (attr_info_0.int_array.array[j] == check_pair_value[i][0] &&
                                    attr_info_1.int_array.array[j] == check_pair_value[i][1]) {
                                        /*
-                                       _mmcam_dbg_log("Valid Pair[%s,%s] existed %dx%d[index:%d]",
-                                                      check_pair_name[i][0], check_pair_name[i][1],
-                                                      check_pair_value[i][0], check_pair_value[i][1], i);
-                                                                  */
+                                       MMCAM_LOG_INFO("Valid Pair[%s,%s] existed %dx%d[index:%d]",
+                                               check_pair_name[i][0], check_pair_name[i][1],
+                                               check_pair_value[i][0], check_pair_value[i][1], i);
+                                       */
                                        check_result = TRUE;
                                        break;
                                }
                        }
 
                        if (check_result == FALSE) {
-                               _mmcam_dbg_err("INVALID pair[%s,%s] %dx%d",
-                                              check_pair_name[i][0], check_pair_name[i][1],
-                                              check_pair_value[i][0], check_pair_value[i][1]);
+                               MMCAM_LOG_ERROR("INVALID pair[%s,%s] %dx%d",
+                                       check_pair_name[i][0], check_pair_name[i][1],
+                                       check_pair_value[i][0], check_pair_value[i][1]);
                                if (err_attr_name) {
                                        *err_attr_name = err_name;
                                } else {
@@ -4515,9 +5216,9 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
                                int current_height = 0;
 
                                mm_camcorder_get_attributes(handle, NULL,
-                                                           MMCAM_CAMERA_WIDTH, &current_width,
-                                                           MMCAM_CAMERA_HEIGHT, &current_height,
-                                                           NULL);
+                                       MMCAM_CAMERA_WIDTH, &current_width,
+                                       MMCAM_CAMERA_HEIGHT, &current_height,
+                                       NULL);
 
                                if (current_width != check_pair_value[i][0] ||
                                    current_height != check_pair_value[i][1]) {
@@ -4526,7 +5227,7 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
                                        hcamcorder->resolution_changed = FALSE;
                                }
 
-                               _mmcam_dbg_log("resolution changed : %d", hcamcorder->resolution_changed);
+                               MMCAM_LOG_INFO("resolution changed : %d", hcamcorder->resolution_changed);
                        }
 
                        if (err_name) {
@@ -4536,7 +5237,7 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n
                }
        }
 
-       /*_mmcam_dbg_log("DONE");*/
+       /*MMCAM_LOG_INFO("DONE");*/
 
        return MM_ERROR_NONE;
 }
@@ -4547,7 +5248,7 @@ bool _mmcamcorder_check_supported_attribute(MMHandleType handle, int attr_index)
        MMAttrsInfo info;
 
        if ((void *)handle == NULL) {
-               _mmcam_dbg_warn("handle %p is NULL", handle);
+               MMCAM_LOG_WARNING("handle %p is NULL", handle);
                return FALSE;
        }
 
@@ -4558,38 +5259,34 @@ bool _mmcamcorder_check_supported_attribute(MMHandleType handle, int attr_index)
        switch (info.validity_type) {
        case MM_ATTRS_VALID_TYPE_INT_ARRAY:
                /*
-               _mmcam_dbg_log("int array count %d", info.int_array.count);
+               MMCAM_LOG_INFO("int array count %d", info.int_array.count);
                */
-               if (info.int_array.count <= 1) {
+               if (info.int_array.count < 1)
                        return FALSE;
-               }
                break;
        case MM_ATTRS_VALID_TYPE_INT_RANGE:
                /*
-               _mmcam_dbg_log("int range min %d, max %d",info.int_range.min, info.int_range.max);
+               MMCAM_LOG_INFO("int range min %d, max %d",info.int_range.min, info.int_range.max);
                */
-               if (info.int_range.min >= info.int_range.max) {
+               if (info.int_range.min > info.int_range.max)
                        return FALSE;
-               }
                break;
        case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
                /*
-               _mmcam_dbg_log("double array count %d", info.double_array.count);
+               MMCAM_LOG_INFO("double array count %d", info.double_array.count);
                */
-               if (info.double_array.count <= 1) {
+               if (info.double_array.count < 1)
                        return FALSE;
-               }
                break;
        case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
                /*
-               _mmcam_dbg_log("double range min %lf, max %lf",info.int_range.min, info.int_range.max);
+               MMCAM_LOG_INFO("double range min %lf, max %lf",info.int_range.min, info.int_range.max);
                */
-               if (info.double_range.min >= info.double_range.max) {
+               if (info.double_range.min >= info.double_range.max)
                        return FALSE;
-               }
                break;
        default:
-               _mmcam_dbg_warn("invalid type %d", info.validity_type);
+               MMCAM_LOG_WARNING("invalid type %d", info.validity_type);
                return FALSE;
        }