[UTC/ITC][nnstreamer][Non-ACR] Modify string get/set pipeline 87/272587/1
authorgichan <gichan2.jang@samsung.com>
Mon, 21 Mar 2022 07:16:26 +0000 (16:16 +0900)
committergichan <gichan2.jang@samsung.com>
Mon, 21 Mar 2022 07:16:26 +0000 (16:16 +0900)
Modify the test to get/set the string using the tensor rate instead of the demux.

Change-Id: I5d94a7dabb5880a00038efd39242350cbcb8afc7
Signed-off-by: gichan <gichan2.jang@samsung.com>
src/itc/nnstreamer/ITs-nnstreamer-capi.c
src/utc/nnstreamer/utc-nnstreamer-capi.c

index 506f387d445fcf8eeed574a2d4c6c7fbf4a7e519..47e847879cc09117e518b6d74924fecc1a6f833a 100755 (executable)
@@ -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);
index 80f06f2177ee293c252217944dfac28f49bf09d1..29bca6eb5e773c6b8b400e75d266db20d8b0fa02 100644 (file)
@@ -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);