int ret = CAMERA_ERROR_NONE;
int cid = 0;
int ctrl_ret = 0;
+ int set_value = 0;
camera_hal_handle *handle = NULL;
if (!camera_handle) {
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);
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;
}
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: