Get the module index using muse configure 79/198479/1 accepted/tizen/5.0/unified/20190131.061557 accepted/tizen/5.0/unified/20190202.022409 submit/tizen_5.0/20190129.231113 submit/tizen_5.0/20190130.102940 submit/tizen_5.0/20190131.231008
authorYoungHun Kim <yh8004.kim@samsung.com>
Tue, 22 Jan 2019 07:21:39 +0000 (16:21 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Thu, 24 Jan 2019 22:44:57 +0000 (07:44 +0900)
[Version] 0.4.16
[Profile] Common
[Issue Type] Update
[Dependency module] mused(mmsvc-core)

Change-Id: Ibfcfa41ffc1a44c58a2420fad9e003bb1aefe803

packaging/capi-media-camera.spec
src/camera.c

index f0fae573afcecfa44676180d28bf8e8100e2274b..58c995ee430e93dc943aa25c1bd6e03a6b4fff59 100644 (file)
@@ -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
index 28b139912ffbdcf2623de8016dd5b586978e1a94..0ca23f3eb54912b6a0e92339de79de1124b14f37 100644 (file)
@@ -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);