From 5df00893b9178587f7196aca439bc69a0d0c0d17 Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Wed, 5 Feb 2020 17:27:39 +0900 Subject: [PATCH] [Api/CodeClean] prepare next acr Codeclean to prepare next ACR, remove unnecessary function definition. Signed-off-by: Jaeyun --- api/capi/include/nnstreamer-single.h | 19 ++---------- api/capi/src/nnstreamer-capi-single.c | 54 +++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 39 deletions(-) diff --git a/api/capi/include/nnstreamer-single.h b/api/capi/include/nnstreamer-single.h index cfefe5b..4fbb7e5 100644 --- a/api/capi/include/nnstreamer-single.h +++ b/api/capi/include/nnstreamer-single.h @@ -103,7 +103,7 @@ int ml_single_close (ml_single_h single); * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid. * @retval #ML_ERROR_STREAMS_PIPE Failed to push a buffer into source element. * @retval #ML_ERROR_TIMED_OUT Failed to get the result from sink element. - * + * @retval #ML_ERROR_OUT_OF_MEMORY Failed to allocate required memory. */ int ml_single_invoke (ml_single_h single, const ml_tensors_data_h input, ml_tensors_data_h *output); @@ -123,7 +123,7 @@ int ml_single_invoke (ml_single_h single, const ml_tensors_data_h input, ml_tens * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid. * @retval #ML_ERROR_STREAMS_PIPE Failed to push a buffer into source element. * @retval #ML_ERROR_TIMED_OUT Failed to get the result from sink element. - * + * @retval #ML_ERROR_OUT_OF_MEMORY Failed to allocate required memory. */ int ml_single_invoke_dynamic (ml_single_h single, const ml_tensors_data_h input, const ml_tensors_info_h in_info, ml_tensors_data_h *output, ml_tensors_info_h *out_info); @@ -174,21 +174,6 @@ int ml_single_get_output_info (ml_single_h single, ml_tensors_info_h *info); int ml_single_set_input_info (ml_single_h single, const ml_tensors_info_h info); /** - * @brief Sets the information (tensor dimension, type, name and so on) of required input data for the given model, and get updated output data information. - * @details Note that a model/framework may not support setting such information. - * @since_tizen 6.0 - * @param[in] single The model handle. - * @param[in] in_info The handle of input tensors information. - * @param[out] out_info The handle of output tensors information. The caller is responsible for freeing the information with ml_tensors_info_destroy(). - * @return @c 0 on success. Otherwise a negative error value. - * @retval #ML_ERROR_NONE Successful - * @retval #ML_ERROR_NOT_SUPPORTED This implies that the given framework does not support dynamic dimensions. - * Use ml_single_get_input_info() and ml_single_get_output_info() instead for this framework. - * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid. - */ -int ml_single_update_info (ml_single_h single, const ml_tensors_info_h in_info, ml_tensors_info_h *out_info); - -/** * @brief Sets the maximum amount of time to wait for an output, in milliseconds. * @since_tizen 5.5 * @param[in] single The model handle. diff --git a/api/capi/src/nnstreamer-capi-single.c b/api/capi/src/nnstreamer-capi-single.c index 4c5cc99..098d561 100644 --- a/api/capi/src/nnstreamer-capi-single.c +++ b/api/capi/src/nnstreamer-capi-single.c @@ -209,6 +209,38 @@ exit: } /** + * @brief Sets the information (tensor dimension, type, name and so on) of required input data for the given model, and get updated output data information. + * @details Note that a model/framework may not support setting such information. + * @since_tizen 6.0 + * @param[in] single The model handle. + * @param[in] in_info The handle of input tensors information. + * @param[out] out_info The handle of output tensors information. The caller is responsible for freeing the information with ml_tensors_info_destroy(). + * @return @c 0 on success. Otherwise a negative error value. + * @retval #ML_ERROR_NONE Successful + * @retval #ML_ERROR_NOT_SUPPORTED This implies that the given framework does not support dynamic dimensions. + * Use ml_single_get_input_info() and ml_single_get_output_info() instead for this framework. + * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid. + */ +static int +ml_single_update_info (ml_single_h single, + const ml_tensors_info_h in_info, ml_tensors_info_h * out_info) +{ + int status; + + if (!single || !in_info || !out_info) + return ML_ERROR_INVALID_PARAMETER; + + /* init null */ + *out_info = NULL; + + status = ml_single_set_input_info (single, in_info); + if (status != ML_ERROR_NONE) + return status; + + return ml_single_get_output_info (single, out_info); +} + +/** * @brief Gets the tensors info from tensor-filter. */ static void @@ -922,25 +954,3 @@ exit: return status; } - -/** - * @brief Sets the information (tensor dimension, type, name and so on) of required input data for the given model. - */ -int -ml_single_update_info (ml_single_h single, - const ml_tensors_info_h in_info, ml_tensors_info_h * out_info) -{ - int status; - - if (!single || !in_info || !out_info) - return ML_ERROR_INVALID_PARAMETER; - - /* init null */ - *out_info = NULL; - - status = ml_single_set_input_info (single, in_info); - if (status != ML_ERROR_NONE) - return status; - - return ml_single_get_output_info (single, out_info); -} -- 2.7.4