# @name USB Host Video class. 
# @desc Test cases corresponding to USB Host Video  class. 
# @requires usb/host/iso
# @setup_requires usbhostvideo

USBHOST_M_FUNC_VIDEO_176_144  source 'common.sh' ; do_cmd install_modules.sh 'usb';  DEV_NAME=`usb_video_search_devices.sh usb`; do_cmd usb_host_video.sh -w 176 -l 144 -i $HOME/176_144_M_usb.YUV -d $DEV_NAME

USBHOST_S_FUNC_VIDEO_320_240  source 'common.sh' ; do_cmd install_modules.sh 'usb';  DEV_NAME=`usb_video_search_devices.sh usb`; do_cmd usb_host_video.sh -w 320 -l 240 -i $HOME/320_240_S_usb.YUV -d $DEV_NAME

USBHOST_M_FUNC_VIDEO_640_480  source 'common.sh' ; do_cmd install_modules.sh 'usb';  DEV_NAME=`usb_video_search_devices.sh usb`; do_cmd usb_host_video.sh -w 640 -l 480 -i $HOME/640_480_M_usb.YUV -d $DEV_NAME

USBHOST_S_FUNC_GST_fr_30_res_640_480  source 'common.sh' ; do_cmd install_modules.sh 'usb';  DEV_NAME=`usb_video_search_devices.sh usb`; do_cmd "timeout 30 gst-launch-0.10 v4l2src num-buffers=100 device=$DEV_NAME ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! ffmpegcolorspace ! fbdevsink device=/dev/fb"

USBHOST_M_FUNC_GST_fr_30_res_640_480  source 'common.sh' ; do_cmd install_modules.sh 'usb';  DEV_NAME=`usb_video_search_devices.sh usb`; do_cmd "timeout 600 gst-launch-0.10 v4l2src num-buffers=10000 device=$DEV_NAME ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! ffmpegcolorspace ! fbdevsink device=/dev/fb"

USBHOST_S_STRESS_GST_fr_30_res_640_480  source 'common.sh' ; do_cmd install_modules.sh 'usb';  DEV_NAME=`usb_video_search_devices.sh usb`; for i in {1..10}; do do_cmd "timeout 30 gst-launch-0.10 v4l2src num-buffers=100 device=$DEV_NAME ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! ffmpegcolorspace ! fbdevsink device=/dev/fb";done

USBHOST_S_FUNC_CAMERA_VPE_640x480 source video_capture_functions.sh; video_devs=$(get_usb_camera_nodes); vpe_node=$(get_vpe_nodes); for v_node in $video_devs; do gst-launch-1.0 v4l2src device=${v_node} io-mode=5 num-buffers=500 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480' ! v4l2${vpe_node}convert capture-io-mode=4 output-io-mode=4 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! fakesink || die "USB Camera + VPE capture operation failed"; done
