From: gichan Date: Mon, 21 Mar 2022 07:16:26 +0000 (+0900) Subject: [UTC/ITC][nnstreamer][Non-ACR] Modify string get/set pipeline X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05d1e57347e36335368853e5b5deafff8dbab8a1;p=test%2Ftct%2Fnative%2Fapi.git [UTC/ITC][nnstreamer][Non-ACR] Modify string get/set pipeline Modify the test to get/set the string using the tensor rate instead of the demux. Change-Id: I5d94a7dabb5880a00038efd39242350cbcb8afc7 Signed-off-by: gichan --- diff --git a/src/itc/nnstreamer/ITs-nnstreamer-capi.c b/src/itc/nnstreamer/ITs-nnstreamer-capi.c index 506f387d4..47e847879 100755 --- a/src/itc/nnstreamer/ITs-nnstreamer-capi.c +++ b/src/itc/nnstreamer/ITs-nnstreamer-capi.c @@ -285,32 +285,35 @@ int ITc_nnstreamer_ml_pipeline_element_set_get_property_string_p(void) { START_TEST; int nRet = -1; - char *pszPipeLine = "videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! " \ - "tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink"; + char *pszPipeLine = "videotestsrc is-live=true ! videoconvert ! videoscale ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! " \ + "tensor_rate name=trate framerate=45/1 throttle=false ! tensor_sink"; + + ml_pipeline_h hMlPipeline = NULL; - ml_pipeline_element_h hMlDemux = NULL; - const char *pszElementName = "demux"; - const char *pszPropertyName = "tensorpick"; - const char *pszSetProperty = "0"; + ml_pipeline_element_h hMlRate = NULL; + const char *pszElementName = "trate"; + const char *pszPropertyName = "framerate"; + const char *pszSetProperty = "60/1"; char *pszGetProperty = NULL; nRet = ml_pipeline_construct (pszPipeLine, NULL, NULL, &hMlPipeline); PRINT_RESULT(ML_ERROR_NONE, nRet, "ml_pipeline_construct", NnStreamerGetError(nRet)); CHECK_HANDLE(hMlPipeline, "ml_pipeline_construct"); - nRet = ml_pipeline_element_get_handle (hMlPipeline, pszElementName, &hMlDemux); + nRet = ml_pipeline_element_get_handle (hMlPipeline, pszElementName, &hMlRate); PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_element_get_handle", NnStreamerGetError(nRet),ml_pipeline_destroy (hMlPipeline)); - CHECK_HANDLE_CLEANUP(hMlDemux, "ml_pipeline_element_get_handle", ml_pipeline_destroy (hMlPipeline)); + CHECK_HANDLE_CLEANUP(hMlRate, "ml_pipeline_element_get_handle", ml_pipeline_destroy (hMlPipeline)); - nRet = ml_pipeline_element_set_property_string (hMlDemux, pszPropertyName, pszSetProperty); - PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_element_set_property_string", NnStreamerGetError(nRet),ml_pipeline_destroy (hMlPipeline); ml_pipeline_element_release_handle (hMlDemux)); + nRet = ml_pipeline_element_set_property_string (hMlRate, pszPropertyName, pszSetProperty); + PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_element_set_property_string", NnStreamerGetError(nRet),ml_pipeline_destroy (hMlPipeline); ml_pipeline_element_release_handle (hMlRate)); - nRet = ml_pipeline_element_get_property_string (hMlDemux, pszPropertyName, &pszGetProperty); - PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_element_get_property_string", NnStreamerGetError(nRet),ml_pipeline_destroy (hMlPipeline); ml_pipeline_element_release_handle (hMlDemux)); + nRet = ml_pipeline_element_get_property_string (hMlRate, pszPropertyName, &pszGetProperty); + PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_pipeline_element_get_property_string", NnStreamerGetError(nRet),ml_pipeline_destroy (hMlPipeline); ml_pipeline_element_release_handle (hMlRate)); if ( 0 != strncmp(pszSetProperty, pszGetProperty, strlen(pszSetProperty)) ) { FPRINTF("[%s:%d] TC Failed Reason; Set Value %s and Get value %s of property name is not same\\n", __FILE__, __LINE__, pszSetProperty, pszGetProperty); - nRet = ml_pipeline_element_release_handle (hMlDemux); + nRet = ml_pipeline_element_release_handle (hMlRate); PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRet, "ml_pipeline_element_release_handle", NnStreamerGetError(nRet)); nRet = ml_pipeline_destroy (hMlPipeline); @@ -319,7 +322,7 @@ int ITc_nnstreamer_ml_pipeline_element_set_get_property_string_p(void) return 1; } - nRet = ml_pipeline_element_release_handle (hMlDemux); + nRet = ml_pipeline_element_release_handle (hMlRate); PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRet, "ml_pipeline_element_release_handle", NnStreamerGetError(nRet)); nRet = ml_pipeline_destroy (hMlPipeline); diff --git a/src/utc/nnstreamer/utc-nnstreamer-capi.c b/src/utc/nnstreamer/utc-nnstreamer-capi.c index 80f06f217..29bca6eb5 100644 --- a/src/utc/nnstreamer/utc-nnstreamer-capi.c +++ b/src/utc/nnstreamer/utc-nnstreamer-capi.c @@ -550,24 +550,25 @@ int utc_nnstreamer_capi_element_set_string_property_p (void) { IS_SUPPORT_FEATURE; ml_pipeline_h handle = NULL; - ml_pipeline_element_h demux_h = NULL; + ml_pipeline_element_h rate_h = NULL; gchar *pipeline; int status; - pipeline = g_strdup("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! " \ - "tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink"); + pipeline = g_strdup("videotestsrc is-live=true ! videoconvert ! videoscale ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! " \ + "tensor_rate name=trate framerate=45/1 throttle=false ! tensor_sink"); status = ml_pipeline_construct (pipeline, NULL, NULL, &handle); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_get_handle (handle, "demux", &demux_h); + status = ml_pipeline_element_get_handle (handle, "trate", &rate_h); assert_eq (status, ML_ERROR_NONE); /* Test Code */ - status = ml_pipeline_element_set_property_string (demux_h, "tensorpick", "0"); + status = ml_pipeline_element_set_property_string (rate_h, "framerate", "60/1"); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_release_handle (demux_h); + status = ml_pipeline_element_release_handle (rate_h); assert_eq (status, ML_ERROR_NONE); status = ml_pipeline_destroy (handle); @@ -589,7 +590,7 @@ int utc_nnstreamer_capi_element_set_string_property_n1 (void) int status; /* Test Code */ - status = ml_pipeline_element_set_property_string (NULL, "tensorpick", "0"); + status = ml_pipeline_element_set_property_string (NULL, "framerate", "60/1"); assert_neq (status, ML_ERROR_NONE); return 0; @@ -604,24 +605,25 @@ int utc_nnstreamer_capi_element_set_string_property_n2 (void) { IS_SUPPORT_FEATURE; ml_pipeline_h handle = NULL; - ml_pipeline_element_h demux_h = NULL; + ml_pipeline_element_h rate_h = NULL; gchar *pipeline; int status; - pipeline = g_strdup("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! " \ - "tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink"); + pipeline = g_strdup("videotestsrc is-live=true ! videoconvert ! videoscale ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! " \ + "tensor_rate name=trate framerate=45/1 throttle=false ! tensor_sink"); status = ml_pipeline_construct (pipeline, NULL, NULL, &handle); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_get_handle (handle, "demux", &demux_h); + status = ml_pipeline_element_get_handle (handle, "trate", &rate_h); assert_eq (status, ML_ERROR_NONE); /* Test Code */ - status = ml_pipeline_element_set_property_string (demux_h, "WRONG_NAME", "0"); + status = ml_pipeline_element_set_property_string (rate_h, "WRONG_NAME", "60/1"); assert_neq (status, ML_ERROR_NONE); - status = ml_pipeline_element_release_handle (demux_h); + status = ml_pipeline_element_release_handle (rate_h); assert_eq (status, ML_ERROR_NONE); status = ml_pipeline_destroy (handle); @@ -641,30 +643,31 @@ int utc_nnstreamer_capi_element_get_string_property_p (void) { IS_SUPPORT_FEATURE; ml_pipeline_h handle = NULL; - ml_pipeline_element_h demux_h = NULL; + ml_pipeline_element_h rate_h = NULL; gchar *pipeline; - gchar *ret_tensorpick; + gchar *ret_trate; int status; - pipeline = g_strdup("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! " \ - "tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink"); + pipeline = g_strdup("videotestsrc is-live=true ! videoconvert ! videoscale ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! " \ + "tensor_rate name=trate framerate=45/1 throttle=false ! tensor_sink"); status = ml_pipeline_construct (pipeline, NULL, NULL, &handle); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_get_handle (handle, "demux", &demux_h); + status = ml_pipeline_element_get_handle (handle, "trate", &rate_h); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_set_property_string (demux_h, "tensorpick", "0"); + status = ml_pipeline_element_set_property_string (rate_h, "framerate", "60/1"); assert_eq (status, ML_ERROR_NONE); /* Test Code */ - status = ml_pipeline_element_get_property_string (demux_h, "tensorpick", &ret_tensorpick); + status = ml_pipeline_element_get_property_string (rate_h, "framerate", &ret_trate); assert_eq (status, ML_ERROR_NONE); - assert_eq (g_str_equal (ret_tensorpick, "0"), TRUE); - g_free (ret_tensorpick); + assert_eq (g_str_equal (ret_trate, "60/1"), TRUE); + g_free (ret_trate); - status = ml_pipeline_element_release_handle (demux_h); + status = ml_pipeline_element_release_handle (rate_h); assert_eq (status, ML_ERROR_NONE); status = ml_pipeline_destroy (handle); @@ -684,10 +687,10 @@ int utc_nnstreamer_capi_element_get_string_property_n1 (void) { IS_SUPPORT_FEATURE; int status; - gchar *ret_tensorpick; + gchar *ret_trate; /* Test Code */ - status = ml_pipeline_element_get_property_string (NULL, "tensorpick", &ret_tensorpick); + status = ml_pipeline_element_get_property_string (NULL, "framerate", &ret_trate); assert_neq (status, ML_ERROR_NONE); return 0; @@ -702,28 +705,29 @@ int utc_nnstreamer_capi_element_get_string_property_n2 (void) { IS_SUPPORT_FEATURE; ml_pipeline_h handle = NULL; - ml_pipeline_element_h demux_h = NULL; + ml_pipeline_element_h rate_h = NULL; gchar *pipeline; - gchar *ret_tensorpick; + gchar *ret_trate; int status; - pipeline = g_strdup("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! " \ - "tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink"); + pipeline = g_strdup("videotestsrc is-live=true ! videoconvert ! videoscale ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! " \ + "tensor_rate name=trate framerate=45/1 throttle=false ! tensor_sink"); status = ml_pipeline_construct (pipeline, NULL, NULL, &handle); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_get_handle (handle, "demux", &demux_h); + status = ml_pipeline_element_get_handle (handle, "trate", &rate_h); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_set_property_string (demux_h, "tensorpick", "0"); + status = ml_pipeline_element_set_property_string (rate_h, "framerate", "60/1"); assert_eq (status, ML_ERROR_NONE); /* Test Code */ - status = ml_pipeline_element_get_property_string (demux_h, "WRONG_NAME", &ret_tensorpick); + status = ml_pipeline_element_get_property_string (rate_h, "WRONG_NAME", &ret_trate); assert_neq (status, ML_ERROR_NONE); - status = ml_pipeline_element_release_handle (demux_h); + status = ml_pipeline_element_release_handle (rate_h); assert_eq (status, ML_ERROR_NONE); status = ml_pipeline_destroy (handle); @@ -743,27 +747,28 @@ int utc_nnstreamer_capi_element_get_string_property_n3 (void) { IS_SUPPORT_FEATURE; ml_pipeline_h handle = NULL; - ml_pipeline_element_h demux_h = NULL; + ml_pipeline_element_h rate_h = NULL; gchar *pipeline; int status; - pipeline = g_strdup("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! " \ - "tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink"); + pipeline = g_strdup("videotestsrc is-live=true ! videoconvert ! videoscale ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! " \ + "tensor_rate name=trate framerate=45/1 throttle=false ! tensor_sink"); status = ml_pipeline_construct (pipeline, NULL, NULL, &handle); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_get_handle (handle, "demux", &demux_h); + status = ml_pipeline_element_get_handle (handle, "trate", &rate_h); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_set_property_string (demux_h, "tensorpick", "0"); + status = ml_pipeline_element_set_property_string (rate_h, "framerate", "60/1"); assert_eq (status, ML_ERROR_NONE); /* Test Code */ - status = ml_pipeline_element_get_property_string (demux_h, "tensorpick", NULL); + status = ml_pipeline_element_get_property_string (rate_h, "framerate", NULL); assert_neq (status, ML_ERROR_NONE); - status = ml_pipeline_element_release_handle (demux_h); + status = ml_pipeline_element_release_handle (rate_h); assert_eq (status, ML_ERROR_NONE); status = ml_pipeline_destroy (handle); @@ -783,28 +788,29 @@ int utc_nnstreamer_capi_element_get_string_property_n4 (void) { IS_SUPPORT_FEATURE; ml_pipeline_h handle = NULL; - ml_pipeline_element_h demux_h = NULL; + ml_pipeline_element_h rate_h = NULL; gchar *pipeline; int ret_wrong_type; int status; - pipeline = g_strdup("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! " \ - "tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink"); + pipeline = g_strdup("videotestsrc is-live=true ! videoconvert ! videoscale ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! " \ + "tensor_rate name=trate framerate=45/1 throttle=false ! tensor_sink"); status = ml_pipeline_construct (pipeline, NULL, NULL, &handle); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_get_handle (handle, "demux", &demux_h); + status = ml_pipeline_element_get_handle (handle, "trate", &rate_h); assert_eq (status, ML_ERROR_NONE); - status = ml_pipeline_element_set_property_string (demux_h, "tensorpick", "0"); + status = ml_pipeline_element_set_property_string (rate_h, "framerate", "60/1"); assert_eq (status, ML_ERROR_NONE); /* Test Code */ - status = ml_pipeline_element_get_property_int32 (demux_h, "tensorpick", &ret_wrong_type); + status = ml_pipeline_element_get_property_int32 (rate_h, "framerate", &ret_wrong_type); assert_neq (status, ML_ERROR_NONE); - status = ml_pipeline_element_release_handle (demux_h); + status = ml_pipeline_element_release_handle (rate_h); assert_eq (status, ML_ERROR_NONE); status = ml_pipeline_destroy (handle);