[CodeClean] fix typo
authorJaeyun Jung <jy1210.jung@samsung.com>
Mon, 22 Apr 2024 06:33:33 +0000 (15:33 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Tue, 23 Apr 2024 05:47:05 +0000 (14:47 +0900)
Code clean, fix indent and typo in source files.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
16 files changed:
CODE_OF_CONDUCT.md
CONTRIBUTING.md
gst/nnstreamer/include/nnstreamer_cppplugin_api_filter.hh
gst/nnstreamer/include/nnstreamer_plugin_api.h
gst/nnstreamer/include/nnstreamer_plugin_api_converter.h
gst/nnstreamer/include/nnstreamer_plugin_api_decoder.h
gst/nnstreamer/include/nnstreamer_plugin_api_filter.h
gst/nnstreamer/include/nnstreamer_plugin_api_trainer.h
gst/nnstreamer/include/nnstreamer_plugin_api_util.h
gst/nnstreamer/include/tensor_decoder_custom.h
gst/nnstreamer/include/tensor_filter_custom.h
gst/nnstreamer/include/tensor_typedef.h
gst/nnstreamer/nnstreamer_plugin_api_util_impl.c
gst/nnstreamer/tensor_filter/tensor_filter_common.c
jni/Android-app.mk
tests/unittest_mlagent/unittest_mlagent.cc

index 71ae5f1..72b7118 100644 (file)
@@ -6,7 +6,7 @@ title: Code of conduct
 
 ## Our Pledge
 
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project based on meritocracy and our community a harassment-free experience for everyone.
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project based on meritocracy and our community a harassment-free experience for everyone.
 
 ## Our Standards
 
@@ -35,7 +35,7 @@ Project maintainers have the right and responsibility to remove, edit, or reject
 
 By submitting a code, you are guaranteeing, up your best knowledge, that
 * The content of the submitted code is not patented or you are providing the right to practice the related patents according to the license of NNStreamer to NNStreamer users and developers.
-* You have the right to contribute the code; you have the copyright (or the copyright holder has permitted to submit the code to NNStreamer). If your code is done for a employer, the employer may have the right to the code.
+* You have the right to contribute the code; you have the copyright (or the copyright holder has permitted to submit the code to NNStreamer). If your code is done for an employer, the employer may have the right to the code.
 * You have tested and verified the code.
 * You allow the maintainers to update the license of the project later as long as the update does not conflict with the base code of this project. The base code is the code before your contribution.
 
index e93e5a4..70f7627 100644 (file)
@@ -63,7 +63,7 @@ Every contributor is able and encouraged to review codes and to participate in o
 
 A committer is responsible for reviewing incoming pull-requests and is able to reject or approve pull requests. Note that contributors may review pull-requests, but they cannot reject it or vote for approval.
 
-A contributor may become a committer with approvals of more than half of the committers. 
+A contributor may become a committer with approvals of more than half of the committers.
 
 A committer may be retired by approvals of more than half of the committers.
 
index 5c7c2ec..4b1cea9 100644 (file)
@@ -78,20 +78,20 @@ class tensor_filter_subplugin
   /** Helper function */
   static inline tensor_filter_subplugin *get_tfsp_with_checks (void *ptr);
   /** tensor_filter/C wrapper functions */
-  static int cpp_open (const GstTensorFilterProperties *prop, void **private_data); /**< C wrapper func, open */
-  static void cpp_close (const GstTensorFilterProperties *prop, void **private_data); /**< C wrapper func, close */
+  static int cpp_open (const GstTensorFilterProperties *prop, void **private_data); /**< C wrapper function, open */
+  static void cpp_close (const GstTensorFilterProperties *prop, void **private_data); /**< C wrapper function, close */
   static int cpp_invoke (const GstTensorFilterFramework *tf,
       GstTensorFilterProperties *prop, void *private_data, const GstTensorMemory *input,
-      GstTensorMemory *output); /**< C V1 wrapper func, invoke */
+      GstTensorMemory *output); /**< C V1 wrapper function, invoke */
   static int cpp_getFrameworkInfo (const GstTensorFilterFramework *tf,
       const GstTensorFilterProperties *prop, void *private_data,
-      GstTensorFilterFrameworkInfo *fw_info); /**< C V1 wrapper func, getFrameworkInfo */
+      GstTensorFilterFrameworkInfo *fw_info); /**< C V1 wrapper function, getFrameworkInfo */
   static int cpp_getModelInfo (const GstTensorFilterFramework *tf,
       const GstTensorFilterProperties *prop, void *private_data,
-      model_info_ops ops, GstTensorsInfo *in_info, GstTensorsInfo *out_info); /**< C V1 wrapper func, getModelInfo */
+      model_info_ops ops, GstTensorsInfo *in_info, GstTensorsInfo *out_info); /**< C V1 wrapper function, getModelInfo */
   static int cpp_eventHandler (const GstTensorFilterFramework *tf,
       const GstTensorFilterProperties *prop, void *private_data, event_ops ops,
-      GstTensorFilterFrameworkEventData *data); /**< C V1 wrapper func, eventHandler */
+      GstTensorFilterFrameworkEventData *data); /**< C V1 wrapper function, eventHandler */
 
   GstTensorFilterFramework fwdesc; /**< Represents C/V1 wrapper for the derived
                                       class and its objects. Derived should not
@@ -129,8 +129,8 @@ class tensor_filter_subplugin
    * @brief Unregister the registered "derived" class.
    * @detail The registered derived class may unregister itself if it can
    *         guarantee that the class won't be used anymore; i.e., at its
-   * exit(). The derived class type should be the template typename.
-   * @param [in] emptyInstance An emptyInstance that mey be "delete"d by this
+   *         exit(). The derived class type should be the template typename.
+   * @param [in] emptyInstance An emptyInstance that may be "delete"d by this
    *             function. It may be created by getEmptyInstance() or the one
    *             created by register_subplugin(); It is recommended to keep
    *             the object created by register_subplugin() and feed it to
@@ -158,7 +158,7 @@ class tensor_filter_subplugin
    ** These should be filled/implemented by subplugin authors **
    *************************************************************/
   tensor_filter_subplugin ();
-  /**< Creates a non-functional "empty" object
+  /**< Creates a non-functional "empty" object.
        Subplugin (derived class) should make a constructor with same role and input arguments!
     */
 
@@ -193,18 +193,18 @@ class tensor_filter_subplugin
   virtual int getModelInfo (model_info_ops ops, GstTensorsInfo &in_info, GstTensorsInfo &out_info)
       = 0;
   /**< Mandatory virtual method.
-   *  For a given opened model (an instance of the derived class),
+   * For a given opened model (an instance of the derived class),
    * provide input/output dimensions.
-   *  At least one of the two possible ops should be available.
-   *  Return -ENOENT if the ops is not available by this object
-   *  Return -EINVAL if it is an invalid request.
+   * At least one of the two possible ops should be available.
+   * Return -ENOENT if the ops is not available by this object
+   * Return -EINVAL if it is an invalid request.
    */
 
   virtual int eventHandler (event_ops ops, GstTensorFilterFrameworkEventData &data);
   /**< Optional. If not implemented, no event is handled
-   *  Return -ENOENT if the ops is not to be handled by this object
+   * Return -ENOENT if the ops is not to be handled by this object
    *                 (e.g., let the framework do "free")
-   *  Return -EINVAL if it is an invalid request.
+   * Return -EINVAL if it is an invalid request.
    */
 };
 
index bb6e947..fbaa58b 100644 (file)
@@ -110,7 +110,7 @@ extern void
 gst_tensor_caps_update_dimension (GstCaps *caps, GstCaps *filter);
 
 /**
- * @brief  Try intersecting @caps1 and @caps2 for tensor stream
+ * @brief Try intersecting @caps1 and @caps2 for tensor stream
  * @param caps1 a GstCaps to intersect
  * @param caps2 a GstCaps to intersect
  * @return TRUE if intersection would be not empty.
index dbc5fc5..75860ac 100644 (file)
@@ -42,7 +42,7 @@ typedef struct _NNStreamerExternalConverter
 {
   const char *name;
 
-  /* 1. chain func, data handling. */
+  /* 1. chain function, data handling. */
   GstBuffer *(*convert) (GstBuffer * in_buf, GstTensorsConfig * config, void *priv_data);
   /**< Convert the given input stream to tensor/tensors stream.
    *
index c45a855..d960f99 100644 (file)
@@ -59,7 +59,7 @@ typedef struct _GstTensorDecoderDef
        * @return TRUE if OK. FALSE if error.
        */
   GstCaps *(*getOutCaps) (void **private_data, const GstTensorsConfig *config);
-      /**< The caller should unref the returned GstCaps.
+      /**< The caller should unref the returned GstCaps using gst_caps_unref().
        * The sub-plugin should validate the information of input tensor and return proper media type.
        * Note that the information of input tensor is not a fixed value and the pipeline may try different values during the cap negotiations.
        * Do NOT allocate or fix internal data structure until decode is called.
index b678ea5..3bb41bd 100644 (file)
@@ -84,7 +84,7 @@ typedef enum
 
   /** If there is no default config, and device needs to be specified, fallback to ACCL_AUTO */
   ACCL_AUTO    = 0x1,        /**< choose optimized device automatically */
-  ACCL_DEFAULT = 0x2,     /**< use default device configuration by the framework */
+  ACCL_DEFAULT = 0x2,        /**< use default device configuration by the framework */
 
   /** Enables acceleration, 0xn000 any version of that device, 0xnxxx: device # xxx-1 */
   ACCL_CPU          = 0x1000,     /**< specify device as CPU, if possible */
@@ -113,7 +113,7 @@ typedef struct _GstTensorFilterProperties
 {
   const char *fwname; /**< The name of NN Framework */
   int fw_opened; /**< TRUE IF open() is called or tried. Use int instead of gboolean because this is refered by custom plugins. */
-  const char **model_files; /**< Filepath to the model file (as an argument for NNFW). char instead of gchar for non-glib custom plugins */
+  const char **model_files; /**< File path to the model file (as an argument for NNFW). char instead of gchar for non-glib custom plugins */
   int num_models; /**< number of model files. Some frameworks need multiple model files to initialize the graph (caffe, caffe2) */
 
   int input_configured; /**< TRUE if input tensor is configured. Use int instead of gboolean because this is refered by custom plugins. */
@@ -128,7 +128,7 @@ typedef struct _GstTensorFilterProperties
 
   const char *custom_properties; /**< sub-plugin specific custom property values in string */
   accl_hw *hw_list; /**< accelerators supported by framework intersected with user provided accelerator preference, use in GstTensorFilterFramework V1 only */
-  int num_hw;       /**< number of hardare accelerators in the hw_list supported by the framework */
+  int num_hw;       /**< number of hardware accelerators in the hw_list supported by the framework */
   const char *accl_str; /**< accelerator configuration passed in as parameter, use in GstTensorFilterFramework V0 only */
   char *shared_tensor_filter_key; /**< the shared instance key to use same model representation */
 
@@ -150,21 +150,21 @@ typedef struct _GstTensorFilterFrameworkStatistics
 /**
  * @brief Tensor_Filter Subplugin framework related information
  *
- * All the information except the supported acclerator is provided statically.
+ * All the information except the supported accelerator is provided statically.
  * Accelerators can be provided based on static or dynamic check dependent on framework support.
  */
 typedef struct _GstTensorFilterFrameworkInfo
 {
   const char *name; /**< Name of the neural network framework, searchable by FRAMEWORK property. Subplugin is supposed to allocate/deallocate. */
-  int allow_in_place; /**< TRUE(nonzero) if InPlace transfer of input-to-output is allowed. Not supported in main, yet */
-  int allocate_in_invoke; /**< TRUE(nonzero) if invoke_NN is going to allocate outputptr by itself and return the address via outputptr. Do not change this value after cap negotiation is complete (or the stream has been started). */
+  int allow_in_place; /**< TRUE(nonzero) if in-place transfer of input-to-output is allowed. Not supported in main, yet. */
+  int allocate_in_invoke; /**< TRUE(nonzero) if invoke_NN is going to allocate output ptr by itself and return the address via output ptr. Do not change this value after cap negotiation is complete (or the stream has been started). */
   int run_without_model; /**< TRUE(nonzero) when the neural network framework does not need a model file. Tensor-filter will run invoke_NN without model. */
   int verify_model_path; /**< TRUE(nonzero) when the NNS framework, not the sub-plugin, should verify the path of model files. */
-  const accl_hw *hw_list; /**< List of supported hardwares by the framework.  Positive response of this check does not guarantee successful running of model with this accelerator. Subplugin is supposed to allocate/deallocate. */
-  int num_hw; /**< number of hardware accelerators in the hw_list supported by the framework */
-  accl_hw accl_auto;  /**< accelerator to be used in auto mode (acceleration to be used but accelerator is not specified for the filter) - default -1 implies use first entry from hw_list */
-  accl_hw accl_default;   /**< accelerator to be used by default (valid user input is not provided) - default -1 implies use first entry from hw_list*/
-  const GstTensorFilterFrameworkStatistics *statistics;  /**< usage statistics by the framework. This is shared across all opened instances of this framework */
+  const accl_hw *hw_list; /**< List of supported hardware accelerators by the framework. Positive response of this check does not guarantee successful running of model with this accelerator. Subplugin is supposed to allocate/deallocate. */
+  int num_hw; /**< number of hardware accelerators in the hw_list supported by the framework. */
+  accl_hw accl_auto;  /**< accelerator to be used in auto mode (acceleration to be used but accelerator is not specified for the filter) - default -1 implies use first entry from hw_list. */
+  accl_hw accl_default;   /**< accelerator to be used by default (valid user input is not provided) - default -1 implies use first entry from hw_list*/
+  const GstTensorFilterFrameworkStatistics *statistics;  /**< usage statistics by the framework. This is shared across all opened instances of this framework. */
 } GstTensorFilterFrameworkInfo;
 
 /**
@@ -175,7 +175,7 @@ typedef struct _GstTensorFilterFrameworkInfo
 typedef enum
 {
   DESTROY_NOTIFY,   /**< Free the data element allocated in the invoke callback */
-  RELOAD_MODEL,     /**< Reloads the subplugin with newely provided model */
+  RELOAD_MODEL,     /**< Reloads the subplugin with newly provided model */
   CUSTOM_PROP,      /**< Update the custom properties for the framework */
   SET_INPUT_PROP,   /**< Update input tensor info and layout */
   SET_OUTPUT_PROP,  /**< Update output tensor info and layout */
@@ -206,7 +206,7 @@ typedef struct _GstTensorFilterFrameworkEventData
 
     /** for RELOAD_MODEL event */
     struct {
-      const char **model_files;  /**< Filepath to the new list of model files */
+      const char **model_files;  /**< File path to the new list of model files */
       int num_models;   /**< Updated number of the model files */
     };
 
@@ -224,7 +224,7 @@ typedef struct _GstTensorFilterFrameworkEventData
     /** for SET_ACCELERATOR event */
     struct {
       accl_hw *hw_list;   /**< accelerators supported by framework intersected with the new user provided accelerator preference */
-      int num_hw;         /**< number of hardare accelerators in the hw_list supported by the framework */
+      int num_hw;         /**< number of hardware accelerators in the hw_list supported by the framework */
     };
 
     /** for CHECK_HW_AVAILABILITY */
@@ -248,24 +248,24 @@ struct _GstTensorFilterFramework
 {
   uint64_t version;
   /**< Version of the struct
-   * | 32bit (validity check) | 16bit (API version) | 16bit (Subplugin's internal version. Tensor_filter does not care) |
+   * | 32bit (validity check) | 16bit (API version) | 16bit (Subplugin's internal version. Tensor-filter does not care.) |
    * API version will be 0x0 (earlier version (_GstTensorFilterFramework_v0)) or 0x1 (newer version (_GstTensorFilterFramework_v1))
    */
 
   int (*open) (const GstTensorFilterProperties * prop, void **private_data);
-  /**< Optional. tensor_filter_common.c will call this before any of other callbacks and will call once before calling close.
+  /**< Optional. Tensor-filter will call this before any of other callbacks and will call once before calling close.
    *
    * Note: If 'open' callback is not defined, then the private_data passed in other callbacks will be NULL.
    *
-   * @param[in] prop read-only property values
+   * @param[in] prop read-only property values.
    * @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer. Normally, open() allocates memory for private_data.
    * @return 0 if ok. < 0 if error.
    */
 
   void (*close) (const GstTensorFilterProperties * prop, void **private_data);
-  /**< Optional. tensor_filter_common.c will not call other callbacks after calling close. Free-ing private_data is this function's responsibility. Set NULL after that.
+  /**< Optional. Tensor-filter will not call other callbacks after calling close. Free-ing private_data is this function's responsibility. Set NULL after that.
    *
-   * @param[in] prop read-only property values
+   * @param[in] prop read-only property values.
    * @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer. Normally, close() frees private_data and set NULL.
    */
 
@@ -280,12 +280,12 @@ struct _GstTensorFilterFramework
     struct /** _GstTensorFilterFramework_v0 */
     {
       char *name; /**< Name of the neural network framework, searchable by FRAMEWORK property */
-      int allow_in_place; /**< TRUE(nonzero) if InPlace transfer of input-to-output is allowed. Not supported in main, yet */
-      int allocate_in_invoke; /**< TRUE(nonzero) if invoke_NN is going to allocate outputptr by itself and return the address via outputptr. Do not change this value after cap negotiation is complete (or the stream has been started). */
+      int allow_in_place; /**< TRUE(nonzero) if in-place transfer of input-to-output is allowed. Not supported in main, yet */
+      int allocate_in_invoke; /**< TRUE(nonzero) if invoke_NN is going to allocate output ptr by itself and return the address via output ptr. Do not change this value after cap negotiation is complete (or the stream has been started). */
       int run_without_model; /**< TRUE(nonzero) when the neural network framework does not need a model file. Tensor-filter will run invoke_NN without model. */
       int verify_model_path; /**< TRUE(nonzero) when the NNS framework, not the sub-plugin, should verify the path of model files. */
 
-      const GstTensorFilterFrameworkStatistics *statistics;  /**< usage statistics by the framework. This is shared across all opened instances of this framework */
+      const GstTensorFilterFrameworkStatistics *statistics;  /**< usage statistics by the framework. This is shared across all opened instances of this framework. */
 
       int (*invoke_NN) (const GstTensorFilterProperties * prop, void **private_data,
           const GstTensorMemory * input, GstTensorMemory * output);
@@ -302,7 +302,7 @@ struct _GstTensorFilterFramework
           void **private_data, GstTensorsInfo * info);
       /**< Optional. Set NULL if not supported. Get dimension of input tensor
        * If getInputDimension is NULL, setInputDimension must be defined.
-       * If getInputDimension is defined, it is recommended to define getOutputDimension
+       * If getInputDimension is defined, it is recommended to define getOutputDimension.
        *
        * @param[in] prop read-only property values
        * @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer.
@@ -314,7 +314,7 @@ struct _GstTensorFilterFramework
           void **private_data, GstTensorsInfo * info);
       /**< Optional. Set NULL if not supported. Get dimension of output tensor
        * If getInputDimension is NULL, setInputDimension must be defined.
-       * If getInputDimension is defined, it is recommended to define getOutputDimension
+       * If getInputDimension is defined, it is recommended to define getOutputDimension.
        *
        * @param[in] prop read-only property values
        * @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer.
@@ -325,13 +325,13 @@ struct _GstTensorFilterFramework
       int (*setInputDimension) (const GstTensorFilterProperties * prop,
           void **private_data, const GstTensorsInfo * in_info,
           GstTensorsInfo * out_info);
-      /**< Optional. Set Null if not supported.Tensor_Filter::main will
+      /**< Optional. Set Null if not supported. Tensor_Filter::main will
        * configure input dimension from pad-cap in run-time for the sub-plugin.
        * Then, the sub-plugin is required to return corresponding output dimension
        * If this is NULL, both getInput/OutputDimension must be non-NULL.
        *
        * When you use this, do NOT allocate or fix internal data structure based on it
-       * until invoke is called. Gstreamer may try different dimensions before
+       * until invoke is called. GStreamer may try different dimensions before
        * settling down.
        *
        * @param[in] prop read-only property values
@@ -342,14 +342,14 @@ struct _GstTensorFilterFramework
        */
 
       void (*destroyNotify) (void **private_data, void * data);
-      /**< Optional. tensor_filter_common.c will call it when 'allocate_in_invoke' flag of the framework is TRUE and allocateInInvoke also return enabled. Basically, it is called when the data element is destroyed. If it's set as NULL, g_free() will be used as a default. It will be helpful when the data pointer is included as an object of a nnfw. For instance, if the data pointer is removed when the object is gone, it occurs error. In this case, the objects should be maintained for a while first and destroyed when the data pointer is destroyed. Those kinds of logic could be defined at this method.
+      /**< Optional. Tensor-filter will call it when 'allocate_in_invoke' flag of the framework is TRUE and allocateInInvoke also return enabled. Basically, it is called when the data element is destroyed. If it's set as NULL, g_free() will be used as a default. It will be helpful when the data pointer is included as an object of a nnfw. For instance, if the data pointer is removed when the object is gone, it occurs error. In this case, the objects should be maintained for a while first and destroyed when the data pointer is destroyed. Those kinds of logic could be defined at this method.
        *
        * @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer.
        * @param[in] data the data element.
        */
 
       int (*reloadModel) (const GstTensorFilterProperties * prop, void **private_data);
-      /**< Optional. tensor_filter_common.c will call it when a model property is newly configured. Also, 'is-updatable' property of the framework should be TRUE. This function reloads a new model specified in the 'prop' argument. Note that it requires extra memory size enough to temporarily hold both old and new models during this function to hide the reload overhead.
+      /**< Optional. Tensor-filter will call it when a model property is newly configured. Also, 'is-updatable' property of the framework should be TRUE. This function reloads a new model specified in the 'prop' argument. Note that it requires extra memory size enough to temporarily hold both old and new models during this function to hide the reload overhead.
        *
        * @param[in] prop read-only property values
        * @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer. Normally, close() frees private_data and set NULL.
@@ -374,7 +374,7 @@ struct _GstTensorFilterFramework
        */
 
       int (*allocateInInvoke) (void **private_data);
-      /**< Optional. tensor_filter_common.c will call it when allocate_in_invoke is set to TRUE. This check if the provided model for the framework supports allocation at invoke or not. If this is not defined, then the value of allocate_in_invoke is assumed to be final for all models.
+      /**< Optional. Tensor-filter will call it when allocate_in_invoke is set to TRUE. This check if the provided model for the framework supports allocation at invoke or not. If this is not defined, then the value of allocate_in_invoke is assumed to be final for all models.
        *
        * @param[in] private_data A subplugin may save its internal private data here.
        * @return 0 if supported. -errno if not supported.
@@ -430,7 +430,7 @@ struct _GstTensorFilterFramework
        *
        * Note: With SET_INPUT_INFO operation, the caller must NOT allocate or fix
        * internal data structure based on the return value until invoke is called.
-       * Gstreamer may try different dimensions before settling down.
+       * GStreamer may try different dimensions before settling down.
        *
        * @param[in] prop read-only property values
        * @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer.
@@ -444,12 +444,12 @@ struct _GstTensorFilterFramework
           const GstTensorFilterProperties * prop,
           void *private_data, event_ops ops, GstTensorFilterFrameworkEventData * data);
       /**< Mandatory callback. Runs the event corresponding to the passed operation.
-       * If ops == DESTROY_NOTIFY: tensor_filter_common.c will call it when 'allocate_in_invoke' property of the framework is TRUE. Basically, it is called when the data element is destroyed. If it's set as NULL, g_free() will be used as a default. It will be helpful when the data pointer is included as an object of a nnfw. For instance, if the data pointer is removed when the object is gone, it occurs error. In this case, the objects should be maintained for a while first and destroyed when the data pointer is destroyed. Those kinds of logic could be defined at this method.
-       * If ops == RELOAD_MODEL: tensor_filter_common.c will call it when a model property is newly configured. Also, 'is-updatable' property of the framework should be TRUE. This function reloads a new model passed in as argument via data. Note that it requires extra memory size enough to temporarily hold both old and new models during this function to hide the reload overhead.
-       * If ops == CUSTOM_PROP: tensor_filter will call to update the custom properties of the subplugin.
-       * If ops == SET_INPUT_PROP: tensor_filter will call to update the property of the subplugin. This function will take tensor info and layout as the argument. This operation can update input tensor shape, type, name and layout.
-       * If ops == SET_OUTPUT_PROP: tensor_filter will call to update the property of the subplugin. This function will take tensor info and layout as the argument. This operation can update output tensor shape, type, name and layout.
-       * If ops == SET_ACCELERATOR: tensor_filter will call to update the property of the subplugin. This function will take accelerator list as the argument. This operation will update the backend to be used by the corresponding subplugin.
+       * If ops == DESTROY_NOTIFY: Tensor-filter will call it when 'allocate_in_invoke' property of the framework is TRUE. Basically, it is called when the data element is destroyed. If it's set as NULL, g_free() will be used as a default. It will be helpful when the data pointer is included as an object of a nnfw. For instance, if the data pointer is removed when the object is gone, it occurs error. In this case, the objects should be maintained for a while first and destroyed when the data pointer is destroyed. Those kinds of logic could be defined at this method.
+       * If ops == RELOAD_MODEL: Tensor-filter will call it when a model property is newly configured. Also, 'is-updatable' property of the framework should be TRUE. This function reloads a new model passed in as argument via data. Note that it requires extra memory size enough to temporarily hold both old and new models during this function to hide the reload overhead.
+       * If ops == CUSTOM_PROP: Tensor-filter will call to update the custom properties of the subplugin.
+       * If ops == SET_INPUT_PROP: Tensor-filter will call to update the property of the subplugin. This function will take tensor info and layout as the argument. This operation can update input tensor shape, type, name and layout.
+       * If ops == SET_OUTPUT_PROP: Tensor-filter will call to update the property of the subplugin. This function will take tensor info and layout as the argument. This operation can update output tensor shape, type, name and layout.
+       * If ops == SET_ACCELERATOR: Tensor-filter will call to update the property of the subplugin. This function will take accelerator list as the argument. This operation will update the backend to be used by the corresponding subplugin.
        * List of operations to be supported are optional.
        * Note: In these operations, the argument 'prop' will not contain the updated information, but will be updated after the corresponding operation is succeeded.
        *
@@ -519,16 +519,16 @@ get_accl_hw_str (const accl_hw key);
  *       accelerator is used.
  */
 typedef struct {
-  const char * in_accl;       /**< user given input */
-  const char ** sup_accl;     /**< list of supported accelerator */
-  const char * auto_accl;     /**< auto accelerator (optional) */
-  const char * def_accl;      /**< default accelerator (optional) */
+  const char *in_accl;       /**< user given input */
+  const char **sup_accl;     /**< list of supported accelerator */
+  const char *auto_accl;     /**< auto accelerator (optional) */
+  const char *def_accl;      /**< default accelerator (optional) */
 } parse_accl_args;
 
 /**
  * @brief parse user given string to extract accelerator based on given regex filling in optional arguments
  *
- * @note The order of argumemnts for calling this function is:
+ * @note The order of arguments for calling this function is:
  *       - in_accl: user provided input accelerator string
  *       - sup_accl: list of supported accelerator
  *       - auto_accl: auto accelerator (optional)
index eada85c..ed7ced2 100644 (file)
@@ -48,7 +48,7 @@ typedef struct _GstTensorTrainerProperties
 } GstTensorTrainerProperties;
 
 /**
- * @brief GstTensorTrainer's Subplugin framework related information
+ * @brief GstTensorTrainer's subplugin framework related information
  *
  * All the information is provided statically.
  */
@@ -61,7 +61,7 @@ typedef struct _GstTensorTrainerFramework GstTensorTrainerFramework;
 
 /**
  * @brief GstTensorTrainer's event type list
- * 
+ *
  * Event types that subplugins must send to tensor_trainer
  */
 typedef enum
@@ -79,14 +79,14 @@ typedef enum
 typedef struct _GstTensorTrainerEventNotifier
 {
   uint64_t version;
-  void * notifier;
+  void *notifier;
   /**< Version of the struct
    * | 32bit (validity check) | 16bit (API version) | 16bit (Subplugin's internal version) |
    */
 } GstTensorTrainerEventNotifier;
 
 /**
- * @brief tensor_trainer Subplugin definition
+ * @brief tensor_trainer subplugin definition
  *
  * Common callback parameters:
  * prop Trainer properties. Read Only.
@@ -131,7 +131,7 @@ struct _GstTensorTrainerFramework
    * @param[in] prop read-only property values
    * @param[in/out] private_data, a subplugin may save its internal private data here.
    * @return 0 if ok. < 0 if error.
-   */ 
+   */
 
   int (*push_data) (const GstTensorTrainerFramework * self,
       const GstTensorTrainerProperties * prop,
@@ -186,7 +186,7 @@ nnstreamer_trainer_exit (GstTensorTrainerFramework * ttsp);
 
 /**
  * @brief Trainer's sub-plugin call this to notify event
- * 
+ *
  * @param notifier sub-plugin must send events to tensor_trainer with a notifier.
  * @param type Event types that subplugins must send to tensor_trainer
  * @param data Optional data for the event
index b74a23d..59e3d0e 100644 (file)
@@ -219,7 +219,7 @@ gst_tensors_info_copy (GstTensorsInfo * dest, const GstTensorsInfo * src);
 /**
  * @brief GstTensorsInfo represented as a string. Caller should free it.
  * @param info GstTensorsInfo structure
- * @return The newly allocated string representing the tensorsinfo. Free after use.
+ * @return The newly allocated string representing the tensors info. Free after use.
  */
 extern gchar *
 gst_tensors_info_to_string (const GstTensorsInfo * info);
index 0e37bfb..17dce30 100644 (file)
 G_BEGIN_DECLS
 /**
  * @brief Decode from tensors to media as customized operation
- * @param[in] input the input memory containg tensors
+ * @param[in] input the input memory containing tensors
  * @param[in] config input tensors config
  * @param[in] data private data for the callback
  * @param[out] output buffer filled by user
  * @return 0 if success. -ERRNO if error.
  */
 typedef int (* tensor_decoder_custom) (const GstTensorMemory *input,
-    const GstTensorsConfig *config, void *data, GstBuffer * out_buf);
+    const GstTensorsConfig *config, void *data, GstBuffer *out_buf);
 
 /**
  * @brief Register the custom callback function.
index e8a06d0..59dc9c0 100644 (file)
@@ -74,13 +74,13 @@ typedef int (*NNS_custom_get_output_dimension) (void *private_data,
     const GstTensorFilterProperties * prop, GstTensorsInfo * info);
 
 /**
- * @brief Set input dim by framework. Let custom plutin set output dim accordingly.
- * @param[in] private_data The pointer returned by NNStreamer_custom_init
+ * @brief Set input dim by framework. Let custom plugin set output dim accordingly.
+ * @param[in] private_data The pointer returned by NNStreamer_custom_init.
  * @param[in] prop GstTensorFilter's property values. Do not change its values.
- * @param[in] in_info Input tensor info designated by the gstreamer framework. Note that this is not a fixed value and gstreamer may try different values during pad-cap negotiations.
+ * @param[in] in_info Input tensor info designated by the GStreamer framework. Note that this is not a fixed value and GStreamer may try different values during pad-cap negotiations.
  * @param[out] out_info Output tensor info according to the input tensor info.
  *
- * @caution Do not fix internal values based on this call. Gstreamer may call
+ * @caution Do not fix internal values based on this call. GStreamer may call
  * this function repeatedly with different values during pad-cap negotiations.
  * Fix values when invoke is finally called.
  */
@@ -115,19 +115,19 @@ typedef int (*NNS_custom_allocate_invoke) (void *private_data,
  * @brief It's a post-processing method about the used data pointer if it has been allocated at custom filter.
  * @param[in] data the data element.
  */
-typedef void (*NNS_custom_destroy_notify) (void * data);
+typedef void (*NNS_custom_destroy_notify) (void *data);
 
 /**
  * @brief Custom Filter Class
  *
- * Note that exery function pointer is MANDATORY!
+ * Note that every function pointer is MANDATORY!
  */
 struct _NNStreamer_custom_class
 {
   NNS_custom_init_func initfunc; /**< called before any other callbacks from tensor_filter_custom.c */
   NNS_custom_exit_func exitfunc; /**< will not call other callbacks after this call */
   NNS_custom_get_input_dimension getInputDim; /**< a custom filter is required to provide input tensor dimension unless setInputdim is defined. */
-  NNS_custom_get_output_dimension getOutputDim; /**< a custom filter is require dto provide output tensor dimension unless setInputDim is defined. */
+  NNS_custom_get_output_dimension getOutputDim; /**< a custom filter is requireto provide output tensor dimension unless setInputDim is defined. */
   NNS_custom_set_input_dimension setInputDim; /**< without getI/O-Dim, this allows framework to set input dimension and get output dimension from the custom filter according to the input dimension */
   NNS_custom_invoke invoke; /**< the main function, "invoke", that transforms input to output. invoke is supposed to fill in the given output buffer. (invoke) XOR (allocate_invoke) MUST hold. */
   NNS_custom_allocate_invoke allocate_invoke; /**< the main function, "allocate & invoke", that transforms input to output. allocate_invoke is supposed to allocate output buffer by itself. (invoke) XOR (allocate_invoke) MUST hold. */
index bd75c85..d3661f6 100644 (file)
@@ -23,7 +23,7 @@
  *
  * To Packagers:
  *
- * This fils it to be packaged as "devel" package for NN developers.
+ * This file is to be packaged as "devel" package for NN developers.
  */
 #ifndef __GST_TENSOR_TYPEDEF_H__
 #define __GST_TENSOR_TYPEDEF_H__
 
 /**
  * @brief Possible data element types of other/tensor.
- * @note When changing tensor type, you shoud update related type in ML-API and protobuf/flatbuf schema also.
+ * @note When changing tensor type, you should update related type in ML-API and protobuf/flatbuf schema also.
  */
 typedef enum _nns_tensor_type
 {
@@ -274,7 +274,7 @@ typedef struct
 {
   unsigned int num_tensors; /**< The number of tensors */
   GstTensorInfo info[NNS_TENSOR_MEMORY_MAX]; /**< The list of tensor info (max NNS_TENSOR_MEMORY_MAX as static) */
-  GstTensorInfo *extra; /**< The list of tensor info for tensors whose idx is larger than NNS_TENSOR_MEMORY_MAX */
+  GstTensorInfo *extra; /**< The list of tensor info for tensors whose index is larger than NNS_TENSOR_MEMORY_MAX */
   tensor_format format; /**< tensor stream type */
 } GstTensorsInfo;
 
index a35ca02..4dec2cb 100644 (file)
@@ -774,7 +774,7 @@ gst_tensors_info_get_names_string (const GstTensorsInfo * info)
 /**
  * @brief GstTensorsInfo represented as a string. Caller should free it.
  * @param info GstTensorsInfo structure
- * @return The newly allocated string representing the tensorsinfo. Free after use.
+ * @return The newly allocated string representing the tensors info. Free after use.
  */
 gchar *
 gst_tensors_info_to_string (const GstTensorsInfo * info)
index 632662e..01b1e12 100644 (file)
@@ -1105,10 +1105,10 @@ gst_tensor_filter_common_free_property (GstTensorFilterPrivate * priv)
 }
 
 /**
- * @brief Parse the accelerator hardwares to be used for this framework
+ * @brief Parse the hardware accelerators to be used for this framework
  * @param[in] priv Struct containing the properties of the object
  * @param[in] prop Struct containing the properties of the framework
- * @param[in] accelerators user given input for hardare accelerators
+ * @param[in] accelerators user given input for hardware accelerators
  * @note The order of preference set by the user is maintained
  */
 static void
index a384b5f..5c7a54e 100644 (file)
@@ -105,7 +105,7 @@ LOCAL_SRC_FILES += ../tests/nnstreamer_repo_dynamicity/tensor_repo_dynamic_test.
 LOCAL_CFLAGS    += -O0 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CXXFLAGS  += -std=c++11 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_LDLIBS    += -llog
-#LOCAL_LDFLAGS   += $(CUSTOM_LINKER64)
+#LOCAL_LDFLAGS  += $(CUSTOM_LINKER64)
 LOCAL_LDFLAGS   += -fuse-ld=bfd
 
 LOCAL_C_INCLUDES       := $(NNSTREAMER_INCLUDES)
index 4fdcd48..2770e33 100644 (file)
@@ -32,7 +32,7 @@ static const std::vector<MockModel> default_models{
 
 /**
  * @brief Initialize the MockMLAgent using given MockModels
- * @param[in] models A vector containg MockModels
+ * @param[in] models A vector containing MockModels
  */
 void
 _init (const std::vector<MockModel> &models = default_models)