X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmm_camcorder_attribute.c;h=64fec715a80c8a06a87756b879a84fddb1343406;hb=refs%2Ftags%2Fsubmit%2Ftizen%2F20160201.062702;hp=2f8050a8060f15ca287c980bab2b329a3e6f0fb7;hpb=982d21f432623a9029d6d5e11f520b5df1f1df97;p=platform%2Fcore%2Fmultimedia%2Flibmm-camcorder.git diff --git a/src/mm_camcorder_attribute.c b/src/mm_camcorder_attribute.c index 2f8050a..64fec71 100644 --- a/src/mm_camcorder_attribute.c +++ b/src/mm_camcorder_attribute.c @@ -38,6 +38,8 @@ -----------------------------------------------------------------------*/ #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 /*--------------------------------------------------------------------------------------- | GLOBAL VARIABLE DEFINITIONS for internal | @@ -388,7 +390,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info ) {(void*)1}, MM_ATTRS_VALID_TYPE_DOUBLE_RANGE, {.double_min = 0.0}, - {.double_max = _MMCAMCORDER_MAX_INT}, + {.double_max = _MMCAMCORDER_MAX_DOUBLE}, _mmcamcorder_commit_camera_recording_motion_rate, }, { @@ -696,7 +698,7 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info ) "display-surface", MMF_VALUE_TYPE_INT, MM_ATTRS_FLAG_RW, - {(void*)MM_DISPLAY_SURFACE_X}, + {(void*)MM_DISPLAY_SURFACE_OVERLAY}, MM_ATTRS_VALID_TYPE_INT_ARRAY, {0}, {0}, @@ -1412,6 +1414,28 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info ) NULL, }, { + MM_CAM_ENCODED_PREVIEW_BITRATE, + "encoded-preview-bitrate", + MMF_VALUE_TYPE_INT, + MM_ATTRS_FLAG_RW, + {(void*)MMCAMCORDER_DEFAULT_ENCODED_PREVIEW_BITRATE}, + MM_ATTRS_VALID_TYPE_INT_RANGE, + {.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_FLAG_RW, + {(void*)MMCAMCORDER_DEFAULT_ENCODED_PREVIEW_GOP_INTERVAL}, + MM_ATTRS_VALID_TYPE_INT_RANGE, + {.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, @@ -1423,8 +1447,31 @@ _mmcamcorder_alloc_attribute( MMHandleType handle, MMCamPreset *info ) NULL, }, { - MM_CAM_DISPLAY_SHM_SOCKET_PATH, - "display-shm-socket-path", + MM_CAM_DISPLAY_SOCKET_PATH, + "display-socket-path", + MMF_VALUE_TYPE_STRING, + MM_ATTRS_FLAG_RW, + {(void*)NULL}, + MM_ATTRS_VALID_TYPE_NONE, + {0}, + {0}, + NULL, + }, + { + MM_CAM_PID_FOR_SOUND_FOCUS, + "pid-for-sound-focus", + MMF_VALUE_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, + }, + //120 + { + MM_CAM_ROOT_DIRECTORY, + "root-directory", MMF_VALUE_TYPE_STRING, MM_ATTRS_FLAG_RW, {(void*)NULL}, @@ -2083,7 +2130,14 @@ bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const m NULL); if (current_state == MM_CAMCORDER_STATE_PREPARE) { - if (!pthread_mutex_trylock(&(hcamcorder->restart_preview_lock))) { + if (hcamcorder->resolution_changed == FALSE) { + _mmcam_dbg_log("no need to restart preview"); + return TRUE; + } + + hcamcorder->resolution_changed = FALSE; + + if (g_mutex_trylock(&hcamcorder->restart_preview_lock)) { _mmcam_dbg_log("restart preview"); MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", TRUE); @@ -2102,7 +2156,7 @@ bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const m _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"); return FALSE; @@ -2141,7 +2195,7 @@ bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const mmf_return_val_if_fail(attr, FALSE); _mmcam_dbg_log("Height(%d)", value->value.i_val); - current_state = _mmcamcorder_get_state( handle); + 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); @@ -2164,7 +2218,14 @@ bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const sc->info_video->preview_height = height; if (current_state == MM_CAMCORDER_STATE_PREPARE) { - if (!pthread_mutex_trylock(&(hcamcorder->restart_preview_lock))) { + if (hcamcorder->resolution_changed == FALSE) { + _mmcam_dbg_log("no need to restart preview"); + return TRUE; + } + + hcamcorder->resolution_changed = FALSE; + + if (g_mutex_trylock(&hcamcorder->restart_preview_lock)) { _mmcam_dbg_log("restart preview"); _mmcam_dbg_log("set empty buffers"); @@ -2186,7 +2247,7 @@ bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const _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"); return FALSE; @@ -2894,11 +2955,8 @@ bool _mmcamcorder_commit_target_filename(MMHandleType handle, int attr_idx, cons } 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); + SAFE_G_FREE(sc->info_video->filename); + sc->info_video->filename = g_strdup(filename); if (sc->info_video->filename == NULL) { _mmcam_dbg_err("failed to strdup filename [%s]", filename); return FALSE; @@ -2907,7 +2965,7 @@ bool _mmcamcorder_commit_target_filename(MMHandleType handle, int attr_idx, cons 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(sc->encode_element[_MMCAMCORDER_ENCSINK_SINK].gst, "location", filename); + 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); @@ -3203,25 +3261,16 @@ bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const } else if (!strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink")) { _mmcam_dbg_log("Commit : Set evas object [%p]", p_handle); - MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "evas-object", 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(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), context); - } else { - _mmcam_dbg_warn("gst_wayland_display_handle_context_new failed"); - } + _mmcam_dbg_log("parent id : %d", wl_info->parent_id); - gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)wl_info->surface); + gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)wl_info->parent_id); 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); + 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); @@ -3269,7 +3318,7 @@ bool _mmcamcorder_commit_display_mode(MMHandleType handle, int attr_idx, const m _mmcam_dbg_log("Commit : videosinkname[%s]", videosink_name); - if (!strcmp(videosink_name, "xvimagesink")) { + if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "waylandsink")) { _mmcam_dbg_log("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; @@ -3301,7 +3350,7 @@ bool _mmcamcorder_commit_display_rotation(MMHandleType handle, int attr_idx, con 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); } @@ -3326,7 +3375,7 @@ bool _mmcamcorder_commit_display_flip(MMHandleType handle, int attr_idx, const m 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); } @@ -3362,8 +3411,8 @@ bool _mmcamcorder_commit_display_visible(MMHandleType handle, int attr_idx, cons return FALSE; } - if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "evasimagesink") || - !strcmp(videosink_name, "evaspixmapsink")) { + if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "waylandsink") || + !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "evasimagesink")) { 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; @@ -3407,8 +3456,8 @@ bool _mmcamcorder_commit_display_geometry_method (MMHandleType handle, int attr_ return FALSE; } - if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "evasimagesink") || - !strcmp(videosink_name, "evaspixmapsink")) { + if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "waylandsink") || + !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "evasimagesink")) { method = value->value.i_val; MMCAMCORDER_G_OBJECT_SET( sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "display-geometry-method", method); return TRUE; @@ -3461,7 +3510,7 @@ bool _mmcamcorder_commit_display_rect(MMHandleType handle, int attr_idx, const m return FALSE; } - if (!strcmp(videosink_name, "xvimagesink") || + if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "waylandsink") || !strcmp(videosink_name, "evaspixmapsink")) { int rect_x = 0; int rect_y = 0; @@ -3566,7 +3615,7 @@ bool _mmcamcorder_commit_display_scale(MMHandleType handle, int attr_idx, const } zoom = value->value.i_val; - if (!strcmp(videosink_name, "xvimagesink")) { + if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "waylandsink")) { vs_element = sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst; MMCAMCORDER_G_OBJECT_SET(vs_element, "zoom", (float)(zoom + 1)); @@ -3633,7 +3682,6 @@ bool _mmcamcorder_commit_strobe (MMHandleType handle, int attr_idx, const mmf_va 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"); @@ -3653,7 +3701,7 @@ bool _mmcamcorder_commit_strobe (MMHandleType handle, int attr_idx, const mmf_va int flash_brightness = 0; /* get current flash brightness */ - if (_mmcamcorder_get_device_flash_brightness(&flash_brightness) != MM_ERROR_NONE) { + if (_mmcamcorder_get_device_flash_brightness(hcamcorder->gdbus_conn, &flash_brightness) != MM_ERROR_NONE) { _mmcam_dbg_err("_mmcamcorder_get_device_flash_brightness failed"); hcamcorder->error_code = MM_ERROR_COMMON_INVALID_PERMISSION; return FALSE; @@ -3668,14 +3716,7 @@ bool _mmcamcorder_commit_strobe (MMHandleType handle, int attr_idx, const mmf_va _mmcam_dbg_err("other module already turned on flash. avoid to set flash 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_dbg_log("keep going"); } } @@ -3683,13 +3724,6 @@ bool _mmcamcorder_commit_strobe (MMHandleType handle, int attr_idx, const mmf_va 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()); - } - return TRUE; } else if (current_state == MM_CAMCORDER_STATE_CAPTURING) { _mmcam_dbg_warn("invalid state[capturing]"); @@ -3751,12 +3785,6 @@ bool _mmcamcorder_commit_strobe (MMHandleType handle, int attr_idx, const mmf_va } } - 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()); - } - return bret; } @@ -3953,6 +3981,129 @@ 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) +{ + 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); + + /* 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; + } + + /* check state */ + current_state = _mmcamcorder_get_state(handle); + if (current_state < MM_CAMCORDER_STATE_READY) { + _mmcam_dbg_log("will be applied when preview starts"); + return TRUE; + } + + return _mmcamcorder_set_encoded_preview_bitrate(handle, value->value.i_val); +} + + +bool _mmcamcorder_commit_encoded_preview_gop_interval(MMHandleType handle, int attr_idx, const mmf_value_t *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 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); + 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"); + return TRUE; + } + + return _mmcamcorder_set_encoded_preview_gop_interval(handle, value->value.i_val); +} + + +bool _mmcamcorder_commit_pid_for_sound_focus(MMHandleType handle, int attr_idx, const mmf_value_t *value) +{ + int new_pid = 0; + int current_state = MM_CAMCORDER_STATE_NONE; + mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); + + if (hcamcorder == NULL) { + _mmcam_dbg_warn("handle is NULL"); + 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); + return FALSE; + } + + new_pid = value->value.i_val; + + _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); + + /* 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"); + } + + /* 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 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; + 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); + } else { + _mmcam_dbg_log("no need to register sound focus"); + } + + return TRUE; +} + + static bool __mmcamcorder_attrs_is_supported(MMHandleType handle, int idx) { @@ -4166,17 +4317,17 @@ static bool __mmcamcorder_set_capture_resolution(MMHandleType handle, int width, } -static int -__mmcamcorder_check_valid_pair( MMHandleType handle, char **err_attr_name, const char *attribute_name, va_list var_args ) +static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_name, const char *attribute_name, va_list var_args) { #define INIT_VALUE -1 #define CHECK_COUNT 3 - mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle); + mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); MMHandleType attrs = 0; int ret = MM_ERROR_NONE; - int i = 0, j = 0; + int i = 0; + int j = 0; const char *name = NULL; const char *check_pair_name[CHECK_COUNT][3] = { {MMCAM_CAMERA_WIDTH, MMCAM_CAMERA_HEIGHT, "MMCAM_CAMERA_WIDTH and HEIGHT"}, @@ -4326,6 +4477,25 @@ __mmcamcorder_check_valid_pair( MMHandleType handle, char **err_attr_name, const return MM_ERROR_CAMCORDER_INVALID_ARGUMENT; } + if (!strcmp(check_pair_name[i][0], MMCAM_CAMERA_WIDTH)) { + int current_width = 0; + int current_height = 0; + + mm_camcorder_get_attributes(handle, NULL, + MMCAM_CAMERA_WIDTH, ¤t_width, + MMCAM_CAMERA_HEIGHT, ¤t_height, + NULL); + + if (current_width != check_pair_value[i][0] || + current_height != check_pair_value[i][1]) { + hcamcorder->resolution_changed = TRUE; + } else { + hcamcorder->resolution_changed = FALSE; + } + + _mmcam_dbg_log("resolution changed : %d", hcamcorder->resolution_changed); + } + if (err_name) { free(err_name); err_name = NULL;