From: Jeongmo Yang Date: Fri, 15 Jan 2016 08:34:47 +0000 (+0900) Subject: [Release version 0.2.39] Change timinig to create client handle X-Git-Tag: submit/tizen/20160115.103735^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5da9e9e8500b0fb5549cc4d3f496a9dc6d3572a1;p=platform%2Fcore%2Fapi%2Fcamera.git [Release version 0.2.39] Change timinig to create client handle Change-Id: I035abc11ff702896c7b4f8438d7d531f489954fc Signed-off-by: Jeongmo Yang --- diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index bc20c95..914e2d7 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -3,8 +3,8 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.2.38 -Release: 1 +Version: 0.2.39 +Release: 0 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/camera.c b/src/camera.c index ef92bc2..5b3b38f 100644 --- a/src/camera.c +++ b/src/camera.c @@ -1810,6 +1810,13 @@ int camera_create(camera_device_e device, camera_h* camera) goto ErrorExit; } + ret = mm_camcorder_client_create(&pc->client_handle); + if (ret != MM_ERROR_NONE) { + LOGE("camera client create Failed 0x%x", ret); + ret = __convert_camera_error_code(__func__, ret); + goto ErrorExit; + } + pc->cb_info = _client_callback_new(sock_fd); if (pc->cb_info == NULL) { LOGE("cb_info alloc failed"); @@ -1845,6 +1852,10 @@ ErrorExit: bufmgr = NULL; if (pc) { + if (pc->client_handle) { + mm_camcorder_client_destroy(pc->client_handle); + pc->client_handle = NULL; + } _client_callback_destroy(pc->cb_info); pc->cb_info = NULL; g_free(pc); @@ -2437,14 +2448,6 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ muse_camera_msg_send(api, sock_fd, pc->cb_info, ret); if (ret == CAMERA_ERROR_NONE) { - if (pc->client_handle == NULL) { - ret = mm_camcorder_client_create(&pc->client_handle); - if (ret != MM_ERROR_NONE) { - LOGE("camera client create Failed 0x%x", ret); - goto _SET_DISPLAY_ERROR; - } - } - if (muse_camera_msg_get_string(socket_path, pc->cb_info->recv_msg) == FALSE) { LOGE("failed to get socket path"); goto _SET_DISPLAY_ERROR;