diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2012-09-04 16:34:28 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2012-09-04 16:34:28 +0900 |
commit | d8f8e16a93ac607c6839795a75668e4ae8c854ab (patch) | |
tree | c1bf480e40e03e5140e97e31a7bb76ebd9773dec | |
parent | ca403a464a8bf19b4053e954e6d8e946dba93cf3 (diff) | |
download | libmm-camcorder-d8f8e16a93ac607c6839795a75668e4ae8c854ab.tar.gz libmm-camcorder-d8f8e16a93ac607c6839795a75668e4ae8c854ab.tar.bz2 libmm-camcorder-d8f8e16a93ac607c6839795a75668e4ae8c854ab.zip |
1. Fix BS when set audio-disable in specific condition
2. Modify timing to set camera state
-rw-r--r-- | packaging/libmm-camcorder.spec | 2 | ||||
-rw-r--r-- | src/include/mm_camcorder_internal.h | 19 | ||||
-rw-r--r-- | src/mm_camcorder_attribute.c | 2 | ||||
-rw-r--r-- | src/mm_camcorder_internal.c | 36 |
4 files changed, 44 insertions, 15 deletions
diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index 98a4995..5b17098 100644 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -1,6 +1,6 @@ Name: libmm-camcorder Summary: Camera and recorder library -Version: 0.6.11 +Version: 0.6.13 Release: 0 Group: libs License: Apache-2.0 diff --git a/src/include/mm_camcorder_internal.h b/src/include/mm_camcorder_internal.h index b5719eb..07cedeb 100644 --- a/src/include/mm_camcorder_internal.h +++ b/src/include/mm_camcorder_internal.h @@ -133,17 +133,34 @@ extern "C" { _mmcam_dbg_err("The element is existed. element_id=[%d], name=[%s]", eid, name); \ gst_object_unref(sub_context->element[eid].gst); \ } \ - sub_context->element[eid].id = eid; \ sub_context->element[eid].gst = gst_element_factory_make(name, nickname); \ if (sub_context->element[eid].gst == NULL) { \ _mmcam_dbg_err("Element creation fail. element_id=[%d], name=[%s]", eid, name); \ err = MM_ERROR_CAMCORDER_RESOURCE_CREATION; \ goto pipeline_creation_error; \ } else { \ + _mmcam_dbg_log("Element creation done. element_id=[%d], name=[%s]", eid, name); \ + sub_context->element[eid].id = eid; \ g_object_weak_ref(G_OBJECT(sub_context->element[eid].gst), (GWeakNotify)_mmcamcorder_element_release_noti, sub_context); \ + err = MM_ERROR_NONE; \ } \ elist = g_list_append(elist, &(sub_context->element[eid])); +#define _MMCAMCORDER_ELEMENT_MAKE_IGNORE_ERROR(sub_context, eid, name /*char* */, nickname /*char* */, elist) \ + if (sub_context->element[eid].gst != NULL) { \ + _mmcam_dbg_err("The element is existed. element_id=[%d], name=[%s]", eid, name); \ + gst_object_unref(sub_context->element[eid].gst); \ + } \ + sub_context->element[eid].gst = gst_element_factory_make(name, nickname); \ + if (sub_context->element[eid].gst == NULL) { \ + _mmcam_dbg_err("Element creation fail. element_id=[%d], name=[%s]", eid, name); \ + } else { \ + _mmcam_dbg_log("Element creation done. element_id=[%d], name=[%s]", eid, name); \ + sub_context->element[eid].id = eid; \ + g_object_weak_ref(G_OBJECT(sub_context->element[eid].gst), (GWeakNotify)_mmcamcorder_element_release_noti, sub_context); \ + elist = g_list_append(elist, &(sub_context->element[eid])); \ + } + #define _MMCAMCORDER_ENCODEBIN_ELMGET(sub_context, eid, name /*char* */, err) \ if (sub_context->element[eid].gst != NULL) { \ _mmcam_dbg_err("The element is existed. element_id=[%d], name=[%s]", eid, name); \ diff --git a/src/mm_camcorder_attribute.c b/src/mm_camcorder_attribute.c index e31f451..4872e4e 100644 --- a/src/mm_camcorder_attribute.c +++ b/src/mm_camcorder_attribute.c @@ -3192,7 +3192,7 @@ bool _mmcamcorder_commit_audio_disable(MMHandleType handle, int attr_idx, const current_state = _mmcamcorder_get_state(handle); if (current_state > MM_CAMCORDER_STATE_PREPARE) { - _mmcam_dbg_warn("Can NOT Disable AUDIO. invalid state %s", current_state); + _mmcam_dbg_warn("Can NOT Disable AUDIO. invalid state %d", current_state); return FALSE; } else { _mmcam_dbg_log("Disable AUDIO when Recording"); diff --git a/src/mm_camcorder_internal.c b/src/mm_camcorder_internal.c index 5667971..6300f8b 100644 --- a/src/mm_camcorder_internal.c +++ b/src/mm_camcorder_internal.c @@ -616,6 +616,18 @@ int _mmcamcorder_realize(MMHandleType handle) goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK; } + /* set camera state to vconf key */ + if (hcamcorder->type != MM_CAMCORDER_MODE_AUDIO) { + int vconf_camera_state = 0; + + /* get current camera state of vconf key */ + vconf_get_int(VCONFKEY_CAMERA_STATE, &vconf_camera_state); + vconf_set_int(VCONFKEY_CAMERA_STATE, VCONFKEY_CAMERA_STATE_OPEN); + + _mmcam_dbg_log("VCONFKEY_CAMERA_STATE prev %d -> cur %d", + vconf_camera_state, VCONFKEY_CAMERA_STATE_OPEN); + } + /* Set async state */ ret = _mmcamcorder_set_async_state(handle, state_TO); if (ret < 0) { @@ -748,18 +760,6 @@ int _mmcamcorder_realize(MMHandleType handle) _mmcamcorder_set_state(handle, state_TO); - /* set camera state to vconf key */ - if (hcamcorder->type != MM_CAMCORDER_MODE_AUDIO) { - int vconf_camera_state = 0; - - /* get current camera state of vconf key */ - vconf_get_int(VCONFKEY_CAMERA_STATE, &vconf_camera_state); - vconf_set_int(VCONFKEY_CAMERA_STATE, VCONFKEY_CAMERA_STATE_OPEN); - - _mmcam_dbg_log("VCONFKEY_CAMERA_STATE prev %d -> cur %d", - vconf_camera_state, VCONFKEY_CAMERA_STATE_OPEN); - } - _MMCAMCORDER_UNLOCK_CMD(hcamcorder); return MM_ERROR_NONE; @@ -775,6 +775,18 @@ _ERR_CAMCORDER_CMD_PRECON: _mmcam_dbg_err("Realize fail (type %d, state %d, ret %x)", hcamcorder->type, state, ret); + /* set camera state to vconf key */ + if (hcamcorder->type != MM_CAMCORDER_MODE_AUDIO) { + int vconf_camera_state = 0; + + /* get current camera state of vconf key */ + vconf_get_int(VCONFKEY_CAMERA_STATE, &vconf_camera_state); + vconf_set_int(VCONFKEY_CAMERA_STATE, VCONFKEY_CAMERA_STATE_NULL); + + _mmcam_dbg_log("VCONFKEY_CAMERA_STATE prev %d -> cur %d", + vconf_camera_state, VCONFKEY_CAMERA_STATE_NULL); + } + return ret; } |