Update set command function 18/207718/1
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 11 Jun 2019 09:30:54 +0000 (18:30 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 11 Jun 2019 09:30:54 +0000 (18:30 +0900)
- Remove NULL check for value parameter, because it could be 0.
- Support new camera control : PTZ type, Pan, Tilt

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

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

index 3315fa4..908efe0 100644 (file)
@@ -1,6 +1,6 @@
 Name:       camera-hal-v4l2
 Summary:    Tizen Camera Hal for V4L2
-Version:    0.0.6
+Version:    0.0.7
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index bd822b1..e4d3ef3 100644 (file)
@@ -1650,11 +1650,6 @@ int camera_set_command(void *camera_handle, int64_t command, void *value)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (!value) {
-               LOGE("invalid pointer for value");
-               return CAMERA_ERROR_INVALID_PARAMETER;
-       }
-
        handle = (camera_hal_handle *)camera_handle;
 
        g_mutex_lock(&handle->lock);
@@ -1680,6 +1675,21 @@ int camera_set_command(void *camera_handle, int64_t command, void *value)
        case CAMERA_COMMAND_SHARPNESS:
                cid = V4L2_CID_SHARPNESS;
                break;
+       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);
+                       return CAMERA_ERROR_DEVICE_NOT_SUPPORTED;
+               }
+
+               return CAMERA_ERROR_NONE;
+       case CAMERA_COMMAND_PAN:
+               cid = V4L2_CID_PAN_ABSOLUTE;
+               break;
+       case CAMERA_COMMAND_TILT:
+               cid = V4L2_CID_TILT_ABSOLUTE;
+               break;
        default:
                LOGE("NOT_SUPPORTED %"PRId64, command);
                g_mutex_unlock(&handle->lock);