forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usb: gadget: uvc: add framebased stream support
Currently the uvc gadget can't support H264/HEVC transport, After adding framebased stream support, the driver can support them. Framebased stream is a little different from uncompressed stream. So we can support framebased stream on the basis of uncompressed stream. Here are the differences: 1. For the format, framebased format has a extra member ( __u8 bVariableSize) than uncompressed format. 2. For the frame, the layout of last three members of framebased frame is different from uncompressed frame. a. Last three members of uncompressed frame are: u32 dw_max_video_frame_buffer_size; u32 dw_default_frame_interval; u8 b_frame_interval_type; b. Last three members of framebased frame are: u32 dw_default_frame_interval; u8 b_frame_interval_type; u32 dw_bytes_perline; Here is an example of configuring H264: cd /sys/kernel/config/usb_gadget/g1 ndir=functions/uvc.usb0/streaming/uncompressed/$NAME mkdir -p $ndir echo -n "H264" > $ndir/guidFormat # H264 or HEVC echo 0 > $ndir/bBitsPerPixel echo 1 > $ndir/bVariableSize wdir=functions/uvc.usb0/streaming/uncompressed/$NAME/${HEIGHT}p mkdir -p $wdir echo 0 > $wdir/dwBytesPerLine echo $WIDTH > $wdir/wWidth echo $HEIGHT > $wdir/wHeight echo 29491200 > $wdir/dwMinBitRate echo 29491200 > $wdir/dwMaxBitRate cat <<EOF > $wdir/dwFrameInterval $INTERVAL EOF Signed-off-by: Jing Leng <jleng@ambarella.com>
- Loading branch information
1 parent
9902951
commit 475fba6
Showing
4 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters