diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2019-05-01 16:37:19 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-05-02 12:09:24 +0300 |
commit | 105134f9a7a3faad9f02a6a5516a8cd8e625fb04 (patch) | |
tree | 20aa7c0e4fe88aef58e178a508bc13fb4fc14c80 | |
parent | 1796f8bf24d05544d59ced01c96ae00da13afd7f (diff) |
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 <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-x | scripts/uvc-gadget.sh | 16 |
1 files changed, 11 insertions, 5 deletions
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 <function name> <width> <height> + # create_frame <function name> <width> <height> <format> <name> 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 |