From: YoungHun Kim Date: Tue, 22 Jan 2019 07:21:39 +0000 (+0900) Subject: Get the module index using muse configure X-Git-Tag: submit/tizen_5.0/20190129.231113^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abdb85c7c8159edd327e1f80ced74bb9526e044d;p=platform%2Fcore%2Fapi%2Fcamera.git Get the module index using muse configure [Version] 0.4.16 [Profile] Common [Issue Type] Update [Dependency module] mused(mmsvc-core) Change-Id: Ibfcfa41ffc1a44c58a2420fad9e003bb1aefe803 --- diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index f0fae57..58c995e 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.15 +Version: 0.4.16 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index 28b1399..0ca23f3 100644 --- a/src/camera.c +++ b/src/camera.c @@ -34,6 +34,7 @@ #undef LOG_TAG #endif #define LOG_TAG "TIZEN_N_CAMERA" +#define MODULE_NAME "camera" /* for device changed callback */ static GMutex g_cam_dev_state_changed_cb_lock; @@ -2311,6 +2312,7 @@ int _camera_independent_request(int api, int device_type, const char *key, int * { int ret = CAMERA_ERROR_NONE; int sock_fd = -1; + int module_index = -1; char *msg = NULL; char recv_msg[MUSE_CAMERA_MSG_MAX_LENGTH] = {'\0',}; @@ -2326,8 +2328,14 @@ int _camera_independent_request(int api, int device_type, const char *key, int * return CAMERA_ERROR_INVALID_OPERATION; } + if (muse_client_get_module_index(MODULE_NAME, &module_index) != MM_ERROR_NONE) { + LOGE("muse client get module index failed"); + ret = CAMERA_ERROR_INVALID_OPERATION; + goto _REQUEST_EXIT; + } + msg = muse_core_msg_new(api, - MUSE_TYPE_INT, "module", MUSE_CAMERA, + MUSE_TYPE_INT, "module", module_index, MUSE_TYPE_INT, PARAM_DEVICE_TYPE, device_type, 0); if (!msg) { @@ -2386,7 +2394,7 @@ int camera_create(camera_device_e device, camera_h *camera) tbm_bufmgr bufmgr = NULL; muse_camera_api_e api = MUSE_CAMERA_API_CREATE; - muse_core_api_module_e muse_module = MUSE_CAMERA; + int module_index = -1; int device_type = (int)device; if (!camera) { @@ -2403,8 +2411,14 @@ int camera_create(camera_device_e device, camera_h *camera) pid = getpid(); + if (muse_client_get_module_index(MODULE_NAME, &module_index) != MM_ERROR_NONE) { + LOGE("muse client get module index failed"); + ret = CAMERA_ERROR_INVALID_OPERATION; + goto ErrorExit; + } + send_msg = muse_core_msg_new(api, - MUSE_TYPE_INT, "module", muse_module, + MUSE_TYPE_INT, "module", module_index, MUSE_TYPE_INT, PARAM_DEVICE_TYPE, device_type, MUSE_TYPE_INT, "pid", pid, 0);