diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2019-06-13 15:24:54 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2019-06-13 15:55:16 +0900 |
commit | 2150e4c44a29bc0e146ea1036091c13e62c3bd57 (patch) | |
tree | 579237bdb2865f5e2b1df68dce569cb2b10c46bb /src/tizen_camera_v4l2.c | |
parent | 70d87d285e6536d76ac53e4157af39d52b29aaed (diff) | |
download | camera-hal-v4l2-2150e4c44a29bc0e146ea1036091c13e62c3bd57.tar.gz camera-hal-v4l2-2150e4c44a29bc0e146ea1036091c13e62c3bd57.tar.bz2 camera-hal-v4l2-2150e4c44a29bc0e146ea1036091c13e62c3bd57.zip |
Update set command functiontizen_5.5.m2_releasesubmit/tizen_5.5_mobile_hotfix/20201026.185101submit/tizen_5.5/20191031.000001submit/tizen/20190613.080726accepted/tizen/unified/20190614.051607accepted/tizen/5.5/unified/mobile/hotfix/20201027.082610accepted/tizen/5.5/unified/20191031.014411tizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_mobile_hotfix
- 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>
Diffstat (limited to 'src/tizen_camera_v4l2.c')
-rw-r--r-- | src/tizen_camera_v4l2.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/tizen_camera_v4l2.c b/src/tizen_camera_v4l2.c index 5f96527..5996772 100644 --- a/src/tizen_camera_v4l2.c +++ b/src/tizen_camera_v4l2.c @@ -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: |