[C-API] Update the comments and the name of parameter
authorJaeyun <jy1210.jung@samsung.com>
Wed, 3 Jul 2019 04:25:02 +0000 (13:25 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 8 Jul 2019 10:22:29 +0000 (19:22 +0900)
This patch updates the comments and the name of parameter to comply with
C-API review process.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
api/capi/include/nnstreamer-single.h
api/capi/include/nnstreamer.h
api/capi/src/nnstreamer-capi-pipeline.c
api/capi/src/nnstreamer-capi-single.c
api/capi/src/nnstreamer-capi-util.c
tests/tizen_capi/unittest_tizen_capi.cpp

index 658421e..0fe13db 100644 (file)
@@ -22,7 +22,7 @@
  * @author MyungJoo Ham <myungjoo.ham@samsung.com>
  * @bug No known bugs except for NYI items
  *
- * @detail This is targetting Tizen 5.5 M2.
+ * @details This is targetting Tizen 5.5 M2.
  */
 
 #ifndef __TIZEN_MACHINELEARNING_NNSTREAMER_SINGLE_H__
@@ -61,18 +61,17 @@ typedef void *ml_single_h;
  *                      It is required by some custom filters of NNStreamer.
  *                      You may set NULL if it's not required.
  * @param[in] output_info This is required if the given model has flexible output dimension.
- * @param[in] nnfw The nerual network framework used to open the given
- *                 #model_path. Set #ML_NNFW_TYPE_ANY to let it auto-detect.
- * @param[in] hw Tell the corresponding @nnfw to use a specific hardware.
+ * @param[in] nnfw The neural network framework used to open the given @a model.
+ *                 Set #ML_NNFW_TYPE_ANY to let it auto-detect.
+ * @param[in] hw Tell the corresponding @nnfw to use a specific hardware.
  *               Set #ML_NNFW_HW_ANY if it does not matter.
  * @return @c 0 on success. otherwise a negative error value
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid.
  * @retval #ML_ERROR_STREAMS_PIPE Failed to start the pipeline.
  *
- * @detail Even if the model has flexible input data dimensions,
- *         input data frames of an instance of a model should share the
- *         same dimension.
+ * @details Even if the model has flexible input data dimensions,
+ *          input data frames of an instance of a model should share the same dimension.
  */
 int ml_single_open (ml_single_h *single, const char *model, const ml_tensors_info_h input_info, const ml_tensors_info_h output_info, ml_nnfw_type_e nnfw, ml_nnfw_hw_e hw);
 
@@ -91,16 +90,15 @@ int ml_single_close (ml_single_h single);
  * @since_tizen 5.5
  * @param[in] single The model handle to be inferred.
  * @param[in] input The input data to be inferred.
- * @param[out] output The output buffer allocated. Caller is responsible to free the output buffer with ml_util_destroy_tensors_data().
+ * @param[out] output The allocated output buffer. The caller is responsible for freeing the output buffer with ml_util_destroy_tensors_data().
  * @return @c 0 on success. otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid.
  * @retval #ML_ERROR_STREAMS_PIPE Cannot push a buffer into source element.
  * @retval #ML_ERROR_TIMED_OUT Failed to get the result from sink element.
  *
- * @detail Even if the model has flexible input data dimensions,
- *         input data frames of an instance of a model should share the
- *         same dimension.
+ * @details Even if the model has flexible input data dimensions,
+ *          input data frames of an instance of a model should share the same dimension.
  */
 int ml_single_inference (ml_single_h single, const ml_tensors_data_h input, ml_tensors_data_h *output);
 
@@ -109,15 +107,12 @@ int ml_single_inference (ml_single_h single, const ml_tensors_data_h input, ml_t
  *************/
 
 /**
- * @brief Gets the type (tensor dimension, type, name and so on) of required input
- *        data for the given handle.
- * @detail Note that a model may not have such
- *         information if its input type is flexible.
- *         Besides, names of tensors may be not available while dimensions and
- *         types are available.
+ * @brief Gets the type (tensor dimension, type, name and so on) of required input data for the given model.
+ * @details Note that a model may not have such information if its input type is flexible.
+ *          Besides, names of tensors may be not available while dimensions and types are available.
  * @since_tizen 5.5
- * @param[in] single The model handle to be investigated.
- * @param[out] info The handle of input tensors information. Caller is responsible to free the information with ml_util_destroy_tensors_info().
+ * @param[in] single The model handle.
+ * @param[out] info The handle of input tensors information. The caller is responsible for freeing the information with ml_util_destroy_tensors_info().
  * @return @c 0 on success. otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid.
@@ -125,16 +120,12 @@ int ml_single_inference (ml_single_h single, const ml_tensors_data_h input, ml_t
 int ml_single_get_input_info (ml_single_h single, ml_tensors_info_h *info);
 
 /**
- * @brief Gets the type (tensor dimension, type, name and so on) of output
- *        data for the given handle.
- * @detail Note that a model may not have such
- *         information if its input type is flexible and output type is
- *         not determined statically.
- *         Besides, names of tensors may be not available while dimensions and
- *         types are available.
+ * @brief Gets the type (tensor dimension, type, name and so on) of output data for the given model.
+ * @details Note that a model may not have such information if its output type is flexible and output type is not determined statically.
+ *          Besides, names of tensors may be not available while dimensions and types are available.
  * @since_tizen 5.5
- * @param[in] single The model handle to be investigated.
- * @param[out] info The handle of output tensors information. Caller is responsible to free the returned with ml_util_destroy_tensors_info().
+ * @param[in] single The model handle.
+ * @param[out] info The handle of output tensors information. The caller is responsible for freeing the information with ml_util_destroy_tensors_info().
  * @return @c 0 on success. otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Fail. The parameter is invalid.
index 3091d25..5108e8e 100644 (file)
@@ -54,7 +54,7 @@ extern "C" {
 #define ML_TENSOR_SIZE_LIMIT  (16)
 
 /**
- * @brief Dimension information that NNStreamer support.
+ * @brief The dimensions of a tensor that NNStreamer supports.
  * @since_tizen 5.5
  */
 typedef unsigned int ml_tensor_dimension[ML_TENSOR_RANK_LIMIT];
@@ -106,10 +106,10 @@ typedef void *ml_pipeline_valve_h;
  * @since_tizen 5.5
  */
 typedef enum {
-  ML_NNFW_TYPE_ANY = 0, /**< determines the nnfw with file extension. */
-  ML_NNFW_TYPE_CUSTOM_FILTER, /**< custom filter (independent shared object). */
-  ML_NNFW_TYPE_TENSORFLOW_LITE, /**< tensorflow-lite (.tflite). */
-  ML_NNFW_TYPE_TENSORFLOW, /**< tensorflow (.pb). */
+  ML_NNFW_TYPE_ANY = 0, /**< NNHW is not specified (Try to determine the NNFW with file extension). */
+  ML_NNFW_TYPE_CUSTOM_FILTER, /**< Custom filter (Independent shared object). */
+  ML_NNFW_TYPE_TENSORFLOW_LITE, /**< Tensorflow-lite (.tflite). */
+  ML_NNFW_TYPE_TENSORFLOW, /**< Tensorflow (.pb). */
 } ml_nnfw_type_e;
 
 /**
@@ -170,8 +170,8 @@ typedef enum {
 /**
  * @brief Enumeration for pipeline state.
  * @since_tizen 5.5
- * @detail Refer to https://gstreamer.freedesktop.org/documentation/plugin-development/basics/states.html.
- *         The state diagram of pipeline looks like this, assuming that there are no errors.
+ * @details Refer to https://gstreamer.freedesktop.org/documentation/plugin-development/basics/states.html.
+ *          The state diagram of pipeline looks like this, assuming that there are no errors.
  *
  *          [ UNKNOWN ] "new null object"
  *               | "ml_pipeline_construct" starts
@@ -199,7 +199,7 @@ typedef enum {
 
 /**
  * @brief Enumeration for switch types
- * @detail This designates different GStreamer filters, "GstInputSelector"/"GetOutputSelector".
+ * @details This designates different GStreamer filters, "GstInputSelector"/"GetOutputSelector".
  * @since_tizen 5.5
  */
 typedef enum {
@@ -209,7 +209,7 @@ typedef enum {
 
 /**
  * @brief Callback for sink element of NNStreamer pipelines (pipeline's output)
- * @detail If an application wants to accept data outputs of an NNStreamer stream, use this callback to get data from the stream. Note that the buffer may be deallocated after the return and this is synchronously called. Thus, if you need the data afterwards, copy the data to another buffer and return fast. Do not hold too much time in the callback. It is recommended to use very small tensors at sinks.
+ * @details If an application wants to accept data outputs of an NNStreamer stream, use this callback to get data from the stream. Note that the buffer may be deallocated after the return and this is synchronously called. Thus, if you need the data afterwards, copy the data to another buffer and return fast. Do not spend too much time in the callback. It is recommended to use very small tensors at sinks.
  * @since_tizen 5.5
  * @remarks The @a data can be used only in the callback. To use outside, make a copy.
  * @remarks The @a info can be used only in the callback. To use outside, make a copy.
@@ -224,7 +224,7 @@ typedef void (*ml_pipeline_sink_cb) (const ml_tensors_data_h data, const ml_tens
  ****************************************************/
 /**
  * @brief Constructs the pipeline (GStreamer + NNStreamer)
- * @detail Uses this function to create a gst_parse_launch compatible NNStreamer pipelines.
+ * @details Use this function to create gst_parse_launch compatible NNStreamer pipelines.
  * @since_tizen 5.5
  * @remarks If the function succeeds, @a pipe handle must be released using ml_pipeline_destroy().
  * @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.
@@ -238,7 +238,7 @@ int ml_pipeline_construct (const char *pipeline_description, ml_pipeline_h *pipe
 
 /**
  * @brief Destroys the pipeline
- * @detail Uses this function to destroy the pipeline constructed with ml_pipeline_construct().
+ * @details Use this function to destroy the pipeline constructed with ml_pipeline_construct().
  * @since_tizen 5.5
  * @param[in] pipe The pipeline to be destroyed.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -250,9 +250,9 @@ int ml_pipeline_destroy (ml_pipeline_h pipe);
 
 /**
  * @brief Gets the state of pipeline
- * @detail Gets the state of the pipeline handle returned by ml_pipeline_construct().
+ * @details Gets the state of the pipeline handle returned by ml_pipeline_construct().
  * @since_tizen 5.5
- * @param[in] pipe The pipeline to be monitored.
+ * @param[in] pipe The pipeline handle.
  * @param[out] state The pipeline state.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
@@ -266,10 +266,10 @@ int ml_pipeline_get_state (ml_pipeline_h pipe, ml_pipeline_state_e *state);
  ****************************************************/
 /**
  * @brief Starts the pipeline
- * @detail The pipeline handle returned by ml_pipeline_construct() is started.
- *         Note that this is asynchronous function. State might be "pending".
+ * @details The pipeline handle returned by ml_pipeline_construct() is started.
+ *          Note that this is asynchronous function. State might be "pending".
  * @since_tizen 5.5
- * @param[in] pipe The pipeline to be started.
+ * @param[in] pipe The pipeline handle.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
@@ -279,14 +279,14 @@ int ml_pipeline_start (ml_pipeline_h pipe);
 
 /**
  * @brief Stops the pipeline
- * @detail The pipeline handle returned by ml_pipeline_construct() is stopped.
- *         Note that this is asynchronous function. State might be "pending".
+ * @details The pipeline handle returned by ml_pipeline_construct() is stopped.
+ *          Note that this is asynchronous function. State might be "pending".
  * @since_tizen 5.5
  * @param[in] pipe The pipeline to be stopped.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
- * @retval #ML_ERROR_STREAMS_PIPE Failed to start.
+ * @retval #ML_ERROR_STREAMS_PIPE Failed to stop the pipeline.
  */
 int ml_pipeline_stop (ml_pipeline_h pipe);
 
@@ -296,57 +296,57 @@ int ml_pipeline_stop (ml_pipeline_h pipe);
 /**
  * @brief Registers a callback for sink (tensor_sink) of NNStreamer pipelines.
  * @since_tizen 5.5
- * @remarks If the function succeeds, @a h handle must be unregistered using ml_pipeline_sink_unregister().
+ * @remarks If the function succeeds, @a sink_handle handle must be unregistered using ml_pipeline_sink_unregister().
  * @param[in] pipe The pipeline to be attached with a sink node.
  * @param[in] sink_name The name of sink node, described with ml_pipeline_construct().
  * @param[in] cb The function to be called by the sink node.
- * @param[out] h The sink handle.
  * @param[in] user_data Private data for the callback. This value is passed to the callback when it's invoked.
+ * @param[out] sink_handle The sink handle.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @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_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, ml_pipeline_sink_h *h, void *user_data);
+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);
 
 /**
  * @brief Unregisters a callback for sink (tensor_sink) of NNStreamer pipelines.
  * @since_tizen 5.5
- * @param[in] h The sink handle to be unregistered (destroyed)
+ * @param[in] sink_handle The sink handle to be unregistered (destroyed)
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_sink_unregister (ml_pipeline_sink_h h);
+int ml_pipeline_sink_unregister (ml_pipeline_sink_h sink_handle);
 
 /**
  * @brief Gets a handle to operate as a src node of NNStreamer pipelines.
  * @since_tizen 5.5
- * @remarks If the function succeeds, @a h handle must be released using ml_pipeline_src_put_handle().
+ * @remarks If the function succeeds, @a src_handle handle must be released using ml_pipeline_src_put_handle().
  * @param[in] pipe The pipeline to be attached with a src node.
  * @param[in] src_name The name of src node, described with ml_pipeline_construct().
- * @param[out] h The src handle.
+ * @param[out] src_handle The src handle.
  * @return 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  * @retval #ML_ERROR_STREAMS_PIPE Fail to get SRC element.
  * @retval #ML_ERROR_TRY_AGAIN The pipeline is not ready yet.
  */
-int ml_pipeline_src_get_handle (ml_pipeline_h pipe, const char *src_name, ml_pipeline_src_h *h);
+int ml_pipeline_src_get_handle (ml_pipeline_h pipe, const char *src_name, ml_pipeline_src_h *src_handle);
 
 /**
  * @brief Closes the given handle of a src node of NNStreamer pipelines.
  * @since_tizen 5.5
- * @param[in] h The src handle to be put (closed).
+ * @param[in] src_handle The src handle to be closed.
  * @return 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_src_put_handle (ml_pipeline_src_h h);
+int ml_pipeline_src_put_handle (ml_pipeline_src_h src_handle);
 
 /**
- * @brief Puts an input data frame.
- * @param[in] h The source handle returned by ml_pipeline_src_get_handle().
+ * @brief Adds an input data frame.
+ * @param[in] src_handle The source handle returned by ml_pipeline_src_get_handle().
  * @param[in] data The handle of input tensors, in the format of tensors info given by ml_pipeline_src_get_tensors_info().
  * @param[in] policy The policy of buf deallocation.
  * @return 0 on success. Otherwise a negative error value.
@@ -355,13 +355,13 @@ int ml_pipeline_src_put_handle (ml_pipeline_src_h h);
  * @retval #ML_ERROR_STREAMS_PIPE The pipeline has inconsistent padcaps. Not negotiated?
  * @retval #ML_ERROR_TRY_AGAIN The pipeline is not ready yet.
  */
-int ml_pipeline_src_input_data (ml_pipeline_src_h h, const ml_tensors_data_h data, ml_pipeline_buf_policy_e policy);
+int ml_pipeline_src_input_data (ml_pipeline_src_h src_handle, ml_tensors_data_h data, ml_pipeline_buf_policy_e policy);
 
 /**
  * @brief Gets a handle for the tensors information of given src node.
  * @since_tizen 5.5
- * @remarks If the function succeeds, @a info_h handle must be released using ml_util_destroy_tensors_info().
- * @param[in] h The source handle returned by ml_pipeline_src_get_handle().
+ * @remarks If the function succeeds, @a info handle must be released using ml_util_destroy_tensors_info().
+ * @param[in] src_handle The source handle returned by ml_pipeline_src_get_handle().
  * @param[out] info The handle of tensors information.
  * @return 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
@@ -369,7 +369,7 @@ int ml_pipeline_src_input_data (ml_pipeline_src_h h, const ml_tensors_data_h dat
  * @retval #ML_ERROR_STREAMS_PIPE The pipeline has inconsistent padcaps. Not negotiated?
  * @retval #ML_ERROR_TRY_AGAIN The pipeline is not ready yet.
  */
-int ml_pipeline_src_get_tensors_info (ml_pipeline_src_h h, ml_tensors_info_h *info);
+int ml_pipeline_src_get_tensors_info (ml_pipeline_src_h src_handle, ml_tensors_info_h *info);
 
 /****************************************************
  ** NNStreamer Pipeline Switch/Valve Control       **
@@ -377,80 +377,80 @@ int ml_pipeline_src_get_tensors_info (ml_pipeline_src_h h, ml_tensors_info_h *in
 
 /**
  * @brief Gets a handle to operate a "GstInputSelector / GstOutputSelector" node of NNStreamer pipelines.
- * @detail Refer to https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-input-selector.html for input selectors.
- *         Refer to https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-output-selector.html for output selectors.
- * @remarks If the function succeeds, @a h handle must be released using ml_pipeline_switch_put_handle().
+ * @details Refer to https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-input-selector.html for input selectors.
+ *          Refer to https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-output-selector.html for output selectors.
+ * @remarks If the function succeeds, @a switch_handle handle must be released using ml_pipeline_switch_put_handle().
  * @param[in] pipe The pipeline to be managed.
  * @param[in] switch_name The name of switch (InputSelector/OutputSelector)
  * @param[out] type The type of the switch. If NULL, it is ignored.
- * @param[out] h The switch handle.
+ * @param[out] switch_handle The switch handle.
  * @return 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_switch_get_handle (ml_pipeline_h pipe, const char *switch_name, ml_pipeline_switch_e *type, ml_pipeline_switch_h *h);
+int ml_pipeline_switch_get_handle (ml_pipeline_h pipe, const char *switch_name, ml_pipeline_switch_e *type, ml_pipeline_switch_h *switch_handle);
 
 /**
  * @brief Closes the given switch handle.
- * @param[in] h The handle to be closed.
+ * @param[in] switch_handle The handle to be closed.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_switch_put_handle (ml_pipeline_switch_h h);
+int ml_pipeline_switch_put_handle (ml_pipeline_switch_h switch_handle);
 
 /**
  * @brief Controls the switch with the given handle to select input/output nodes(pads).
- * @param[in] h The switch handle returned by ml_pipeline_switch_get_handle()
+ * @param[in] switch_handle The switch handle returned by ml_pipeline_switch_get_handle()
  * @param[in] pad_name The name of the chosen pad to be activated. Use ml_pipeline_switch_get_pad_list() to list the available pad names.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_switch_select (ml_pipeline_switch_h h, const char *pad_name);
+int ml_pipeline_switch_select (ml_pipeline_switch_h switch_handle, const char *pad_name);
 
 /**
  * @brief Gets the pad names of a switch.
- * @param[in] h The switch handle returned by ml_pipeline_switch_get_handle()
+ * @param[in] switch_handle The switch handle returned by ml_pipeline_switch_get_handle()
  * @param[out] list NULL terminated array of char*. The caller must free each string (char*) in the list and free the list itself.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  * @retval #ML_ERROR_STREAMS_PIPE The element is not both input and output switch (Internal data inconsistency).
  */
-int ml_pipeline_switch_get_pad_list (ml_pipeline_switch_h h, char ***list);
+int ml_pipeline_switch_get_pad_list (ml_pipeline_switch_h switch_handle, char ***list);
 
 /**
  * @brief Gets a handle to operate a "GstValve" node of NNStreamer pipelines.
- * @detail Refer to https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-valve.html for more info.
- * @remarks If the function succeeds, @a h handle must be released using ml_pipeline_valve_put_handle().
+ * @details Refer to https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-valve.html for more info.
+ * @remarks If the function succeeds, @a valve_handle handle must be released using ml_pipeline_valve_put_handle().
  * @param[in] pipe The pipeline to be managed.
  * @param[in] valve_name The name of valve (Valve)
- * @param[out] h The valve handle.
+ * @param[out] valve_handle The valve handle.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_valve_get_handle (ml_pipeline_h pipe, const char *valve_name, ml_pipeline_valve_h *h);
+int ml_pipeline_valve_get_handle (ml_pipeline_h pipe, const char *valve_name, ml_pipeline_valve_h *valve_handle);
 
 /**
  * @brief Closes the given valve handle.
- * @param[in] h The handle to be closed.
+ * @param[in] valve_handle The handle to be closed.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_valve_put_handle (ml_pipeline_valve_h h);
+int ml_pipeline_valve_put_handle (ml_pipeline_valve_h valve_handle);
 
 /**
  * @brief Controls the valve with the given handle.
- * @param[in] h The valve handle returned by ml_pipeline_valve_get_handle()
+ * @param[in] valve_handle The valve handle returned by ml_pipeline_valve_get_handle()
  * @param[in] open @c true to open(let the flow pass), @c false to close (drop & stop the flow)
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_pipeline_valve_set_open (ml_pipeline_valve_h h, bool open);
+int ml_pipeline_valve_set_open (ml_pipeline_valve_h valve_handle, bool open);
 
 /****************************************************
  ** NNStreamer Utilities                           **
@@ -476,14 +476,16 @@ int ml_util_allocate_tensors_info (ml_tensors_info_h *info);
 int ml_util_destroy_tensors_info (ml_tensors_info_h info);
 
 /**
- * @brief Validates the given tensors information is valid.
+ * @brief Validates the given tensors information.
+ * @details If the function returns an error, @a valid is not changed.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information to be validated.
+ * @param[out] valid @c true if it's valid, @c false if if it's invalid.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_validate_tensors_info (const ml_tensors_info_h info);
+int ml_util_validate_tensors_info (const ml_tensors_info_h info, bool *valid);
 
 /**
  * @brief Copies the tensors information.
@@ -505,7 +507,7 @@ int ml_util_copy_tensors_info (ml_tensors_info_h dest, const ml_tensors_info_h s
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_set_tensors_count (ml_tensors_info_h info, const unsigned int count);
+int ml_util_set_tensors_count (ml_tensors_info_h info, unsigned int count);
 
 /**
  * @brief Gets the number of tensors with given handle of tensors information.
@@ -522,78 +524,78 @@ int ml_util_get_tensors_count (ml_tensors_info_h info, unsigned int *count);
  * @brief Sets the tensor name with given handle of tensors information.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information.
- * @param[in] index The index of tensor meta to be updated.
+ * @param[in] index The index of the tensor to be updated.
  * @param[in] name The tensor name to be set.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_set_tensor_name (ml_tensors_info_h info, const unsigned int index, const char *name);
+int ml_util_set_tensor_name (ml_tensors_info_h info, unsigned int index, const char *name);
 
 /**
  * @brief Gets the tensor name with given handle of tensors information.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information.
- * @param[in] index The index of tensor meta.
+ * @param[in] index The index of the tensor.
  * @param[out] name The tensor name.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_get_tensor_name (ml_tensors_info_h info, const unsigned int index, char **name);
+int ml_util_get_tensor_name (ml_tensors_info_h info, unsigned int index, char **name);
 
 /**
  * @brief Sets the tensor type with given handle of tensors information.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information.
- * @param[in] index The index of tensor meta to be updated.
+ * @param[in] index The index of the tensor to be updated.
  * @param[in] type The tensor type to be set.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_set_tensor_type (ml_tensors_info_h info, const unsigned int index, const ml_tensor_type_e type);
+int ml_util_set_tensor_type (ml_tensors_info_h info, unsigned int index, const ml_tensor_type_e type);
 
 /**
  * @brief Gets the tensor type with given handle of tensors information.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information.
- * @param[in] index The index of tensor meta.
+ * @param[in] index The index of the tensor.
  * @param[out] type The tensor type.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_get_tensor_type (ml_tensors_info_h info, const unsigned int index, ml_tensor_type_e *type);
+int ml_util_get_tensor_type (ml_tensors_info_h info, unsigned int index, ml_tensor_type_e *type);
 
 /**
  * @brief Sets the tensor dimension with given handle of tensors information.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information.
- * @param[in] index The index of tensor meta to be updated.
+ * @param[in] index The index of the tensor to be updated.
  * @param[in] dimension The tensor dimension to be set.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_set_tensor_dimension (ml_tensors_info_h info, const unsigned int index, const ml_tensor_dimension dimension);
+int ml_util_set_tensor_dimension (ml_tensors_info_h info, unsigned int index, const ml_tensor_dimension dimension);
 
 /**
  * @brief Gets the tensor dimension with given handle of tensors information.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information.
- * @param[in] index The index of tensor meta.
+ * @param[in] index The index of the tensor.
  * @param[out] dimension The tensor dimension.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_get_tensor_dimension (ml_tensors_info_h info, const unsigned int index, ml_tensor_dimension dimension);
+int ml_util_get_tensor_dimension (ml_tensors_info_h info, unsigned int index, ml_tensor_dimension dimension);
 
 /**
  * @brief Gets the byte size of the given tensors type.
  * @since_tizen 5.5
- * @param[in] info The handle of tensors information to be investigated.
+ * @param[in] info The tensors' information handle.
  * @return @c >= 0 on success with byte size.
  */
 size_t ml_util_get_tensors_size (const ml_tensors_info_h info);
@@ -602,7 +604,7 @@ size_t ml_util_get_tensors_size (const ml_tensors_info_h info);
  * @brief Allocates a tensor data frame with the given tensors information.
  * @since_tizen 5.5
  * @param[in] info The handle of tensors information for the allocation.
- * @param[out] data The handle of tensors data allocated. Caller is responsible to free the allocated data with ml_util_destroy_tensors_data().
+ * @param[out] data The handle of tensors data. The caller is responsible for freeing the allocated data with ml_util_destroy_tensors_data().
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
@@ -611,7 +613,7 @@ size_t ml_util_get_tensors_size (const ml_tensors_info_h info);
 int ml_util_allocate_tensors_data (const ml_tensors_info_h info, ml_tensors_data_h *data);
 
 /**
- * @brief Frees the given handle of a tensors data.
+ * @brief Frees the given tensors' data handle.
  * @since_tizen 5.5
  * @param[in] data The handle of tensors data.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -624,27 +626,27 @@ int ml_util_destroy_tensors_data (ml_tensors_data_h data);
  * @brief Gets a tensor data of given handle.
  * @since_tizen 5.5
  * @param[in] data The handle of tensors data.
- * @param[in] index The index of tensor in tensors data.
+ * @param[in] index The index of the tensor.
  * @param[out] raw_data Raw tensor data in the handle.
  * @param[out] data_size Byte size of tensor data.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_get_tensor_data (ml_tensors_data_h data, const unsigned int index, void **raw_data, size_t *data_size);
+int ml_util_get_tensor_data (ml_tensors_data_h data, unsigned int index, void **raw_data, size_t *data_size);
 
 /**
  * @brief Copies a tensor data to given handle.
  * @since_tizen 5.5
  * @param[in] data The handle of tensors data.
- * @param[in] index The index of tensor in tensors data.
+ * @param[in] index The index of the tensor.
  * @param[out] raw_data Raw tensor data to be copied.
  * @param[out] data_size Byte size of raw data.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful
  * @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
  */
-int ml_util_copy_tensor_data (ml_tensors_data_h data, const unsigned int index, const void *raw_data, const size_t data_size);
+int ml_util_copy_tensor_data (ml_tensors_data_h data, unsigned int index, const void *raw_data, const size_t data_size);
 
 /**
  * @brief Checks the availability of the given execution environments.
index ec963de..cff4658 100644 (file)
@@ -561,7 +561,7 @@ ml_pipeline_stop (ml_pipeline_h pipe)
  */
 int
 ml_pipeline_sink_register (ml_pipeline_h pipe, const char *sink_name,
-    ml_pipeline_sink_cb cb, ml_pipeline_sink_h * h, void *user_data)
+    ml_pipeline_sink_cb cb, void *user_data, ml_pipeline_sink_h * h)
 {
   ml_pipeline_element *elem;
   ml_pipeline *p = pipe;
@@ -836,7 +836,7 @@ ml_pipeline_src_put_handle (ml_pipeline_src_h h)
  * @brief Push a data frame to a src (more info in nnstreamer.h)
  */
 int
-ml_pipeline_src_input_data (ml_pipeline_src_h h, const ml_tensors_data_h data,
+ml_pipeline_src_input_data (ml_pipeline_src_h h, ml_tensors_data_h data,
     ml_pipeline_buf_policy_e policy)
 {
   /** @todo NYI */
index b51e78a..ba0c5ed 100644 (file)
@@ -62,6 +62,7 @@ ml_single_open (ml_single_h * single, const char *model,
   gchar *path_down;
   ml_tensors_info_s *in_tensors_info, *out_tensors_info;
   bool available = false;
+  bool valid = false;
 
   /* Validate the params */
   if (!single) {
@@ -75,16 +76,22 @@ ml_single_open (ml_single_h * single, const char *model,
   in_tensors_info = (ml_tensors_info_s *) input_info;
   out_tensors_info = (ml_tensors_info_s *) output_info;
 
-  if (in_tensors_info &&
-      ml_util_validate_tensors_info (in_tensors_info) != ML_ERROR_NONE) {
-    ml_loge ("The given param, input tensor info is invalid.");
-    return ML_ERROR_INVALID_PARAMETER;
+  if (input_info) {
+    /* Validate input tensor info. */
+    if (ml_util_validate_tensors_info (input_info, &valid) != ML_ERROR_NONE ||
+        valid == false) {
+      ml_loge ("The given param, input tensor info is invalid.");
+      return ML_ERROR_INVALID_PARAMETER;
+    }
   }
 
-  if (out_tensors_info &&
-      ml_util_validate_tensors_info (out_tensors_info) != ML_ERROR_NONE) {
-    ml_loge ("The given param, output tensor info is invalid.");
-    return ML_ERROR_INVALID_PARAMETER;
+  if (output_info) {
+    /* Validate output tensor info. */
+    if (ml_util_validate_tensors_info (output_info, &valid) != ML_ERROR_NONE ||
+        valid == false) {
+      ml_loge ("The given param, output tensor info is invalid.");
+      return ML_ERROR_INVALID_PARAMETER;
+    }
   }
 
   /* 1. Determine nnfw */
@@ -243,8 +250,8 @@ ml_single_open (ml_single_h * single, const char *model,
     ml_util_copy_tensors_info (&single_h->in_info, in_info);
     ml_util_destroy_tensors_info (in_info);
 
-    status = ml_util_validate_tensors_info (&single_h->in_info);
-    if (status != ML_ERROR_NONE) {
+    status = ml_util_validate_tensors_info (&single_h->in_info, &valid);
+    if (status != ML_ERROR_NONE || valid == false) {
       ml_loge ("Failed to get the input tensor info.");
       goto error;
     }
@@ -265,8 +272,8 @@ ml_single_open (ml_single_h * single, const char *model,
     ml_util_copy_tensors_info (&single_h->out_info, out_info);
     ml_util_destroy_tensors_info (out_info);
 
-    status = ml_util_validate_tensors_info (&single_h->out_info);
-    if (status != ML_ERROR_NONE) {
+    status = ml_util_validate_tensors_info (&single_h->out_info, &valid);
+    if (status != ML_ERROR_NONE || valid == false) {
       ml_loge ("Failed to get the output tensor info.");
       goto error;
     }
index 7738a1d..8f8e361 100644 (file)
@@ -114,22 +114,31 @@ ml_util_validate_tensor_info (const ml_tensor_info_s * info)
  * @brief Validates the given tensors info is valid.
  */
 int
-ml_util_validate_tensors_info (const ml_tensors_info_h info)
+ml_util_validate_tensors_info (const ml_tensors_info_h info, bool * valid)
 {
   ml_tensors_info_s *tensors_info;
   guint i;
 
+  if (!valid)
+    return ML_ERROR_INVALID_PARAMETER;
+
   tensors_info = (ml_tensors_info_s *) info;
 
   if (!tensors_info || tensors_info->num_tensors < 1)
     return ML_ERROR_INVALID_PARAMETER;
 
+  /* init false */
+  *valid = false;
+
   for (i = 0; i < tensors_info->num_tensors; i++) {
     /* Failed if returned value is not 0 (ML_ERROR_NONE) */
     if (ml_util_validate_tensor_info (&tensors_info->info[i]) != ML_ERROR_NONE)
-      return ML_ERROR_INVALID_PARAMETER;
+      goto done;
   }
 
+  *valid = true;
+
+done:
   return ML_ERROR_NONE;
 }
 
@@ -137,7 +146,7 @@ ml_util_validate_tensors_info (const ml_tensors_info_h info)
  * @brief Sets the number of tensors with given handle of tensors information.
  */
 int
-ml_util_set_tensors_count (ml_tensors_info_h info, const unsigned int count)
+ml_util_set_tensors_count (ml_tensors_info_h info, unsigned int count)
 {
   ml_tensors_info_s *tensors_info;
 
@@ -172,7 +181,7 @@ ml_util_get_tensors_count (ml_tensors_info_h info, unsigned int *count)
  */
 int
 ml_util_set_tensor_name (ml_tensors_info_h info,
-    const unsigned int index, const char *name)
+    unsigned int index, const char *name)
 {
   ml_tensors_info_s *tensors_info;
 
@@ -200,7 +209,7 @@ ml_util_set_tensor_name (ml_tensors_info_h info,
  */
 int
 ml_util_get_tensor_name (ml_tensors_info_h info,
-    const unsigned int index, char **name)
+    unsigned int index, char **name)
 {
   ml_tensors_info_s *tensors_info;
 
@@ -222,7 +231,7 @@ ml_util_get_tensor_name (ml_tensors_info_h info,
  */
 int
 ml_util_set_tensor_type (ml_tensors_info_h info,
-    const unsigned int index, const ml_tensor_type_e type)
+    unsigned int index, const ml_tensor_type_e type)
 {
   ml_tensors_info_s *tensors_info;
 
@@ -244,7 +253,7 @@ ml_util_set_tensor_type (ml_tensors_info_h info,
  */
 int
 ml_util_get_tensor_type (ml_tensors_info_h info,
-    const unsigned int index, ml_tensor_type_e * type)
+    unsigned int index, ml_tensor_type_e * type)
 {
   ml_tensors_info_s *tensors_info;
 
@@ -266,7 +275,7 @@ ml_util_get_tensor_type (ml_tensors_info_h info,
  */
 int
 ml_util_set_tensor_dimension (ml_tensors_info_h info,
-    const unsigned int index, const ml_tensor_dimension dimension)
+    unsigned int index, const ml_tensor_dimension dimension)
 {
   ml_tensors_info_s *tensors_info;
   guint i;
@@ -291,7 +300,7 @@ ml_util_set_tensor_dimension (ml_tensors_info_h info,
  */
 int
 ml_util_get_tensor_dimension (ml_tensors_info_h info,
-    const unsigned int index, ml_tensor_dimension dimension)
+    unsigned int index, ml_tensor_dimension dimension)
 {
   ml_tensors_info_s *tensors_info;
   guint i;
@@ -472,7 +481,7 @@ failed:
  * @brief Gets a tensor data of given handle.
  */
 int
-ml_util_get_tensor_data (ml_tensors_data_h data, const unsigned int index,
+ml_util_get_tensor_data (ml_tensors_data_h data, unsigned int index,
     void **raw_data, size_t * data_size)
 {
   ml_tensors_data_s *_data;
@@ -495,7 +504,7 @@ ml_util_get_tensor_data (ml_tensors_data_h data, const unsigned int index,
  * @brief Copies a tensor data to given handle.
  */
 int
-ml_util_copy_tensor_data (ml_tensors_data_h data, const unsigned int index,
+ml_util_copy_tensor_data (ml_tensors_data_h data, unsigned int index,
     const void *raw_data, const size_t data_size)
 {
   ml_tensors_data_s *_data;
@@ -547,7 +556,7 @@ ml_util_copy_tensors_info (ml_tensors_info_h dest, const ml_tensors_info_h src)
 }
 
 /**
- * @brief Copies tensor meta info from gst tensots info.
+ * @brief Copies tensor meta info from gst tensors info.
  */
 void
 ml_util_copy_tensors_info_from_gst (ml_tensors_info_s * ml_info,
@@ -619,7 +628,7 @@ ml_util_copy_tensors_info_from_gst (ml_tensors_info_s * ml_info,
 }
 
 /**
- * @brief Copies tensor meta info from gst tensots info.
+ * @brief Copies tensor meta info from gst tensors info.
  */
 void
 ml_util_copy_tensors_info_from_ml (GstTensorsInfo * gst_info,
index 22f103a..7c384b5 100644 (file)
@@ -375,8 +375,7 @@ TEST (nnstreamer_capi_sink, dummy_01)
   int status = ml_pipeline_construct (pipeline, &handle);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
-  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_dm01,
-      &sinkhandle, file2);
+  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_dm01, file2, &sinkhandle);
 
   status = ml_pipeline_start (handle);
   EXPECT_EQ (status, ML_ERROR_NONE);
@@ -432,7 +431,7 @@ TEST (nnstreamer_capi_sink, dummy_02)
   status = ml_pipeline_construct (pipeline, &handle);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
-  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
   status = ml_pipeline_start (handle);
@@ -484,30 +483,30 @@ TEST (nnstreamer_capi_sink, failure_01)
   EXPECT_EQ (status, ML_ERROR_NONE);
 
   /* invalid param : pipe */
-  status = ml_pipeline_sink_register (NULL, "sinkx", test_sink_callback_count, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (NULL, "sinkx", test_sink_callback_count, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_INVALID_PARAMETER);
 
   /* invalid param : name */
-  status = ml_pipeline_sink_register (handle, NULL, test_sink_callback_count, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (handle, NULL, test_sink_callback_count, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_INVALID_PARAMETER);
 
   /* invalid param : wrong name */
-  status = ml_pipeline_sink_register (handle, "wrongname", test_sink_callback_count, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (handle, "wrongname", test_sink_callback_count, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_INVALID_PARAMETER);
 
   /* invalid param : invalid type */
-  status = ml_pipeline_sink_register (handle, "valvex", test_sink_callback_count, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (handle, "valvex", test_sink_callback_count, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_INVALID_PARAMETER);
 
   /* invalid param : callback */
-  status = ml_pipeline_sink_register (handle, "sinkx", NULL, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (handle, "sinkx", NULL, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_INVALID_PARAMETER);
 
   /* invalid param : handle */
-  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, NULL, count_sink);
+  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, count_sink, NULL);
   EXPECT_EQ (status, ML_ERROR_INVALID_PARAMETER);
 
-  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
   status = ml_pipeline_start (handle);
@@ -826,7 +825,7 @@ TEST (nnstreamer_capi_switch, dummy_01)
     EXPECT_EQ (idx, 2U);
   }
 
-  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, &sinkhandle, count_sink);
+  status = ml_pipeline_sink_register (handle, "sinkx", test_sink_callback_count, count_sink, &sinkhandle);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
   status = ml_pipeline_switch_select (switchhandle, "sink_1");
@@ -906,10 +905,10 @@ TEST (nnstreamer_capi_switch, dummy_02)
     EXPECT_EQ (idx, 2U);
   }
 
-  status = ml_pipeline_sink_register (handle, "sink0", test_sink_callback_count, &sinkhandle0, count_sink0);
+  status = ml_pipeline_sink_register (handle, "sink0", test_sink_callback_count, count_sink0, &sinkhandle0);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
-  status = ml_pipeline_sink_register (handle, "sink1", test_sink_callback_count, &sinkhandle1, count_sink1);
+  status = ml_pipeline_sink_register (handle, "sink1", test_sink_callback_count, count_sink1, &sinkhandle1);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
   status = ml_pipeline_switch_select (switchhandle, "src_1");