export LD_LIBRARY_PATH=${PATH_TO_PLUGIN_EXTRA}:${LD_LIBRARY_PATH}
NUM_BUFFERS=10
-
TIMEOUT_SEC=10
-## Check if a pipeline is launched and playing
-function waitformarker {
- for i in $(seq 1 ${TIMEOUT_SEC})
- do
- if [ -f 'marker.log' ]; then
- markersize=$(${StatCmd_GetSize} marker.log)
- if [ $markersize -ge 48 ]; then
- testResult 1 $1 "$2" 0 0
- return 0
- fi
- fi
- sleep 1
- done
- testResult 0 $1 "$2" 0 0
- exit
-}
-WAIT4MARKER=" videotestsrc num-buffers=1 ! video/x-raw,format=RGB,height=4,width=4 ! filesink location=marker.log "
## Initial pipelines to generate reference outputs
# passthrough, other/tensor
fi
# tensor_sink (client) --> tensor_src (server), other/tensor
- rm -f marker.log
- gst-launch-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=${NUM_BUFFERS} idl=${IDL} blocking=${BLOCKING} ! 'other/tensor,dimension=(string)3:640:480,type=(string)uint8,framerate=(fraction)5/1' ! multifilesink async=false location=result_%1d.log ${WAIT4MARKER} &
- pid=$!
- waitformarker ${INDEX}-1 "tensor_src_grpc ${INDEX}-1 launching in parallel"
+ gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=${NUM_BUFFERS} idl=${IDL} blocking=${BLOCKING} ! other/tensor,dimension=3:640:480,type=uint8,framerate=5/1 ! multifilesink async=false location=result_%1d.log" ${INDEX}-1 0 0 ${TIMEOUT_SEC}
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=${NUM_BUFFERS} ! video/x-raw,width=640,height=480,framerate=5/1 ! tensor_converter ! tensor_sink_grpc port=${PORT} idl=${IDL} blocking=${BLOCKING}" ${INDEX}-2 0 0 $PERFORMANCE
kill -9 $pid &> /dev/null
wait $pid
PORT=`python3 ../get_available_port.py`
# tensor_sink (server) --> tensor_src (client), other/tensor
- rm -f marker.log
- gst-launch-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=${NUM_BUFFERS} ! video/x-raw,width=640,height=480,framerate=5/1 ! tensor_converter ! tensor_sink_grpc port=${PORT} server=true idl=${IDL} blocking=${BLOCKING} async=false ${WAIT4MARKER} &
- pid=$!
- waitformarker ${INDEX}-1 "tensor-sink_grpc ${INDEX}-1 launching in parallel"
- gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=${NUM_BUFFERS} server=false idl=${IDL} blocking=${BLOCKING} ! 'other/tensor,dimension=(string)3:640:480,type=(string)uint8,framerate=(fraction)5/1' ! multifilesink location=result_%1d.log" ${INDEX}-2 0 0 $PERFORMANCE
+ gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=${NUM_BUFFERS} ! video/x-raw,width=640,height=480,framerate=5/1 ! tensor_converter ! tensor_sink_grpc port=${PORT} server=true idl=${IDL} blocking=${BLOCKING} async=false" ${INDEX}-1 0 0 ${TIMEOUT_SEC}
+ gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=${NUM_BUFFERS} server=false idl=${IDL} blocking=${BLOCKING} ! other/tensor,dimension=3:640:480,type=uint8,framerate=5/1 ! multifilesink location=result_%1d.log" ${INDEX}-2 0 0 $PERFORMANCE
kill -9 $pid &> /dev/null
wait $pid
PORT=`python3 ../get_available_port.py`
# tensor_sink (client) --> tensor_src (server), other/tensors
- rm -f marker.log
- gst-launch-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=$((NUM_BUFFERS/2)) idl=${IDL} blocking=${BLOCKING} ! 'other/tensors,num_tensors=2,dimensions=(string)3:640:480.3:640:480,types=(string)uint8.uint8,framerate=(fraction)5/1' ! multifilesink async=false location=result_%1d.log ${WAIT4MARKER} &
- pid=$!
- waitformarker ${INDEX}-1 "tensor-src-grpc ${INDEX}-1 launching in parallel"
+ gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=$((NUM_BUFFERS/2)) idl=${IDL} blocking=${BLOCKING} ! other/tensors,num_tensors=2,dimensions=3:640:480.3:640:480,types=uint8.uint8,framerate=5/1 ! multifilesink async=false location=result_%1d.log" ${INDEX}-1 0 0 ${TIMEOUT_SEC}
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=${NUM_BUFFERS} ! video/x-raw,width=640,height=480,framerate=5/1 ! tensor_converter frames-per-tensor=2 ! tensor_sink_grpc port=${PORT} idl=${IDL} blocking=${BLOCKING}" ${INDEX}-2 0 0 $PERFORMANCE
kill -9 $pid &> /dev/null
wait $pid
PORT=`python3 ../get_available_port.py`
# tensor_sink (server) --> tensor_src (client), other/tensors
- rm -f marker.log
- gst-launch-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=${NUM_BUFFERS} ! video/x-raw,width=640,height=480,framerate=5/1 ! tensor_converter frames-per-tensor=2 ! tensor_sink_grpc port=${PORT} server=true idl=${IDL} blocking=${BLOCKING} async=false ${WAIT4MARKER} &
- pid=$!
- waitformarker ${INDEX}-1 "tensor-sink-grpc ${INDEX}-1 launching in parallel"
- gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=$((NUM_BUFFERS/2)) server=false idl=${IDL} blocking=${BLOCKING} ! 'other/tensors,num_tensors=2,dimensions=(string)3:640:480.3:640:480,types=(string)uint8.uint8,framerate=(fraction)5/1' ! multifilesink location=result_%1d.log" ${INDEX}-2 0 0 $PERFORMANCE
+ gstTestBackground " --gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=${NUM_BUFFERS} ! video/x-raw,width=640,height=480,framerate=5/1 ! tensor_converter frames-per-tensor=2 ! tensor_sink_grpc port=${PORT} server=true idl=${IDL} blocking=${BLOCKING} async=false" ${INDEX}-1 0 0 ${TIMEOUT_SEC}
+ gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_src_grpc port=${PORT} num-buffers=$((NUM_BUFFERS/2)) server=false idl=${IDL} blocking=${BLOCKING} ! other/tensors,num_tensors=2,dimensions=3:640:480.3:640:480,types=uint8.uint8,framerate=5/1 ! multifilesink location=result_%1d.log" ${INDEX}-2 0 0 $PERFORMANCE
kill -9 $pid &> /dev/null
wait $pid