Documentation fixes and code refactoring 54/313354/2
authorVibhav Aggarwal <v.aggarwal@samsung.com>
Mon, 24 Jun 2024 11:11:36 +0000 (20:11 +0900)
committerVibhav Aggarwal <v.aggarwal@samsung.com>
Mon, 24 Jun 2024 11:16:27 +0000 (20:16 +0900)
Change-Id: Ic98bf07ccc825ee48ea08f605bc8d8c4d8c20b42
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
capi/singleo_native_capi.h
common/include/SingleoCommonTypes.h
services/singleo_native_capi.cpp

index e740dd1f60ff1492a9868b28b1f83937c8d65ccf..d185f9ca252a0d02fa1166c84d80382db9a5ecad 100644 (file)
@@ -40,7 +40,7 @@ typedef void *singleo_service_h;
  *                            "0": service request will be performed in sync way. It means that user can get the result as soon as the request is completed.
  *                            "1": service request will be performed in async way. It mean that user is needed to create a new thread to get the result
  *                                 because it will be returned as soon as the service request is done so user has to wait for the result within its own thread context.
- *                Examples: singleo_service_create("service=auto_zoom, input=camera, camera_id=0, fbs=30, async=0")
+ *                Examples: singleo_service_create("service=auto_zoom, input=camera, camera_id=0, fbs=30, async=0", &handle)
  *
  * @since_tizen 9.0
  *
@@ -93,7 +93,7 @@ int singleo_service_perform(singleo_service_h handle);
 
 /**
  * @internal
- * @brief Adds a given image file name to the service as a input
+ * @brief Adds a given image file name to the service as a input.
  *
  * @since_tizen 9.0
  * @remarks With this function, user can add input image file to the the service before invoking the service.
@@ -112,7 +112,7 @@ int singleo_service_add_input_image_file(singleo_service_h handle, const char *f
 
 /**
  * @internal
- * @brief Adds a given image data to the service as a input
+ * @brief Adds a given image data to the service as a input.
  *
  * @since_tizen 9.0
  * @remarks With this function, user can add input image data to the the service before invoking the service.
@@ -140,7 +140,7 @@ int singleo_service_add_input_image_data(singleo_service_h handle, const char *o
 
 /**
  * @internal
- * @brief Adds a given raw data to the service as a input
+ * @brief Adds a given raw data to the service as a input.
  *
  * @since_tizen 9.0
  * @remarks With this function, user can add input raw data to the the service before invoking the service.
@@ -177,11 +177,7 @@ int singleo_service_add_input_raw_data(singleo_service_h handle, const char *opt
  * @retval #SINGLEO_SERVICE_ERROR_ERROR_INVALID_OPERATION Invalid operation
  *
  * @pre Create a source handle by calling singleo_service_create()
- * @pre Perform a requested service by
- *      calling singleo_service_perform(),
- *              singleo_service_perform_with_file(),
- *              singleo_service_perform_with_image_data(),
- *              or singleo_service_perform_with_raw_data()
+ * @pre Perform a requested service by calling singleo_service_perform()
  */
 int singleo_service_get_result_cnt(singleo_service_h handle, unsigned int *cnt);
 
@@ -202,11 +198,7 @@ int singleo_service_get_result_cnt(singleo_service_h handle, unsigned int *cnt);
  * @retval #SINGLEO_SERVICE_ERROR_ERROR_INVALID_OPERATION Invalid operation
  *
  * @pre Create a source handle by calling singleo_service_create()
- * @pre Perform a requested service by
- *      calling singleo_service_perform(),
- *              singleo_service_perform_with_file(),
- *              singleo_service_perform_with_image_data(),
- *              or singleo_service_perform_with_raw_data()
+ * @pre Perform a requested service by calling singleo_service_perform()
  * @pre Get a number of results by calling singleo_service_get_result_cnt()
  */
 int singleo_service_get_result_int(singleo_service_h handle, unsigned int idx, const char *key, unsigned int *value);
@@ -228,12 +220,7 @@ int singleo_service_get_result_int(singleo_service_h handle, unsigned int idx, c
  * @retval #SINGLEO_SERVICE_ERROR_ERROR_INVALID_OPERATION Invalid operation
  *
  * @pre Create a source handle by calling singleo_service_create()
- * @pre Perform a requested service by
- *      calling singleo_service_perform(),
- *              singleo_service_perform_with_file(),
- *              singleo_service_perform_with_image_data(),
- *              or singleo_service_perform_with_raw_data()
- * @pre Get a number of results by calling singleo_service_get_result_cnt()
+ * @pre Perform a requested service by calling singleo_service_perform()
  */
 int singleo_service_get_result_str(singleo_service_h handle, unsigned int idx, const char *key, char **value);
 
@@ -254,12 +241,7 @@ int singleo_service_get_result_str(singleo_service_h handle, unsigned int idx, c
  * @retval #SINGLEO_SERVICE_ERROR_ERROR_INVALID_OPERATION Invalid operation
  *
  * @pre Create a source handle by calling singleo_service_create()
- * @pre Perform a requested service by
- *      calling singleo_service_perform(),
- *              singleo_service_perform_with_file(),
- *              singleo_service_perform_with_image_data(),
- *              or singleo_service_perform_with_raw_data()
- * @pre Get a number of results by calling singleo_service_get_result_cnt()
+ * @pre Perform a requested service by calling singleo_service_perform()
  */
 int singleo_service_get_result_ptr(singleo_service_h handle, unsigned int idx, const char *key, unsigned char **ptr);
 
index d3e6ee73a620e518e67296ebed74f6fa506c6c11..962131aee9df92a84b419166ce9b2a04fef05c8f 100644 (file)
@@ -37,8 +37,6 @@ struct Point {
        int y {};
 };
 
-using VecRect = std::vector<Rect>;
-
 enum class DataType { NONE, FILE, IMAGE, RAW };
 
 enum class ImagePixelFormat { NONE, YUV420, RGB888 };
index e83b2bcc590e31788d72fb906f168972e3532f15..03e8b0bf550c2bacf9e6847be8c43d738e744a1f 100644 (file)
@@ -64,6 +64,7 @@ int singleo_service_create(const char *option, singleo_service_h *handle)
                if (service_handle)
                        delete service_handle;
 
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -98,6 +99,7 @@ int singleo_service_add_input_image_file(singleo_service_h handle, const char *f
                input_data._file_name = file_name;
                context->_service_handle->add_input(input_data);
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -122,6 +124,7 @@ int singleo_service_add_input_image_data(singleo_service_h handle, const char *o
                input_data.byte_per_pixel = byte_per_pixel;
                context->_service_handle->add_input(input_data);
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -139,6 +142,7 @@ int singleo_service_add_input_raw_data(singleo_service_h handle, const char *opt
                input_data.size_in_bytes = buffer_size_in_bytes;
                context->_service_handle->add_input(input_data);
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -155,6 +159,7 @@ int singleo_service_perform(singleo_service_h handle)
                else
                        context->_service_handle->performAsync();
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -167,6 +172,7 @@ int singleo_service_get_result_cnt(singleo_service_h handle, unsigned int *cnt)
                auto context = static_cast<Context *>(handle);
                context->_service_handle->getResultCnt(cnt);
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -179,6 +185,7 @@ int singleo_service_get_result_int(singleo_service_h handle, unsigned int idx, c
                auto context = static_cast<Context *>(handle);
                context->_service_handle->getResultInt(idx, key, value);
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -191,6 +198,7 @@ int singleo_service_register_user_callback(singleo_service_h handle, singleo_use
                auto context = static_cast<Context *>(handle);
                context->_service_handle->registerUserCallback(user_cb, user_data);
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }
 
@@ -203,6 +211,7 @@ int singleo_service_unregister_user_callback(singleo_service_h handle)
                auto context = static_cast<Context *>(handle);
                context->_service_handle->unregisterUserCallback();
        } catch (const BaseException &e) {
+               SINGLEO_LOGE("%s", e.what());
                return e.getError();
        }