Update set command function
[platform/adaptation/camera-hal-v4l2.git] / src / tizen_camera_v4l2.c
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);