[C-API] apply the review guide of C-API
authorSangjung Woo <sangjung.woo@samsung.com>
Tue, 6 Aug 2019 11:28:51 +0000 (20:28 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 7 Aug 2019 10:20:45 +0000 (19:20 +0900)
* Fix the typo (targetting -> targeting)
* Use detailed comments (pipe is NULL? -> Not negotiated?)
* Use detailed URL (github.com/nnsuite/nnstreamer -> https://github.com/nnsuite/nnstreamer)
* Add '*' into omitted comment line

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
api/capi/doc/nnstreamer_doc.h
api/capi/include/nnstreamer-capi-private.h
api/capi/include/nnstreamer-single.h
api/capi/include/nnstreamer.h

index 20eae1a..f93c6f6 100644 (file)
@@ -86,7 +86,7 @@
  *
  * @section CAPI_ML_NNSTREAMER_SINGLE_FEATURE Related Features
  * This function is related with the following features:\n
   - http://tizen.org/feature/machine_learning\n
*  - http://tizen.org/feature/machine_learning\n
  *  - http://tizen.org/feature/machine_learning.inference\n
  *
  * It is recommended to probe features in your application for reliability.\n
index 03e2e49..5f78f2b 100644 (file)
 #define ML_INF_FEATURE_PATH "tizen.org/feature/machine_learning.inference"
 
 #define check_feature_state() \
-  int feature_ret = ml_get_feature_enabled(); \
-  if (ML_ERROR_NONE != feature_ret) \
-    return feature_ret;
+  do { \
+    int feature_ret = ml_get_feature_enabled(); \
+    if (ML_ERROR_NONE != feature_ret) \
+      return feature_ret; \
+  } while (0);
 
 #if defined(__TIZEN__)
   #include <dlog.h>
index 6caeeda..faf96cb 100644 (file)
@@ -22,7 +22,7 @@
  * @author MyungJoo Ham <myungjoo.ham@samsung.com>
  * @bug No known bugs except for NYI items
  *
- * @details This is targetting Tizen 5.5 M2.
+ * @details This is targeting Tizen 5.5 M2.
  */
 
 #ifndef __TIZEN_MACHINELEARNING_NNSTREAMER_SINGLE_H__
@@ -85,7 +85,7 @@ int ml_single_open (ml_single_h *single, const char *model, const ml_tensors_inf
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
- * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid (pipe is NULL?)
+ * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid (Pipeline is not negotiated yet.)
  */
 int ml_single_close (ml_single_h single);
 
index a20e05b..04b55c7 100644 (file)
@@ -237,14 +237,14 @@ typedef void (*ml_pipeline_state_cb) (ml_pipeline_state_e state, void *user_data
  * @remarks If the function succeeds, @a pipe handle must be released using ml_pipeline_destroy().
  * @remarks http://tizen.org/privilege/mediastorage is needed if @a pipeline_description is relevant to media storage.
  * @remarks http://tizen.org/privilege/externalstorage is needed if @a pipeline_description is relevant to external storage.
- * @param[in] pipeline_description The pipeline description compatible with GStreamer gst_parse_launch(). Refer to GStreamer manual or NNStreamer (github.com/nnsuite/nnstreamer) documentation for examples and the grammar.
+ * @param[in] pipeline_description The pipeline description compatible with GStreamer gst_parse_launch(). Refer to GStreamer manual or NNStreamer (https://github.com/nnsuite/nnstreamer) documentation for examples and the grammar.
  * @param[in] cb The function to be called when the pipeline state is changed. You may set NULL if it's not required.
  * @param[in] user_data Private data for the callback. This value is passed to the callback when it's invoked.
  * @param[out] pipe The NNStreamer pipeline handler from the given description.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
- * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
+ * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (Not negotiated?)
  * @retval #ML_ERROR_STREAMS_PIPE Pipeline construction is failed because of wrong parameter or initialization failure.
  * @retval #ML_ERROR_PERMISSION_DENIED The application does not have the privilege to access to the media storage or external storage.
  */
@@ -258,7 +258,7 @@ int ml_pipeline_construct (const char *pipeline_description, ml_pipeline_state_c
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
- * @retval #ML_ERROR_INVALID_PARAMETER The parameter is invalid (pipe is NULL?)
+ * @retval #ML_ERROR_INVALID_PARAMETER The parameter is invalid (Not negotiated?)
  * @retval #ML_ERROR_STREAMS_PIPE Cannot access the pipeline status.
  */
 int ml_pipeline_destroy (ml_pipeline_h pipe);
@@ -272,7 +272,7 @@ int ml_pipeline_destroy (ml_pipeline_h pipe);
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
- * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
+ * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (Not negotiated?)
  * @retval #ML_ERROR_STREAMS_PIPE Failed to get state from the pipeline.
  */
 int ml_pipeline_get_state (ml_pipeline_h pipe, ml_pipeline_state_e *state);
@@ -290,7 +290,7 @@ int ml_pipeline_get_state (ml_pipeline_h pipe, ml_pipeline_state_e *state);
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
- * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
+ * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (Not negotiated?)
  * @retval #ML_ERROR_STREAMS_PIPE Failed to start the pipeline.
  */
 int ml_pipeline_start (ml_pipeline_h pipe);
@@ -305,7 +305,7 @@ int ml_pipeline_start (ml_pipeline_h pipe);
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
- * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
+ * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (Not negotiated?)
  * @retval #ML_ERROR_STREAMS_PIPE Failed to stop the pipeline.
  */
 int ml_pipeline_stop (ml_pipeline_h pipe);
@@ -325,7 +325,7 @@ int ml_pipeline_stop (ml_pipeline_h pipe);
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
- * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL, sink_name is not found, or sink_name has an invalid type.)
+ * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (Not negotiated, sink_name is not found, or sink_name has an invalid type.)
  * @retval #ML_ERROR_STREAMS_PIPE Failed to connect a signal to sink element.
  */
 int ml_pipeline_sink_register (ml_pipeline_h pipe, const char *sink_name, ml_pipeline_sink_cb cb, void *user_data, ml_pipeline_sink_h *sink_handle);