Skip to content

Commit

Permalink
Add UVC camera function profile
Browse files Browse the repository at this point in the history
  • Loading branch information
tejado committed Jun 3, 2021
1 parent db0ead5 commit 7f3cdfc
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Following USB gadgets are integrated:
* Keyboard & Mouse (/dev/hidg0, /dev/hidg1)
* FIDO CTAP (/dev/hidg0; for WebAuthn)
* CCID (/dev/ccid_ctrl, /dev/ccid_bulk)
* UVC camera (/dev/video?)

USB Gadget Tool requires root permissions and a Kernel with ConfigFS support.
Currently the app only enables the USB Gadget. For the usage of these device endpoints (e.g. /dev/hidg0) further apps are required (see Use-Cases).
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/usbFunctionProfiles/CCID
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

GADGET="keyboard"
GADGET="ccid"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/usbFunctionProfiles/CTAP
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

GADGET="keyboard"
GADGET="ctap"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/usbFunctionProfiles/Mouse
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

GADGET="keyboard"
GADGET="mouse"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
33 changes: 33 additions & 0 deletions app/src/main/assets/usbFunctionProfiles/UVC
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

GADGET="camera"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/`ls -1 | head -1`/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"
FUNCTION_PATH="$GADGET_PATH/functions/uvc.usb0"

mkdir -p $FUNCTION_PATH/control/header/h
cd $FUNCTION_PATH

ln -s control/header/h control/class/fs

mkdir -p $FUNCTION_PATH/streaming/mjpeg/m/720p
cd $FUNCTION_PATH/streaming/mjpeg/m/720p
echo 5000000 > dwFrameInterval
echo 1280 > wWidth
echo 720 > wHeight
echo 29491200 > dwMinBitRate
echo 29491200 > dwMaxBitRate
echo 1843200 > dwMaxVideoFrameBufferSize

mkdir -p $FUNCTION_PATH/streaming/header/h
cd $FUNCTION_PATH/streaming/header/h
ln -s ../../mjpeg/m
cd ../../class/fs
ln -s ../../header/h
cd ../../class/hs
ln -s ../../header/h

ln -s $FUNCTION_PATH $CONFIG_PATH/uvc.usb0
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ Following USB gadgets are integrated:
* Keyboard & Mouse (<code>/dev/hidg0</code>, <code>/dev/hidg1</code>)
* FIDO CTAP (<code>/dev/hidg0</code>; for WebAuthn)
* CCID (<code>/dev/ccid_ctrl</code>, <code>/dev/ccid_bulk</code>)
* UVC camera (<code>/dev/video?</code>)

<i>USB Gadget Tool</i> requires root permissions and a Kernel with ConfigFS support. Currently the app only enables the USB Gadget. For the usage of these device endpoints (e.g. <code>/dev/hidg0</code>) further apps are required.

0 comments on commit 7f3cdfc

Please sign in to comment.