Update set command function 25/207825/3 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.014411 accepted/tizen/5.5/unified/mobile/hotfix/20201027.082610 accepted/tizen/unified/20190614.051607 submit/tizen/20190613.080726 submit/tizen_5.5/20191031.000001 submit/tizen_5.5_mobile_hotfix/20201026.185101 tizen_5.5.m2_release
authorJeongmo Yang <jm80.yang@samsung.com>
Thu, 13 Jun 2019 06:24:54 +0000 (15:24 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Thu, 13 Jun 2019 06:55:16 +0000 (15:55 +0900)
- Convert (void *) to (int *) and use it.

[Version] 0.0.9
[Profile] Common
[Issue Type] Update

Change-Id: I24d185c4ddb5f7651c17a0a57573251a9c92a8cf
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/camera-hal-v4l2.spec
src/tizen_camera_v4l2.c

index d22a8ed..cc1a87f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       camera-hal-v4l2
 Summary:    Tizen Camera Hal for V4L2
-Version:    0.0.8
+Version:    0.0.9
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 5f96527..5996772 100644 (file)
@@ -1642,6 +1642,7 @@ int camera_set_command(void *camera_handle, int64_t command, void *value)
        int ret = CAMERA_ERROR_NONE;
        int cid = 0;
        int ctrl_ret = 0;
+       int set_value = 0;
        camera_hal_handle *handle = NULL;
 
        if (!camera_handle) {
@@ -1649,7 +1650,13 @@ int camera_set_command(void *camera_handle, int64_t command, void *value)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
+       if (!value) {
+               LOGE("invalid pointer : value");
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
        handle = (camera_hal_handle *)camera_handle;
+       set_value = *(int *)value;
 
        g_mutex_lock(&handle->lock);
 
@@ -1677,8 +1684,8 @@ int camera_set_command(void *camera_handle, int64_t command, void *value)
        case CAMERA_COMMAND_PTZ_TYPE:
                g_mutex_unlock(&handle->lock);
 
-               if ((int)(long)value != CAMERA_PTZ_TYPE_ELECTRONIC) {
-                       LOGE("not supported PTZ type %d", (int)(long)value);
+               if (set_value != CAMERA_PTZ_TYPE_ELECTRONIC) {
+                       LOGE("not supported PTZ type %d", set_value);
                        return CAMERA_ERROR_DEVICE_NOT_SUPPORTED;
                }
 
@@ -1695,7 +1702,7 @@ int camera_set_command(void *camera_handle, int64_t command, void *value)
                return CAMERA_ERROR_DEVICE_NOT_SUPPORTED;
        }
 
-       ctrl_ret = _camera_v4l2_s_ctrl(handle->device_fd, cid, ((int)(long)value));
+       ctrl_ret = _camera_v4l2_s_ctrl(handle->device_fd, cid, set_value);
        if (ctrl_ret < 0) {
                switch (errno) {
                case EACCES: