[ITC][nnstreamer][ACR-1571][Added changes to start, stop and destroy the pipeline] 75/240875/3
authorPriya Kohli <priya.kohli@samsung.com>
Wed, 12 Aug 2020 09:10:55 +0000 (14:40 +0530)
committershobhit verma <shobhit.v@samsung.com>
Wed, 12 Aug 2020 13:28:36 +0000 (13:28 +0000)
Change-Id: Id1e3c6da34c7ee48c1f4c3c8a02d5ae988b35626
Signed-off-by: Priya Kohli <priya.kohli@samsung.com>
src/itc/nnstreamer/ITs-nnstreamer-capi.c

index bf075f776450322ac0a0c16b2a0597c4bfe52125..9a0cd8283a37610ed001827828a0107c5c087e15 100644 (file)
@@ -736,6 +736,9 @@ int ITc_nnstreamer_ml_pipeline_custom_easy_filter_register_unregister_p(void)
        PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_src_get_handle", NnStreamerGetError(nRet), ml_tensors_info_destroy (hTensorinfoOutHandle); ml_pipeline_destroy (hMlPipeline));
        CHECK_HANDLE_CLEANUP(hPipeSrcHandle, "ml_pipeline_src_get_handle", ml_tensors_info_destroy (hTensorinfoInHandle); ml_tensors_info_destroy (hTensorinfoOutHandle); ml_pipeline_destroy (hMlPipeline));
 
+       nRet = ml_pipeline_start (hMlPipeline);
+       PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_start", NnStreamerGetError(nRet), ml_tensors_info_destroy (hTensorinfoOutHandle); ml_pipeline_destroy (hMlPipeline); ml_pipeline_src_release_handle (hPipeSrcHandle));
+
        for (nSt = 0; nSt < nEnd; nSt++) {
                nRet = ml_tensors_data_create (hTensorinfoInHandle, &hTensorsDataHandle);
                PRINT_RESULT(ML_ERROR_NONE, nRet, "ml_tensors_data_create", NnStreamerGetError(nRet));
@@ -748,6 +751,9 @@ int ITc_nnstreamer_ml_pipeline_custom_easy_filter_register_unregister_p(void)
        }
        PRINT_RESULT_CLEANUP(true, g_bCallbackHit, "ml_pipeline_custom_easy_filter_register", NnStreamerGetError(nRet), ml_tensors_info_destroy (hTensorinfoInHandle); ml_tensors_info_destroy (hTensorinfoOutHandle); ml_pipeline_destroy (hMlPipeline); ml_pipeline_src_release_handle (hPipeSrcHandle); ml_tensors_data_destroy(hTensorsDataHandle));
 
+       nRet = ml_pipeline_stop (hMlPipeline);
+       PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_stop", NnStreamerGetError(nRet), ml_tensors_info_destroy (hTensorinfoInHandle); ml_tensors_info_destroy (hTensorinfoOutHandle); ml_pipeline_destroy (hMlPipeline); ml_pipeline_src_release_handle (hPipeSrcHandle); ml_tensors_data_destroy(hTensorsDataHandle));
+
        nRet = ml_pipeline_custom_easy_filter_unregister (hCustom);
        PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_custom_easy_filter_unregister", NnStreamerGetError(nRet), ml_tensors_info_destroy (hTensorinfoInHandle); ml_tensors_info_destroy (hTensorinfoOutHandle); ml_pipeline_destroy (hMlPipeline); ml_pipeline_src_release_handle (hPipeSrcHandle); ml_tensors_data_destroy(hTensorsDataHandle));
 
@@ -760,6 +766,9 @@ int ITc_nnstreamer_ml_pipeline_custom_easy_filter_register_unregister_p(void)
        nRet = ml_pipeline_src_release_handle (hPipeSrcHandle);
        PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRet, "ml_pipeline_src_release_handle", NnStreamerGetError(nRet));
 
+       nRet = ml_pipeline_destroy (hMlPipeline);
+       PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRet, "ml_pipeline_destroy", NnStreamerGetError(nRet));
+
        g_free (filter_data_size);
 
        return 0;