From 105134f9a7a3faad9f02a6a5516a8cd8e625fb04 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Wed, 1 May 2019 16:37:19 -0400 Subject: uvc-gadget.sh: add mjpeg Add MJPEG configfs setup to uvc-gadget.sh. In order to get it to work, I had to add another two parameters to create_frame() to specify the format (uncompressed vs mjpeg) and to specify the format descriptor name. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- scripts/uvc-gadget.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/uvc-gadget.sh b/scripts/uvc-gadget.sh index daf85c2..8e4b6d5 100755 --- a/scripts/uvc-gadget.sh +++ b/scripts/uvc-gadget.sh @@ -87,13 +87,15 @@ delete_msd() { create_frame() { # Example usage: - # create_frame + # create_frame FUNCTION=$1 WIDTH=$2 HEIGHT=$3 + FORMAT=$4 + NAME=$5 - wdir=functions/$FUNCTION/streaming/uncompressed/u/${HEIGHT}p + wdir=functions/$FUNCTION/streaming/$FORMAT/$NAME/${HEIGHT}p mkdir -p $wdir echo $WIDTH > $wdir/wWidth @@ -116,13 +118,15 @@ create_uvc() { echo " Creating UVC gadget functionality : $FUNCTION" mkdir functions/$FUNCTION - create_frame $FUNCTION 640 360 - create_frame $FUNCTION 1280 720 - create_frame $FUNCTION 320 180 + create_frame $FUNCTION 640 360 uncompressed u + create_frame $FUNCTION 1280 720 uncompressed u + create_frame $FUNCTION 320 180 uncompressed u + create_frame $FUNCTION 1920 1080 mjpeg m mkdir functions/$FUNCTION/streaming/header/h cd functions/$FUNCTION/streaming/header/h ln -s ../../uncompressed/u + ln -s ../../mjpeg/m cd ../../class/fs ln -s ../../header/h cd ../../class/hs @@ -156,6 +160,8 @@ delete_uvc() { rm functions/$FUNCTION/streaming/header/h/u rmdir functions/$FUNCTION/streaming/uncompressed/u/*/ rmdir functions/$FUNCTION/streaming/uncompressed/u + rm -rf functions/$FUNCTION/streaming/mjpeg/m/*/ + rm -rf functions/$FUNCTION/streaming/mjpeg/m rmdir functions/$FUNCTION/streaming/header/h rmdir functions/$FUNCTION/control/header/h rmdir functions/$FUNCTION -- cgit v1.2.3