From ca1e003a9ad5a6dbb2f5fa5f4a10f25a2d91cd83 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Wed, 22 Jul 2020 11:20:36 +0900 Subject: [PATCH] C-API/ml_pipeline_src_input_data new enum for events suggstion. In order to give events to appsrc via ml_pipeline_src_input_data, I'd like to suggest to use "policy" argument to keep "data" uncomplicated. We can simply add non-policy enum values to have general event support; if you need some value for an event, you can keep using "data". Signed-off-by: MyungJoo Ham --- api/capi/include/nnstreamer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/capi/include/nnstreamer.h b/api/capi/include/nnstreamer.h index a49362a..721b8de 100644 --- a/api/capi/include/nnstreamer.h +++ b/api/capi/include/nnstreamer.h @@ -190,6 +190,7 @@ typedef enum { ML_PIPELINE_BUF_POLICY_AUTO_FREE = 0, /**< Default. Application should not deallocate this buffer. NNStreamer will deallocate when the buffer is no more needed. */ ML_PIPELINE_BUF_POLICY_DO_NOT_FREE = 1, /**< This buffer is not to be freed by NNStreamer (i.e., it's a static object). However, be careful: NNStreamer might be accessing this object after the return of the API call. */ ML_PIPELINE_BUF_POLICY_MAX, /**< Max size of #ml_pipeline_buf_policy_e structure. */ + ML_PIPELINE_BUF_SRC_EVENT_EOS = 0x10000, /**< Trigger End-Of-Stream event for the corresponding appsrc and ignore the given input value. The correspnding appsrc will no longer accept new data after this. */ } ml_pipeline_buf_policy_e; /** @@ -417,7 +418,7 @@ int ml_pipeline_src_release_handle (ml_pipeline_src_h src_handle); * @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(). * This function takes ownership of the data if @a policy is #ML_PIPELINE_BUF_POLICY_AUTO_FREE. - * @param[in] policy The policy of buffer deallocation. + * @param[in] policy The policy of buffer deallocation. The policy value may include buffer deallocation mechanisms or event triggers for appsrc elements. If event triggers are provided, these functions will not give input data to the appsrc element, but will trigger the given event only. * @return 0 on success. Otherwise a negative error value. * @retval #ML_ERROR_NONE Successful. * @retval #ML_ERROR_NOT_SUPPORTED Not supported. -- 2.7.4