Remove unused parameter
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_internal.c
index b4b31b2..8f8ded8 100644 (file)
@@ -54,6 +54,7 @@
 #define __MMCAMCORDER_FORCE_STOP_WAIT_TIME      100000  /* us */
 #define __MMCAMCORDER_SOUND_WAIT_TIMEOUT        3
 #define __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN   64
+#define __MMCAMCORDER_CONF_FILENAME_LENGTH      32
 
 #define DPM_ALLOWED                             1
 #define DPM_DISALLOWED                          0
@@ -71,7 +72,6 @@ static gint     __mmcamcorder_gst_handle_library_error(MMHandleType handle, int
 static gint     __mmcamcorder_gst_handle_core_error(MMHandleType handle, int code, GstMessage *message);
 static gint     __mmcamcorder_gst_handle_resource_warning(MMHandleType handle, GstMessage *message , GError *error);
 static gboolean __mmcamcorder_handle_gst_warning(MMHandleType handle, GstMessage *message, GError *error);
-static int      __mmcamcorder_simulate_asm_conflict_table(int session_type, int pid);
 
 #ifdef _MMCAMCORDER_MM_RM_SUPPORT
 static int      __mmcamcorder_resource_release_cb(mm_resource_manager_h rm,
@@ -98,7 +98,6 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
 {
        int ret = MM_ERROR_NONE;
        int sys_info_ret = SYSTEM_INFO_ERROR_NONE;
-       int UseConfCtrl = 0;
        int rcmd_fmt_capture = MM_PIXEL_FORMAT_YUYV;
        int rcmd_fmt_recording = MM_PIXEL_FORMAT_NV12;
        int rcmd_dpy_rotation = MM_DISPLAY_ROTATION_270;
@@ -107,7 +106,6 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
        int camera_default_flip = MM_FLIP_NONE;
        int camera_facing_direction = MM_CAMCORDER_CAMERA_FACING_DIRECTION_REAR;
        char *err_attr_name = NULL;
-       const char *ConfCtrlFile = NULL;
        mmf_camcorder_t *hcamcorder = NULL;
        type_element *EvasSurfaceElement = NULL;
 
@@ -127,13 +125,12 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
        hcamcorder->sub_context = NULL;
        hcamcorder->old_state = MM_CAMCORDER_STATE_NONE;
        hcamcorder->capture_in_recording = FALSE;
-       hcamcorder->session_type = MM_SESSION_TYPE_MEDIA;
 
        g_mutex_init(&(hcamcorder->mtsafe).lock);
        g_cond_init(&(hcamcorder->mtsafe).cond);
        g_mutex_init(&(hcamcorder->mtsafe).cmd_lock);
        g_cond_init(&(hcamcorder->mtsafe).cmd_cond);
-       g_mutex_init(&(hcamcorder->mtsafe).asm_lock);
+       g_mutex_init(&(hcamcorder->mtsafe).interrupt_lock);
        g_mutex_init(&(hcamcorder->mtsafe).state_lock);
        g_mutex_init(&(hcamcorder->mtsafe).gst_state_lock);
        g_mutex_init(&(hcamcorder->mtsafe).gst_encode_state_lock);
@@ -197,7 +194,7 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
                goto _ERR_DEFAULT_VALUE_INIT;
        }
 
-       hcamcorder->attributes = _mmcamcorder_alloc_attribute((MMHandleType)hcamcorder, info);
+       hcamcorder->attributes = _mmcamcorder_alloc_attribute((MMHandleType)hcamcorder);
        if (!(hcamcorder->attributes)) {
                _mmcam_dbg_err("_mmcamcorder_create::alloc attribute error.");
 
@@ -211,180 +208,158 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
        _mmcam_dbg_warn("DPM handle %p", hcamcorder->dpm_handle);
 
        if (info->videodev_type != MM_VIDEO_DEVICE_NONE) {
+               char conf_file_name[__MMCAMCORDER_CONF_FILENAME_LENGTH] = {'\0',};
+               int resolution_width = 0;
+               int resolution_height = 0;
+               MMCamAttrsInfo fps_info;
+
+               snprintf(conf_file_name, sizeof(conf_file_name), "%s%d.ini",
+                       CONFIGURE_CTRL_FILE_PREFIX, info->videodev_type);
+
+               _mmcam_dbg_log("Load control configure file [%d][%s]", info->videodev_type, conf_file_name);
+
+               ret = _mmcamcorder_conf_get_info((MMHandleType)hcamcorder,
+                       CONFIGURE_TYPE_CTRL, (const char *)conf_file_name, &hcamcorder->conf_ctrl);
+               if (ret != MM_ERROR_NONE) {
+                       _mmcam_dbg_err("Failed to get configure(control) info.");
+                       goto _ERR_DEFAULT_VALUE_INIT;
+               }
+/*
+               _mmcamcorder_conf_print_info(&hcamcorder->conf_main);
+               _mmcamcorder_conf_print_info(&hcamcorder->conf_ctrl);
+*/
+               ret = _mmcamcorder_init_convert_table((MMHandleType)hcamcorder);
+               if (ret != MM_ERROR_NONE) {
+                       _mmcam_dbg_warn("converting table initialize error!!");
+                       ret = MM_ERROR_CAMCORDER_INTERNAL;
+                       goto _ERR_DEFAULT_VALUE_INIT;
+               }
+
+               ret = _mmcamcorder_init_attr_from_configure((MMHandleType)hcamcorder, MM_CAMCONVERT_CATEGORY_ALL);
+               if (ret != MM_ERROR_NONE) {
+                       _mmcam_dbg_warn("attribute initialize from configure error!!");
+                       ret = MM_ERROR_CAMCORDER_INTERNAL;
+                       goto _ERR_DEFAULT_VALUE_INIT;
+               }
+
+               /* Get device info, recommend preview fmt and display rotation from INI */
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
+                       CONFIGURE_CATEGORY_CTRL_CAMERA,
+                       "RecommendPreviewFormatCapture",
+                       &rcmd_fmt_capture);
+
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
+                       CONFIGURE_CATEGORY_CTRL_CAMERA,
+                       "RecommendPreviewFormatRecord",
+                       &rcmd_fmt_recording);
+
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
+                       CONFIGURE_CATEGORY_CTRL_CAMERA,
+                       "RecommendDisplayRotation",
+                       &rcmd_dpy_rotation);
+
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
+                       CONFIGURE_CATEGORY_MAIN_CAPTURE,
+                       "PlayCaptureSound",
+                       &play_capture_sound);
+
                _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
                        CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
-                       "UseConfCtrl", &UseConfCtrl);
+                       "DeviceCount",
+                       &camera_device_count);
 
-               if (UseConfCtrl) {
-                       int resolution_width = 0;
-                       int resolution_height = 0;
-                       MMCamAttrsInfo fps_info;
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
+                       CONFIGURE_CATEGORY_CTRL_CAMERA,
+                       "FacingDirection",
+                       &camera_facing_direction);
 
-                       _mmcam_dbg_log("Enable Configure Control system.");
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
+                       CONFIGURE_CATEGORY_CTRL_EFFECT,
+                       "BrightnessStepDenominator",
+                       &hcamcorder->brightness_step_denominator);
 
-                       switch (info->videodev_type) {
-                       case MM_VIDEO_DEVICE_CAMERA0:
-                               _mmcamcorder_conf_get_value_string((MMHandleType)hcamcorder, hcamcorder->conf_main,
-                                       CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
-                                       "ConfCtrlFile0", &ConfCtrlFile);
-                               break;
-                       case MM_VIDEO_DEVICE_CAMERA1:
-                               _mmcamcorder_conf_get_value_string((MMHandleType)hcamcorder, hcamcorder->conf_main,
-                                       CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
-                                       "ConfCtrlFile1", &ConfCtrlFile);
-                               break;
-                       default:
-                               _mmcam_dbg_err("Not supported camera type.");
-                               ret = MM_ERROR_CAMCORDER_NOT_SUPPORTED;
-                               goto _ERR_DEFAULT_VALUE_INIT;
-                       }
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
+                       CONFIGURE_CATEGORY_CTRL_CAPTURE,
+                       "SupportZSL",
+                       &hcamcorder->support_zsl_capture);
 
-                       _mmcam_dbg_log("videodev_type : [%d], ConfCtrlPath : [%s]", info->videodev_type, ConfCtrlFile);
+               _mmcam_dbg_log("Recommend fmt[cap:%d,rec:%d], dpy rot %d, cap snd %d, dev cnt %d, cam facing dir %d, step denom %d, support zsl %d",
+                       rcmd_fmt_capture, rcmd_fmt_recording, rcmd_dpy_rotation,
+                       play_capture_sound, camera_device_count, camera_facing_direction,
+                       hcamcorder->brightness_step_denominator, hcamcorder->support_zsl_capture);
 
-                       ret = _mmcamcorder_conf_get_info((MMHandleType)hcamcorder, CONFIGURE_TYPE_CTRL, ConfCtrlFile, &hcamcorder->conf_ctrl);
-                       if (ret != MM_ERROR_NONE) {
-                               _mmcam_dbg_err("Failed to get configure(control) info.");
-                               goto _ERR_DEFAULT_VALUE_INIT;
-                       }
-/*
-                       _mmcamcorder_conf_print_info(&hcamcorder->conf_main);
-                       _mmcamcorder_conf_print_info(&hcamcorder->conf_ctrl);
-*/
-                       ret = _mmcamcorder_init_convert_table((MMHandleType)hcamcorder);
-                       if (ret != MM_ERROR_NONE) {
-                               _mmcam_dbg_warn("converting table initialize error!!");
-                               ret = MM_ERROR_CAMCORDER_INTERNAL;
-                               goto _ERR_DEFAULT_VALUE_INIT;
-                       }
+               /* Get UseZeroCopyFormat value from INI */
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
+                       CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
+                       "UseZeroCopyFormat",
+                       &(hcamcorder->use_zero_copy_format));
 
-                       ret = _mmcamcorder_init_attr_from_configure((MMHandleType)hcamcorder, MM_CAMCONVERT_CATEGORY_ALL);
-                       if (ret != MM_ERROR_NONE) {
-                               _mmcam_dbg_warn("converting table initialize error!!");
-                               ret = MM_ERROR_CAMCORDER_INTERNAL;
-                               goto _ERR_DEFAULT_VALUE_INIT;
-                       }
+               /* Get SupportMediaPacketPreviewCb value from INI */
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
+                       CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
+                       "SupportMediaPacketPreviewCb",
+                       &(hcamcorder->support_media_packet_preview_cb));
 
-                       /* Get device info, recommend preview fmt and display rotation from INI */
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
-                               CONFIGURE_CATEGORY_CTRL_CAMERA,
-                               "RecommendPreviewFormatCapture",
-                               &rcmd_fmt_capture);
-
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
-                               CONFIGURE_CATEGORY_CTRL_CAMERA,
-                               "RecommendPreviewFormatRecord",
-                               &rcmd_fmt_recording);
-
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
-                               CONFIGURE_CATEGORY_CTRL_CAMERA,
-                               "RecommendDisplayRotation",
-                               &rcmd_dpy_rotation);
-
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
-                               CONFIGURE_CATEGORY_MAIN_CAPTURE,
-                               "PlayCaptureSound",
-                               &play_capture_sound);
-
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
-                               CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
-                               "DeviceCount",
-                               &camera_device_count);
-
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
-                               CONFIGURE_CATEGORY_CTRL_CAMERA,
-                               "FacingDirection",
-                               &camera_facing_direction);
-
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
-                               CONFIGURE_CATEGORY_CTRL_EFFECT,
-                               "BrightnessStepDenominator",
-                               &hcamcorder->brightness_step_denominator);
-
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
-                               CONFIGURE_CATEGORY_CTRL_CAPTURE,
-                               "SupportZSL",
-                               &hcamcorder->support_zsl_capture);
-
-                       _mmcam_dbg_log("Recommend fmt[cap:%d,rec:%d], dpy rot %d, cap snd %d, dev cnt %d, cam facing dir %d, step denom %d, support zsl %d",
-                               rcmd_fmt_capture, rcmd_fmt_recording, rcmd_dpy_rotation,
-                               play_capture_sound, camera_device_count, camera_facing_direction,
-                               hcamcorder->brightness_step_denominator, hcamcorder->support_zsl_capture);
-
-                       /* Get UseZeroCopyFormat value from INI */
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
-                               CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
-                               "UseZeroCopyFormat",
-                               &(hcamcorder->use_zero_copy_format));
-
-                       /* Get SupportMediaPacketPreviewCb value from INI */
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
-                               CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT,
-                               "SupportMediaPacketPreviewCb",
-                               &(hcamcorder->support_media_packet_preview_cb));
-
-                       /* Get UseVideoconvert value from INI */
-                       _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
-                               CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT,
-                               "UseVideoconvert",
-                               &hcamcorder->use_videoconvert);
-
-                       ret = mm_camcorder_get_attributes((MMHandleType)hcamcorder, NULL,
-                               MMCAM_CAMERA_WIDTH, &resolution_width,
-                               MMCAM_CAMERA_HEIGHT, &resolution_height,
-                               NULL);
+               /* Get UseVideoconvert value from INI */
+               _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_main,
+                       CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT,
+                       "UseVideoconvert",
+                       &hcamcorder->use_videoconvert);
 
-                       mm_camcorder_get_fps_list_by_resolution((MMHandleType)hcamcorder, resolution_width, resolution_height, &fps_info);
+               ret = mm_camcorder_get_attributes((MMHandleType)hcamcorder, NULL,
+                       MMCAM_CAMERA_WIDTH, &resolution_width,
+                       MMCAM_CAMERA_HEIGHT, &resolution_height,
+                       NULL);
 
-                       _mmcam_dbg_log("UseZeroCopyFormat %d, UseVideoconvert %d, SupportMediaPacketPreviewCb %d",
-                               hcamcorder->use_zero_copy_format, hcamcorder->use_videoconvert, hcamcorder->support_media_packet_preview_cb);
-                       _mmcam_dbg_log("res : %d X %d, Default FPS by resolution  : %d",
-                               resolution_width, resolution_height, fps_info.int_array.def);
+               mm_camcorder_get_fps_list_by_resolution((MMHandleType)hcamcorder, resolution_width, resolution_height, &fps_info);
 
-                       if (camera_facing_direction == 1) {
-                               if (rcmd_dpy_rotation == MM_DISPLAY_ROTATION_270 || rcmd_dpy_rotation == MM_DISPLAY_ROTATION_90)
-                                       camera_default_flip = MM_FLIP_VERTICAL;
-                               else
-                                       camera_default_flip = MM_FLIP_HORIZONTAL;
+               _mmcam_dbg_log("UseZeroCopyFormat %d, UseVideoconvert %d, SupportMediaPacketPreviewCb %d",
+                       hcamcorder->use_zero_copy_format, hcamcorder->use_videoconvert, hcamcorder->support_media_packet_preview_cb);
+               _mmcam_dbg_log("res : %d X %d, Default FPS by resolution  : %d",
+                       resolution_width, resolution_height, fps_info.int_array.def);
 
-                               _mmcam_dbg_log("camera_default_flip : [%d]", camera_default_flip);
-                       }
+               if (camera_facing_direction == 1) {
+                       if (rcmd_dpy_rotation == MM_DISPLAY_ROTATION_270 || rcmd_dpy_rotation == MM_DISPLAY_ROTATION_90)
+                               camera_default_flip = MM_FLIP_VERTICAL;
+                       else
+                               camera_default_flip = MM_FLIP_HORIZONTAL;
 
-                       mm_camcorder_set_attributes((MMHandleType)hcamcorder, &err_attr_name,
-                               MMCAM_CAMERA_DEVICE_COUNT, camera_device_count,
-                               MMCAM_CAMERA_FACING_DIRECTION, camera_facing_direction,
-                               MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_CAPTURE, rcmd_fmt_capture,
-                               MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_RECORDING, rcmd_fmt_recording,
-                               MMCAM_RECOMMEND_DISPLAY_ROTATION, rcmd_dpy_rotation,
-                               MMCAM_SUPPORT_ZSL_CAPTURE, hcamcorder->support_zsl_capture,
-                               MMCAM_SUPPORT_ZERO_COPY_FORMAT, hcamcorder->use_zero_copy_format,
-                               MMCAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB, hcamcorder->support_media_packet_preview_cb,
-                               MMCAM_CAMERA_FPS, fps_info.int_array.def,
-                               MMCAM_DISPLAY_FLIP, camera_default_flip,
-                               MMCAM_CAPTURE_SOUND_ENABLE, play_capture_sound,
-                               NULL);
-                       if (err_attr_name) {
-                               _mmcam_dbg_err("Set %s FAILED.", err_attr_name);
-                               SAFE_FREE(err_attr_name);
-                               ret = MM_ERROR_CAMCORDER_INTERNAL;
-                               goto _ERR_DEFAULT_VALUE_INIT;
-                       }
+                       _mmcam_dbg_log("camera_default_flip : [%d]", camera_default_flip);
+               }
 
-                       /* Get default value of brightness */
-                       mm_camcorder_get_attributes((MMHandleType)hcamcorder, &err_attr_name,
-                               MMCAM_FILTER_BRIGHTNESS, &hcamcorder->brightness_default,
-                               NULL);
-                       if (err_attr_name) {
-                               _mmcam_dbg_err("Get brightness FAILED.");
-                               SAFE_FREE(err_attr_name);
-                               ret = MM_ERROR_CAMCORDER_INTERNAL;
-                               goto _ERR_DEFAULT_VALUE_INIT;
-                       }
-                       _mmcam_dbg_log("Default brightness : %d", hcamcorder->brightness_default);
-               } else {
-                       _mmcam_dbg_log("Disable Configure Control system.");
-                       hcamcorder->conf_ctrl = NULL;
+               mm_camcorder_set_attributes((MMHandleType)hcamcorder, &err_attr_name,
+                       MMCAM_CAMERA_DEVICE_COUNT, camera_device_count,
+                       MMCAM_CAMERA_FACING_DIRECTION, camera_facing_direction,
+                       MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_CAPTURE, rcmd_fmt_capture,
+                       MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_RECORDING, rcmd_fmt_recording,
+                       MMCAM_RECOMMEND_DISPLAY_ROTATION, rcmd_dpy_rotation,
+                       MMCAM_SUPPORT_ZSL_CAPTURE, hcamcorder->support_zsl_capture,
+                       MMCAM_SUPPORT_ZERO_COPY_FORMAT, hcamcorder->use_zero_copy_format,
+                       MMCAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB, hcamcorder->support_media_packet_preview_cb,
+                       MMCAM_CAMERA_FPS, fps_info.int_array.def,
+                       MMCAM_DISPLAY_FLIP, camera_default_flip,
+                       MMCAM_CAPTURE_SOUND_ENABLE, play_capture_sound,
+                       NULL);
+               if (err_attr_name) {
+                       _mmcam_dbg_err("Set %s FAILED.", err_attr_name);
+                       SAFE_FREE(err_attr_name);
+                       ret = MM_ERROR_CAMCORDER_INTERNAL;
+                       goto _ERR_DEFAULT_VALUE_INIT;
                }
 
+               /* Get default value of brightness */
+               mm_camcorder_get_attributes((MMHandleType)hcamcorder, &err_attr_name,
+                       MMCAM_FILTER_BRIGHTNESS, &hcamcorder->brightness_default,
+                       NULL);
+               if (err_attr_name) {
+                       _mmcam_dbg_err("Get brightness FAILED.");
+                       SAFE_FREE(err_attr_name);
+                       ret = MM_ERROR_CAMCORDER_INTERNAL;
+                       goto _ERR_DEFAULT_VALUE_INIT;
+               }
+
+               _mmcam_dbg_log("Default brightness : %d", hcamcorder->brightness_default);
+
                /* add DPM camera policy changed callback */
                if (hcamcorder->dpm_handle) {
                        ret = dpm_add_policy_changed_cb(hcamcorder->dpm_handle, "camera",
@@ -530,7 +505,7 @@ _ERR_DEFAULT_VALUE_INIT:
        g_cond_clear(&(hcamcorder->mtsafe).cond);
        g_mutex_clear(&(hcamcorder->mtsafe).cmd_lock);
        g_cond_clear(&(hcamcorder->mtsafe).cmd_cond);
-       g_mutex_clear(&(hcamcorder->mtsafe).asm_lock);
+       g_mutex_clear(&(hcamcorder->mtsafe).interrupt_lock);
        g_mutex_clear(&(hcamcorder->mtsafe).state_lock);
        g_mutex_clear(&(hcamcorder->mtsafe).gst_state_lock);
        g_mutex_clear(&(hcamcorder->mtsafe).gst_encode_state_lock);
@@ -697,29 +672,6 @@ int _mmcamcorder_destroy(MMHandleType handle)
        /* Remove messages which are not called yet */
        _mmcamcorder_remove_message_all(handle);
 
-       /* unset remained watch cb */
-       if (hcamcorder->sound_focus_watch_id > 0) {
-               mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
-               _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
-               hcamcorder->sound_focus_watch_id = 0;
-       }
-
-       /* unregister sound focus and unsubscribe sound signal */
-       _mmcam_dbg_log("sound focus id %d, sound signal subscribe id %u",
-               hcamcorder->sound_focus_id, hcamcorder->sound_focus_subscribe_id);
-
-       if (hcamcorder->sound_focus_id > 0) {
-               mm_sound_unregister_focus(hcamcorder->sound_focus_id);
-               _mmcam_dbg_log("unregister sound focus done");
-               hcamcorder->sound_focus_id = 0;
-       }
-
-       if (hcamcorder->sound_focus_subscribe_id > 0) {
-               mm_sound_unsubscribe_signal(hcamcorder->sound_focus_subscribe_id);
-               _mmcam_dbg_log("unsubscribe sound signal done");
-               hcamcorder->sound_focus_subscribe_id = 0;
-       }
-
 #ifdef _MMCAMCORDER_RM_SUPPORT
        if (hcamcorder->rm_handle != 0) {
                iret = rm_unregister(hcamcorder->rm_handle);
@@ -769,7 +721,7 @@ int _mmcamcorder_destroy(MMHandleType handle)
        g_cond_clear(&(hcamcorder->mtsafe).cond);
        g_mutex_clear(&(hcamcorder->mtsafe).cmd_lock);
        g_cond_clear(&(hcamcorder->mtsafe).cmd_cond);
-       g_mutex_clear(&(hcamcorder->mtsafe).asm_lock);
+       g_mutex_clear(&(hcamcorder->mtsafe).interrupt_lock);
        g_mutex_clear(&(hcamcorder->mtsafe).state_lock);
        g_mutex_clear(&(hcamcorder->mtsafe).gst_state_lock);
        g_mutex_clear(&(hcamcorder->mtsafe).gst_encode_state_lock);
@@ -817,10 +769,8 @@ _ERR_CAMCORDER_CMD_PRECON:
 int _mmcamcorder_realize(MMHandleType handle)
 {
        int ret = MM_ERROR_NONE;
-       int ret_sound = MM_ERROR_NONE;
        int state = MM_CAMCORDER_STATE_NONE;
        int display_surface_type = MM_DISPLAY_SURFACE_OVERLAY;
-       int pid_for_sound_focus = 0;
        double motion_rate = _MMCAMCORDER_DEFAULT_RECORDING_MOTION_RATE;
        char *videosink_element_type = NULL;
        const char *videosink_name = NULL;
@@ -880,67 +830,6 @@ int _mmcamcorder_realize(MMHandleType handle)
                MMCAM_CAMERA_RECORDING_MOTION_RATE, &motion_rate,
                NULL);
 
-       /* sound focus */
-       if (hcamcorder->sound_focus_register) {
-               mm_camcorder_get_attributes(handle, NULL,
-                       MMCAM_PID_FOR_SOUND_FOCUS, &pid_for_sound_focus,
-                       NULL);
-
-               if (pid_for_sound_focus == 0) {
-                       pid_for_sound_focus = getpid();
-                       _mmcam_dbg_warn("pid for sound focus is not set, use my pid %d", pid_for_sound_focus);
-               }
-
-               ret = __mmcamcorder_simulate_asm_conflict_table(hcamcorder->session_type, pid_for_sound_focus);
-               if (ret != MM_ERROR_NONE)
-                       goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
-
-               /* acquire sound focus or set sound focus watch callback */
-               if (hcamcorder->session_flags & MM_SESSION_OPTION_PAUSE_OTHERS) {
-                       /* acquire sound focus */
-                       _mmcam_dbg_log("PAUSE_OTHERS - acquire sound focus");
-
-                       ret_sound = mm_sound_acquire_focus(hcamcorder->sound_focus_id, FOCUS_FOR_BOTH, "mm-camcorder acquire focus");
-                       if (ret_sound != MM_ERROR_NONE) {
-                               _mmcam_dbg_err("mm_sound_acquire_focus failed [0x%x]", ret_sound);
-
-                               ret = MM_ERROR_POLICY_BLOCKED;
-                               goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
-                       }
-
-                       hcamcorder->acquired_focus = FOCUS_FOR_BOTH;
-               } else if (hcamcorder->session_flags & MM_SESSION_OPTION_UNINTERRUPTIBLE) {
-                       /* do nothing */
-                       _mmcam_dbg_log("SESSION_UNINTERRUPTIBLE - do nothing for sound focus");
-               } else {
-                       /* unset remained watch cb */
-                       if (hcamcorder->sound_focus_watch_id > 0) {
-                               mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
-                               _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
-                               hcamcorder->sound_focus_watch_id = 0;
-                       }
-
-                       /* set sound focus watch callback */
-                       _mmcam_dbg_log("ETC - set sound focus watch callback - pid %d", pid_for_sound_focus);
-
-                       ret_sound = mm_sound_set_focus_watch_callback_for_session(pid_for_sound_focus,
-                               FOCUS_FOR_BOTH,
-                               (mm_sound_focus_changed_watch_cb)_mmcamcorder_sound_focus_watch_cb,
-                               hcamcorder,
-                               &hcamcorder->sound_focus_watch_id);
-                       if (ret_sound != MM_ERROR_NONE) {
-                               _mmcam_dbg_err("mm_sound_set_focus_watch_callback failed [0x%x]", ret_sound);
-
-                               ret = MM_ERROR_POLICY_BLOCKED;
-                               goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
-                       }
-
-                       _mmcam_dbg_log("sound focus watch cb id %d", hcamcorder->sound_focus_watch_id);
-               }
-       } else {
-               _mmcam_dbg_log("no need to register sound focus");
-       }
-
        /* alloc sub context */
        hcamcorder->sub_context = _mmcamcorder_alloc_subcontext(hcamcorder->type);
        if (!hcamcorder->sub_context) {
@@ -1058,11 +947,11 @@ int _mmcamcorder_realize(MMHandleType handle)
                if (hcamcorder->camera_resource == NULL) {
                        ret = mm_resource_manager_mark_for_acquire(hcamcorder->resource_manager,
                                        MM_RESOURCE_MANAGER_RES_TYPE_CAMERA,
-                                       MM_RESOURCE_MANAGER_RES_VOLUME_FULL,
+                                       1,
                                        &hcamcorder->camera_resource);
                        if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) {
                                _mmcam_dbg_err("could not prepare for camera resource");
-                               ret = MM_ERROR_CAMCORDER_INTERNAL;
+                               ret = MM_ERROR_RESOURCE_INTERNAL;
                                _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
                                goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                        }
@@ -1079,7 +968,7 @@ int _mmcamcorder_realize(MMHandleType handle)
                                                &hcamcorder->video_overlay_resource);
                                if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) {
                                        _mmcam_dbg_err("could not prepare for overlay resource");
-                                       ret = MM_ERROR_CAMCORDER_INTERNAL;
+                                       ret = MM_ERROR_RESOURCE_INTERNAL;
                                        _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
                                        goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                                }
@@ -1091,10 +980,9 @@ int _mmcamcorder_realize(MMHandleType handle)
                /* acquire resources */
                ret = mm_resource_manager_commit(hcamcorder->resource_manager);
                if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) {
-                       _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
-
                        _mmcam_dbg_err("could not acquire resources");
-
+                       ret = MM_ERROR_RESOURCE_INTERNAL;
+                       _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
                        goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                }
                _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
@@ -1102,7 +990,7 @@ int _mmcamcorder_realize(MMHandleType handle)
 
 #ifdef _MMCAMCORDER_RM_SUPPORT
                mm_camcorder_get_attributes(handle, NULL,
-                       MMCAM_PID_FOR_SOUND_FOCUS, &app_pid,
+                       MMCAM_CLIENT_PID, &app_pid,
                        NULL);
                rci.app_pid = app_pid;
                aul_app_get_appid_bypid(rci.app_pid, rci.app_id, sizeof(rci.app_id));
@@ -1112,7 +1000,7 @@ int _mmcamcorder_realize(MMHandleType handle)
                        iret = rm_register((rm_resource_cb)_mmcamcorder_rm_callback, (void*)hcamcorder, &(hcamcorder->rm_handle), &rci);
                        if (iret != RM_OK) {
                                _mmcam_dbg_err("rm_register fail");
-                               ret = MM_ERROR_POLICY_BLOCKED;
+                               ret = MM_ERROR_RESOURCE_INTERNAL;
                                goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                        }
                }
@@ -1175,7 +1063,7 @@ int _mmcamcorder_realize(MMHandleType handle)
                iret = rm_allocate_resources(hcamcorder->rm_handle, &(hcamcorder->request_resources), &hcamcorder->returned_devices);
                if (iret != RM_OK) {
                        _mmcam_dbg_err("Resource allocation request failed");
-                       ret = MM_ERROR_POLICY_BLOCKED;
+                       ret = MM_ERROR_RESOURCE_INTERNAL;
                        goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                }
 #endif /* _MMCAMCORDER_RM_SUPPORT */
@@ -1261,18 +1149,6 @@ _ERR_CAMCORDER_CMD:
 _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK:
        _MMCAMCORDER_UNLOCK_CMD(hcamcorder);
 
-       if (hcamcorder->sound_focus_watch_id > 0) {
-               mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
-               _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
-               hcamcorder->sound_focus_watch_id = 0;
-       }
-
-       if (hcamcorder->acquired_focus > 0) {
-               mm_sound_release_focus(hcamcorder->sound_focus_id, hcamcorder->acquired_focus, "mm-camcorder release focus");
-               _mmcam_dbg_warn("release sound focus [focus %d] done", hcamcorder->acquired_focus);
-               hcamcorder->acquired_focus = 0;
-       }
-
 _ERR_CAMCORDER_CMD_PRECON:
        _mmcam_dbg_err("Realize fail (type %d, state %d, ret %x)", hcamcorder->type, state, ret);
 
@@ -1392,32 +1268,6 @@ int _mmcamcorder_unrealize(MMHandleType handle)
        /* Deinitialize main context member */
        hcamcorder->command = NULL;
 
-       _mmcam_dbg_log("focus register %d, session flag 0x%x, state_change_by_system %d",
-               hcamcorder->sound_focus_register, hcamcorder->session_flags, hcamcorder->state_change_by_system);
-
-       /* release sound focus or unset sound focus watch callback */
-       _mmcam_dbg_log("by_system %d, flag 0x%x, acquired_focus %d, focus_id %d, watch_id %d",
-               hcamcorder->state_change_by_system, hcamcorder->session_flags, hcamcorder->acquired_focus,
-               hcamcorder->sound_focus_id, hcamcorder->sound_focus_watch_id);
-
-       if (hcamcorder->state_change_by_system != _MMCAMCORDER_STATE_CHANGE_BY_FOCUS) {
-               if (hcamcorder->sound_focus_watch_id > 0) {
-                       mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
-                       _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
-                       hcamcorder->sound_focus_watch_id = 0;
-               }
-
-               if (hcamcorder->acquired_focus > 0) {
-                       mm_sound_release_focus(hcamcorder->sound_focus_id, hcamcorder->acquired_focus, "mm-camcorder release focus");
-                       _mmcam_dbg_warn("release sound focus [focus %d] done", hcamcorder->acquired_focus);
-                       hcamcorder->acquired_focus = 0;
-               }
-       } else {
-               _mmcam_dbg_warn("state change by focus. so, no need to unset watch callback");
-               /* acquired focus will be released automatically */
-               hcamcorder->acquired_focus = 0;
-       }
-
        _MMCAMCORDER_UNLOCK_CMD(hcamcorder);
 
        _mmcamcorder_set_state(handle, MM_CAMCORDER_STATE_NULL);
@@ -2542,10 +2392,6 @@ void _mmcamcorder_set_state(MMHandleType handle, int state)
 
                /* To discern who changes the state */
                switch (hcamcorder->state_change_by_system) {
-               case _MMCAMCORDER_STATE_CHANGE_BY_FOCUS:
-                       msg.id = MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM;
-                       msg.param.state.code = hcamcorder->interrupt_code;
-                       break;
                case _MMCAMCORDER_STATE_CHANGE_BY_RM:
                        msg.id = MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_RM;
                        msg.param.state.code = MM_ERROR_NONE;
@@ -2644,7 +2490,7 @@ _MMCamcorderSubContext *_mmcamcorder_alloc_subcontext(int type)
        }
 
        sc->fourcc = 0x80000000;
-       sc->cam_stability_count = 0;
+       sc->frame_stability_count = 0;
        sc->drop_vframe = 0;
        sc->pass_first_vframe = 0;
        sc->is_modified_rate = FALSE;
@@ -3264,183 +3110,6 @@ DROP_MESSAGE:
 }
 
 
-void _mmcamcorder_sound_focus_cb(int id, mm_sound_focus_type_e focus_type,
-       mm_sound_focus_state_e focus_state, const char *reason_for_change,
-       int option, const char *additional_info, void *user_data)
-{
-       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(user_data);
-       int current_state = MM_CAMCORDER_STATE_NONE;
-
-       mmf_return_if_fail((MMHandleType)hcamcorder);
-
-       current_state = _mmcamcorder_get_state((MMHandleType)hcamcorder);
-       if (current_state <= MM_CAMCORDER_STATE_NONE || current_state >= MM_CAMCORDER_STATE_NUM) {
-               _mmcam_dbg_err("Abnormal state. Or null handle. (%p, %d)", hcamcorder, current_state);
-               return;
-       }
-
-       _mmcam_dbg_warn("sound focus callback : focus state %d, reason %s",
-                                  focus_state, reason_for_change ? reason_for_change : "N/A");
-
-       if (hcamcorder->session_flags & MM_SESSION_OPTION_UNINTERRUPTIBLE) {
-               _mmcam_dbg_warn("session flag is UNINTERRUPTIBLE. do nothing.");
-               return;
-       }
-
-       _MMCAMCORDER_LOCK_ASM(hcamcorder);
-
-       /* check the reason */
-       if (!strncmp(reason_for_change, "ringtone-voip", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN) ||
-           !strncmp(reason_for_change, "ringtone-call", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN) ||
-           !strncmp(reason_for_change, "voip", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN) ||
-           !strncmp(reason_for_change, "call-voice", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN)) {
-               hcamcorder->interrupt_code = MM_MSG_CODE_INTERRUPTED_BY_CALL_START;
-       } else if (!strncmp(reason_for_change, "alarm", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN)) {
-               hcamcorder->interrupt_code = MM_MSG_CODE_INTERRUPTED_BY_ALARM_START;
-       } else {
-               hcamcorder->interrupt_code = MM_MSG_CODE_INTERRUPTED_BY_MEDIA;
-       }
-
-       if (focus_state == FOCUS_IS_RELEASED) {
-               hcamcorder->acquired_focus &= ~focus_type;
-
-               _mmcam_dbg_warn("FOCUS is released [type %d, remained focus %d] : Stop pipeline[state:%d]",
-                       focus_type, hcamcorder->acquired_focus, current_state);
-
-               __mmcamcorder_force_stop(hcamcorder, _MMCAMCORDER_STATE_CHANGE_BY_FOCUS);
-
-               _mmcam_dbg_warn("Finish opeartion. Pipeline is released");
-       } else if (focus_state == FOCUS_IS_ACQUIRED) {
-               _MMCamcorderMsgItem msg;
-
-               _mmcam_dbg_warn("FOCUS is ready to acquired [type %d, current %d]",
-                       focus_type, hcamcorder->acquired_focus);
-
-               msg.id = MM_MESSAGE_READY_TO_RESUME;
-               _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
-
-               _mmcam_dbg_warn("Finish opeartion");
-       } else {
-               _mmcam_dbg_warn("unknown focus state %d", focus_state);
-       }
-
-       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
-
-       _mmcam_dbg_warn("done");
-
-       return;
-}
-
-
-void _mmcamcorder_sound_signal_callback(mm_sound_signal_name_t signal, int value, void *user_data)
-{
-       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(user_data);
-
-       mmf_return_if_fail(hcamcorder);
-
-       _mmcam_dbg_warn("sound signal %d - value %d", signal, value);
-
-       _MMCAMCORDER_LOCK_ASM(hcamcorder);
-
-       if (signal == MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS && value == 1) {
-               _mmcam_dbg_warn("focus id %d, focus watch id %d",
-                       hcamcorder->sound_focus_id, hcamcorder->sound_focus_watch_id);
-
-               /* unregister focus related callback */
-               if (hcamcorder->sound_focus_id > 0) {
-                       if (hcamcorder->acquired_focus > 0) {
-                               mm_sound_release_focus(hcamcorder->sound_focus_id, hcamcorder->acquired_focus, "mm-camcorder release focus");
-                               _mmcam_dbg_warn("release acquired focus [focus %d] done", hcamcorder->acquired_focus);
-                               hcamcorder->acquired_focus = 0;
-                       }
-
-                       mm_sound_unregister_focus(hcamcorder->sound_focus_id);
-                       _mmcam_dbg_warn("unregister sound focus done");
-                       hcamcorder->sound_focus_id = 0;
-               }
-
-               if (hcamcorder->sound_focus_watch_id > 0) {
-                       mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
-                       _mmcam_dbg_warn("unset watch cb done");
-                       hcamcorder->sound_focus_watch_id = 0;
-               }
-       }
-
-       /* reset flag not to run sound focus related code since now */
-       hcamcorder->sound_focus_register = FALSE;
-
-       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
-
-       _mmcam_dbg_warn("done");
-
-       return;
-}
-
-
-void _mmcamcorder_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state,
-       const char *reason_for_change, const char *additional_info, void *user_data)
-{
-       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(user_data);
-       int current_state = MM_CAMCORDER_STATE_NONE;
-
-       mmf_return_if_fail(hcamcorder);
-
-       current_state = _mmcamcorder_get_state((MMHandleType)hcamcorder);
-       if (current_state <= MM_CAMCORDER_STATE_NONE ||
-           current_state >= MM_CAMCORDER_STATE_NUM) {
-               _mmcam_dbg_err("Abnormal state. Or null handle. (%p, %d)", hcamcorder, current_state);
-               return;
-       }
-
-       _mmcam_dbg_warn("sound focus watch callback : id %d, focus state %d, reason %s",
-               id, focus_state, reason_for_change ? reason_for_change : "N/A");
-
-       if (hcamcorder->session_flags & MM_SESSION_OPTION_UNINTERRUPTIBLE) {
-               _mmcam_dbg_warn("session flag is UNINTERRUPTIBLE. do nothing.");
-               return;
-       }
-
-       _MMCAMCORDER_LOCK_ASM(hcamcorder);
-
-       /* check the reason */
-       if (!strncmp(reason_for_change, "ringtone-voip", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN) ||
-           !strncmp(reason_for_change, "ringtone-call", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN) ||
-           !strncmp(reason_for_change, "voip", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN) ||
-           !strncmp(reason_for_change, "call-voice", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN)) {
-               hcamcorder->interrupt_code = MM_MSG_CODE_INTERRUPTED_BY_CALL_START;
-       } else if (!strncmp(reason_for_change, "alarm", __MMCAMCORDER_FOCUS_CHANGE_REASON_LEN)) {
-               hcamcorder->interrupt_code = MM_MSG_CODE_INTERRUPTED_BY_ALARM_START;
-       } else {
-               hcamcorder->interrupt_code = MM_MSG_CODE_INTERRUPTED_BY_MEDIA;
-       }
-
-       if (focus_state == FOCUS_IS_RELEASED) {
-               _MMCamcorderMsgItem msg;
-
-               _mmcam_dbg_warn("other process's FOCUS is released");
-
-               msg.id = MM_MESSAGE_READY_TO_RESUME;
-               _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
-
-               _mmcam_dbg_warn("Finish opeartion");
-       } else if (focus_state == FOCUS_IS_ACQUIRED) {
-               _mmcam_dbg_warn("other process's FOCUS is acquired : Stop pipeline[state:%d]", current_state);
-
-               __mmcamcorder_force_stop(hcamcorder, _MMCAMCORDER_STATE_CHANGE_BY_FOCUS);
-
-               _mmcam_dbg_warn("Finish opeartion. Pipeline is released");
-       } else {
-               _mmcam_dbg_warn("unknown focus state %d", focus_state);
-       }
-
-       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
-
-       _mmcam_dbg_warn("done");
-
-       return;
-}
-
-
 void _mmcamcorder_dpm_camera_policy_changed_cb(const char *name, const char *value, void *user_data)
 {
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(user_data);
@@ -3458,11 +3127,11 @@ void _mmcamcorder_dpm_camera_policy_changed_cb(const char *name, const char *val
        _mmcam_dbg_warn("camera policy [%s], current state [%d]", value, current_state);
 
        if (!strcmp(value, "disallowed")) {
-               _MMCAMCORDER_LOCK_ASM(hcamcorder);
+               _MMCAMCORDER_LOCK_INTERRUPT(hcamcorder);
 
                __mmcamcorder_force_stop(hcamcorder, _MMCAMCORDER_STATE_CHANGE_BY_DPM);
 
-               _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
+               _MMCAMCORDER_UNLOCK_INTERRUPT(hcamcorder);
 
                _mmcamcorder_request_dpm_popup(hcamcorder->gdbus_conn, "camera");
        }
@@ -3787,9 +3456,6 @@ void __mmcamcorder_force_stop(mmf_camcorder_t *hcamcorder, int state_change_by_s
                memset(&msg, 0x0, sizeof(_MMCamcorderMsgItem));
 
                switch (state_change_by_system) {
-               case _MMCAMCORDER_STATE_CHANGE_BY_FOCUS:
-                       msg.id = MM_MESSAGE_CAMCORDER_STATE_CHANGE_STARTED_BY_ASM;
-                       break;
                case _MMCAMCORDER_STATE_CHANGE_BY_RM:
                        msg.id = MM_MESSAGE_CAMCORDER_STATE_CHANGE_STARTED_BY_RM;
                        break;
@@ -4059,7 +3725,7 @@ static gint __mmcamcorder_gst_handle_resource_error(MMHandleType handle, int cod
 
                        _mmcam_dbg_err("DPM mic DISALLOWED - current state %d", current_state);
 
-                       _MMCAMCORDER_LOCK_ASM(hcamcorder);
+                       _MMCAMCORDER_LOCK_INTERRUPT(hcamcorder);
 
                        current_state = _mmcamcorder_get_state((MMHandleType)hcamcorder);
                        if (current_state >= MM_CAMCORDER_STATE_RECORDING) {
@@ -4078,7 +3744,7 @@ static gint __mmcamcorder_gst_handle_resource_error(MMHandleType handle, int cod
                        /* restore value */
                        hcamcorder->state_change_by_system = _MMCAMCORDER_STATE_CHANGE_NORMAL;
 
-                       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
+                       _MMCAMCORDER_UNLOCK_INTERRUPT(hcamcorder);
 
                        _mmcamcorder_request_dpm_popup(hcamcorder->gdbus_conn, "microphone");
 
@@ -4278,64 +3944,6 @@ static gint __mmcamcorder_gst_handle_resource_warning(MMHandleType handle, GstMe
        return MM_ERROR_NONE;
 }
 
-/* Conditions below are from ASM conflict table of Tizen 2.4 */
-static int __mmcamcorder_simulate_asm_conflict_table(int session_type, int pid)
-{
-       int ret = MM_ERROR_NONE;
-       char *stream_type = NULL;
-       char *ext_info = NULL;
-       int option = 0;
-
-       /* check previous acquired focus of other PID */
-       ret = mm_sound_get_stream_type_of_acquired_focus(FOCUS_FOR_BOTH, &stream_type, &option, &ext_info);
-       if (ret == MM_ERROR_NONE && stream_type) {
-               if (ext_info && (pid != atoi(ext_info))) { /* 'ext_info' should contain pid */
-                       if ((session_type == MM_SESSION_TYPE_CALL) ||
-                               (session_type == MM_SESSION_TYPE_VIDEOCALL) ||
-                               (session_type == MM_SESSION_TYPE_VOIP)) {
-                               /* case 1. if my session type is call/videocall/voip */
-                               if (!strcmp(stream_type, "call-voice") ||
-                                       !strcmp(stream_type, "call-video") ||
-                                       !strcmp(stream_type, "ringtone-call")) {
-                                       _mmcam_dbg_err("Blocked by session policy, stream_type[%s] of acquired focus", stream_type);
-                                       ret = MM_ERROR_POLICY_BLOCKED;
-                               }
-                       } else if ((session_type == MM_SESSION_TYPE_MEDIA) ||
-                               (session_type == MM_SESSION_TYPE_MEDIA_RECORD)) {
-                               /* case 2. if my session type is media */
-                               if (!strcmp(stream_type, "alarm") ||
-                                       !strcmp(stream_type, "ringtone-voip") ||
-                                       !strcmp(stream_type, "ringtone-call") ||
-                                       !strcmp(stream_type, "voip") ||
-                                       !strcmp(stream_type, "call-voice") ||
-                                       !strcmp(stream_type, "call-video")) {
-                                       _mmcam_dbg_err("Blocked by session policy, stream_type[%s] of acquired focus", stream_type);
-                                       ret = MM_ERROR_POLICY_BLOCKED;
-                               }
-                       }
-               } else {
-                       _mmcam_dbg_log("acquired focus is same process with it, skip it");
-               }
-       } else {
-               /* No data case */
-               _mmcam_dbg_warn("get stream type failed 0x%x, stream type %s, but ignore it",
-                       ret, stream_type ? stream_type : "NULL");
-               ret = MM_ERROR_NONE;
-       }
-
-       if (stream_type) {
-               free(stream_type);
-               stream_type = NULL;
-       }
-
-       if (ext_info) {
-               free(ext_info);
-               ext_info = NULL;
-       }
-
-       return ret;
-}
-
 
 void _mmcamcorder_emit_signal(MMHandleType handle, const char *object_name,
        const char *interface_name, const char *signal_name, int value)
@@ -4370,7 +3978,7 @@ static int __mmcamcorder_resource_release_cb(mm_resource_manager_h rm,
 
        _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
 
-       _MMCAMCORDER_LOCK_ASM(hcamcorder);
+       _MMCAMCORDER_LOCK_INTERRUPT(hcamcorder);
 
        if (res == hcamcorder->video_encoder_resource) {
                /* Stop video recording */
@@ -4383,7 +3991,7 @@ static int __mmcamcorder_resource_release_cb(mm_resource_manager_h rm,
                __mmcamcorder_force_stop(hcamcorder, _MMCAMCORDER_STATE_CHANGE_BY_RM);
        }
 
-       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
+       _MMCAMCORDER_UNLOCK_INTERRUPT(hcamcorder);
 
        _MMCAMCORDER_LOCK_RESOURCE(hcamcorder);
 
@@ -4420,7 +4028,7 @@ rm_cb_result _mmcamcorder_rm_callback(int handle, rm_callback_type event_src,
 
        _mmcam_dbg_warn("current state %d (handle %p)", current_state, hcamcorder);
 
-       _MMCAMCORDER_LOCK_ASM(hcamcorder);
+       _MMCAMCORDER_LOCK_INTERRUPT(hcamcorder);
 
        /* set RM event code for sending it to application */
        hcamcorder->interrupt_code = event_src;
@@ -4435,7 +4043,7 @@ rm_cb_result _mmcamcorder_rm_callback(int handle, rm_callback_type event_src,
                break;
        }
 
-       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
+       _MMCAMCORDER_UNLOCK_INTERRUPT(hcamcorder);
 
        return cb_res;
 }
@@ -4460,7 +4068,7 @@ int _mmcamcorder_manage_external_storage_state(MMHandleType handle, int storage_
                return MM_ERROR_NONE;
        }
 
-       _MMCAMCORDER_LOCK_ASM(hcamcorder);
+       _MMCAMCORDER_LOCK_INTERRUPT(hcamcorder);
 
        /* check recording state */
        current_state = _mmcamcorder_get_state(handle);
@@ -4488,7 +4096,7 @@ int _mmcamcorder_manage_external_storage_state(MMHandleType handle, int storage_
        _mmcamcorder_send_message(handle, &msg);
 
 _MANAGE_DONE:
-       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
+       _MMCAMCORDER_UNLOCK_INTERRUPT(hcamcorder);
 
        _mmcam_dbg_warn("done - ret 0x%x", ret);