Fix invalid handle parameter 94/253294/1 accepted/tizen/unified/20210209.124335 submit/tizen/20210209.044918 submit/tizen/20210209.072453
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 8 Feb 2021 10:57:29 +0000 (19:57 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 8 Feb 2021 10:57:29 +0000 (19:57 +0900)
[Version] 0.0.2
[Issue Type] Bug fix

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

index 7d5b353f035476e216ddb8f4bbdcb4369940f5e5..4fbe4e84254a6a44101a31f9e5954dcba0f61928 100644 (file)
@@ -4,7 +4,7 @@
 ### main package #########
 Name:       %{name}
 Summary:    %{name} interface
-Version:    0.0.1
+Version:    0.0.2
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0
index 598bd2434f72d5b95c9c34c576872d51e083c733..4a60148195af7b42c3bc73827217735eb8140740 100644 (file)
@@ -132,7 +132,7 @@ int hal_camera_open_device(void *camera_handle, int device_index)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->open_device, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->open_device(camera_handle, device_index);
+       return handle->funcs->open_device(handle->backend, device_index);
 }
 
 
@@ -144,7 +144,7 @@ int hal_camera_open_device_ext(void *camera_handle, const char *device_name)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->open_device_ext, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->open_device_ext(camera_handle, device_name);
+       return handle->funcs->open_device_ext(handle->backend, device_name);
 }
 
 
@@ -156,7 +156,7 @@ int hal_camera_close_device(void *camera_handle)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->close_device, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->close_device(camera_handle);
+       return handle->funcs->close_device(handle->backend);
 }
 
 
@@ -168,7 +168,7 @@ int hal_camera_add_message_callback(void *camera_handle, hal_camera_message_cb c
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->add_message_callback, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->add_message_callback(camera_handle, callback, user_data, cb_id);
+       return handle->funcs->add_message_callback(handle->backend, callback, user_data, cb_id);
 }
 
 
@@ -180,7 +180,7 @@ int hal_camera_remove_message_callback(void *camera_handle, uint32_t cb_id)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->remove_message_callback, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->remove_message_callback(camera_handle, cb_id);
+       return handle->funcs->remove_message_callback(handle->backend, cb_id);
 }
 
 
@@ -192,7 +192,7 @@ int hal_camera_set_preview_stream_format(void *camera_handle, camera_format_s *f
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->set_preview_stream_format, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->set_preview_stream_format(camera_handle, format);
+       return handle->funcs->set_preview_stream_format(handle->backend, format);
 }
 
 
@@ -204,7 +204,7 @@ int hal_camera_get_preview_stream_format(void *camera_handle, camera_format_s *f
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->get_preview_stream_format, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->get_preview_stream_format(camera_handle, format);
+       return handle->funcs->get_preview_stream_format(handle->backend, format);
 }
 
 
@@ -216,7 +216,7 @@ int hal_camera_set_user_buffer_fd(void *camera_handle, int *fds, int number)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->set_user_buffer_fd, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->set_user_buffer_fd(camera_handle, fds, number);
+       return handle->funcs->set_user_buffer_fd(handle->backend, fds, number);
 }
 
 
@@ -228,7 +228,7 @@ int hal_camera_start_preview(void *camera_handle, hal_camera_preview_frame_cb ca
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->start_preview, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->start_preview(camera_handle, callback, user_data);
+       return handle->funcs->start_preview(handle->backend, callback, user_data);
 }
 
 
@@ -240,7 +240,7 @@ int hal_camera_release_preview_buffer(void *camera_handle, int buffer_index)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->release_preview_buffer, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->release_preview_buffer(camera_handle, buffer_index);
+       return handle->funcs->release_preview_buffer(handle->backend, buffer_index);
 }
 
 
@@ -252,7 +252,7 @@ int hal_camera_stop_preview(void *camera_handle)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->stop_preview, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->stop_preview(camera_handle);
+       return handle->funcs->stop_preview(handle->backend);
 }
 
 
@@ -264,7 +264,7 @@ int hal_camera_start_auto_focus(void *camera_handle)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->start_auto_focus, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->start_auto_focus(camera_handle);
+       return handle->funcs->start_auto_focus(handle->backend);
 }
 
 
@@ -276,7 +276,7 @@ int hal_camera_stop_auto_focus(void *camera_handle)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->stop_auto_focus, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->stop_auto_focus(camera_handle);
+       return handle->funcs->stop_auto_focus(handle->backend);
 }
 
 
@@ -288,7 +288,7 @@ int hal_camera_start_capture(void *camera_handle, hal_camera_capture_cb callback
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->start_capture, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->start_capture(camera_handle, callback, user_data);
+       return handle->funcs->start_capture(handle->backend, callback, user_data);
 }
 
 
@@ -300,7 +300,7 @@ int hal_camera_stop_capture(void *camera_handle)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->stop_capture, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->stop_capture(camera_handle);
+       return handle->funcs->stop_capture(handle->backend);
 }
 
 
@@ -312,7 +312,7 @@ int hal_camera_set_video_stream_format(void *camera_handle, camera_format_s *for
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->set_video_stream_format, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->set_video_stream_format(camera_handle, format);
+       return handle->funcs->set_video_stream_format(handle->backend, format);
 }
 
 
@@ -324,7 +324,7 @@ int hal_camera_get_video_stream_format(void *camera_handle, camera_format_s *for
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->get_video_stream_format, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->get_video_stream_format(camera_handle, format);
+       return handle->funcs->get_video_stream_format(handle->backend, format);
 }
 
 
@@ -336,7 +336,7 @@ int hal_camera_start_record(void *camera_handle, hal_camera_video_frame_cb callb
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->start_record, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->start_record(camera_handle, callback, user_data);
+       return handle->funcs->start_record(handle->backend, callback, user_data);
 }
 
 
@@ -348,7 +348,7 @@ int hal_camera_release_video_buffer(void *camera_handle, int buffer_index)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->release_video_buffer, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->release_video_buffer(camera_handle, buffer_index);
+       return handle->funcs->release_video_buffer(handle->backend, buffer_index);
 }
 
 
@@ -360,7 +360,7 @@ int hal_camera_stop_record(void *camera_handle)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->stop_record, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->stop_record(camera_handle);
+       return handle->funcs->stop_record(handle->backend);
 }
 
 
@@ -372,7 +372,7 @@ int hal_camera_set_command(void *camera_handle, int64_t command, void *value)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->set_command, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->set_command(camera_handle, command, value);
+       return handle->funcs->set_command(handle->backend, command, value);
 }
 
 
@@ -384,7 +384,7 @@ int hal_camera_get_command(void *camera_handle, int64_t command, void **value)
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->get_command, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->get_command(camera_handle, command, value);
+       return handle->funcs->get_command(handle->backend, command, value);
 }
 
 
@@ -396,5 +396,5 @@ int hal_camera_set_batch_command(void *camera_handle, camera_batch_command_contr
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs, CAMERA_ERROR_INVALID_PARAMETER);
        HAL_CAMERA_RETURN_IF_FAILED(handle->funcs->set_batch_command, CAMERA_ERROR_NOT_IMPLEMENTED);
 
-       return handle->funcs->set_batch_command(camera_handle, batch_command, error_command);
+       return handle->funcs->set_batch_command(handle->backend, batch_command, error_command);
 }