Add new command dispatcher(current NULL) and modify return value for dispatcher 08/119308/1
authorJeongmo Yang <jm80.yang@samsung.com>
Thu, 16 Mar 2017 07:55:25 +0000 (16:55 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Thu, 16 Mar 2017 09:01:21 +0000 (18:01 +0900)
[Version] 0.2.75
[Profile] Common
[Issue Type] Update

Change-Id: I7b89f36829dec90b4a5bb3ea995996e55022495d
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
muse/include/muse_camera.h
muse/src/muse_camera_dispatcher.c
packaging/mmsvc-camera.spec

index 3de83f2..d6c7146 100644 (file)
@@ -340,7 +340,7 @@ typedef struct {
  */
 typedef enum {
        MUSE_CAMERA_ERROR_INVALID = -1,
-       MUSE_CAMERA_ERROR_NONE = 1,
+       MUSE_CAMERA_ERROR_NONE = 0,
 } muse_camera_error_e;
 
 /**
index 37c6c0b..9aeb869 100644 (file)
@@ -1386,7 +1386,7 @@ int camera_dispatcher_create(muse_module_h module)
                ret = CAMERA_ERROR_PERMISSION_DENIED;
                LOGE("security check failed 0x%x", ret);
                muse_camera_msg_return(api, class, ret, module);
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        /* init handle */
@@ -1395,7 +1395,7 @@ int camera_dispatcher_create(muse_module_h module)
                ret = CAMERA_ERROR_OUT_OF_MEMORY;
                LOGE("handle alloc failed 0x%x", ret);
                muse_camera_msg_return(api, class, ret, module);
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        memset(muse_camera, 0x0, sizeof(muse_camera_handle_s));
@@ -1410,7 +1410,7 @@ int camera_dispatcher_create(muse_module_h module)
                ret = CAMERA_ERROR_INVALID_OPERATION;
                muse_camera_msg_return(api, class, ret, module);
 
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        ret = legacy_camera_create((camera_device_e)device_type, &muse_camera->camera_handle);
@@ -1419,7 +1419,7 @@ int camera_dispatcher_create(muse_module_h module)
                muse_camera = NULL;
                muse_camera_msg_return(api, class, ret, module);
 
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        g_mutex_init(&muse_camera->task_lock);
@@ -1492,7 +1492,7 @@ _CREATE_ERROR:
        muse_camera = NULL;
        muse_camera_msg_return(api, class, ret, module);
 
-       return MUSE_CAMERA_ERROR_NONE;
+       return MUSE_CAMERA_ERROR_INVALID;
 }
 
 
@@ -1536,7 +1536,10 @@ int camera_dispatcher_destroy(muse_module_h module)
 
        muse_camera_msg_return(api, class, ret, module);
 
-       return MUSE_CAMERA_ERROR_NONE;
+       if (ret == CAMERA_ERROR_NONE)
+               return MUSE_CAMERA_ERROR_NONE;
+       else
+               return MUSE_CAMERA_ERROR_INVALID;
 }
 
 int camera_dispatcher_start_preview(muse_module_h module)
@@ -5209,5 +5212,6 @@ int (*cmd_dispatcher[MUSE_MODULE_COMMAND_MAX])(muse_module_h module) = {
        camera_cmd_dispatcher_shutdown, /* MUSE_MODULE_COMMAND_SHUTDOWN */
        NULL, /* MUSE_MODULE_COMMAND_DEBUG_INFO_DUMP */
        NULL, /* MUSE_MODULE_COMMAND_CREATE_SERVER_ACK */
-       NULL  /* MUSE_MODULE_COMMAND_RESOURCE_NOT_AVAILABLE */
+       NULL, /* MUSE_MODULE_COMMAND_RESOURCE_NOT_AVAILABLE */
+       NULL  /* MUSE_MODULE_COMMAND_EXTERNAL_STORAGE_STATE_CHANGED */
 };
index e3d2ae7..10bcf03 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    0.2.74
+Version:    0.2.75
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0