PATH_TO_MODEL="../test_models/models/deeplabv3_257_mv_gpu.tflite"
# THIS SHOULD EMIT ERROR
-gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc ! videoconvert ! videoscale ! video/x-raw,format=RGB,width=640,height=480 ! tee name=t t. ! queue ! mix. t. ! queue ! tensor_converter ! tensor_transform mode=arithmetic option=typecast:float32,div:255.0 ! tensor_filter framework=tensorflow-lite model=${PATH_TO_MODEL} ! tensor_decoder mode=image_segment option1=tflite-deeplab ! mix. videomixer name=mix sink_0::alpha=0.7 sink_1::alpha=0.6 ! videoconvert ! fakesink" 0_n 0 1
+gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num_buffers=1 ! videoconvert ! videoscale ! video/x-raw,format=RGB,width=640,height=480 ! tee name=t t. ! queue ! mix. t. ! queue ! tensor_converter ! tensor_transform mode=arithmetic option=typecast:float32,div:255.0 ! tensor_filter framework=tensorflow-lite model=${PATH_TO_MODEL} ! tensor_decoder mode=image_segment option1=tflite-deeplab ! mix. videomixer name=mix sink_0::alpha=0.7 sink_1::alpha=0.6 ! videoconvert ! fakesink" 0_n 0 1
# THIS WON'T FAIL, BUT NOT MUCH MEANINGFUL.
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num_buffers=4 ! videoconvert ! videoscale ! video/x-raw,format=RGB,width=257,height=257 ! tee name=t t. ! queue ! mix. t. ! queue ! tensor_converter ! tensor_transform mode=arithmetic option=typecast:float32,div:255.0 ! tensor_filter framework=tensorflow-lite model=${PATH_TO_MODEL} ! tensor_decoder mode=image_segment option1=tflite-deeplab ! mix. videomixer name=mix sink_0::alpha=0.7 sink_1::alpha=0.6 ! videoconvert ! fakesink" 0_p 0 0
gchar *file2 = g_build_path ("/", dir, "sink", NULL);
gchar *pipeline =
g_strdup_printf
- ("videotestsrc num-buffers=3 ! videoconvert ! video/x-raw,format=BGRx,width=64,height=48,famerate=60/1 ! tee name=t t. ! queue ! filesink location=\"%s\" t. ! queue ! tensor_converter ! tensor_sink name=sinkx",
+ ("videotestsrc num-buffers=3 ! videoconvert ! videoscale ! video/x-raw,format=BGRx,width=64,height=48,famerate=30/1 ! tee name=t t. ! queue ! filesink location=\"%s\" buffer-mode=unbuffered t. ! queue ! tensor_converter ! tensor_sink name=sinkx",
file1);
ml_pipeline_h handle;
- ml_pipeline_state_e state;
ml_pipeline_sink_h sinkhandle;
int status = ml_pipeline_construct (pipeline, NULL, NULL, &handle);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_pipeline_start (handle);
EXPECT_EQ (status, ML_ERROR_NONE);
- g_usleep (10000); /* 10ms. Wait a bit. */
- status = ml_pipeline_get_state (handle, &state);
- EXPECT_EQ (status, ML_ERROR_NONE); /* At this moment, it can be READY, PAUSED, or PLAYING */
- EXPECT_NE (state, ML_PIPELINE_STATE_UNKNOWN);
- EXPECT_NE (state, ML_PIPELINE_STATE_NULL);
- g_usleep (100000); /* 100ms. Let a few frames flow. */
- status = ml_pipeline_get_state (handle, &state);
- EXPECT_EQ (status, ML_ERROR_NONE);
- EXPECT_EQ (state, ML_PIPELINE_STATE_PLAYING);
+ g_usleep (500000); /* 500ms. Let a few frames flow. */
status = ml_pipeline_stop (handle);
EXPECT_EQ (status, ML_ERROR_NONE);
g_usleep (10000); /* 10ms. Wait a bit. */
- status = ml_pipeline_get_state (handle, &state);
- EXPECT_EQ (status, ML_ERROR_NONE);
- EXPECT_EQ (state, ML_PIPELINE_STATE_PAUSED);
-
status = ml_pipeline_sink_unregister (sinkhandle);
EXPECT_EQ (status, ML_ERROR_NONE);