examples/uvc_cam: add UVC camera streaming app#3438
examples/uvc_cam: add UVC camera streaming app#3438JianyuWang0623 wants to merge 1 commit intoapache:masterfrom
Conversation
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # ############################################################################## |
There was a problem hiding this comment.
@JianyuWang0623 , please add the correct licence header
https://github.com/apache/nuttx-apps/blob/master/CMakeLists.txt#L4-L21
There was a problem hiding this comment.
done, thank you
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| ############################################################################ |
| # apps/examples/uvc_cam/Makefile | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # |
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * |
| @@ -0,0 +1,32 @@ | |||
| # | |||
There was a problem hiding this comment.
@JianyuWang0623 I'm not sure if apps/examples is the best place to add this app. Maybe it should be inside apps/videoutils. What do you think?
There was a problem hiding this comment.
I guess the idea is to provide example code to serve as uvc_cam.. but videoutils can be a good place too :-)
There was a problem hiding this comment.
@acassis @cederom I'd lean toward keeping it under examples/ since it's a standalone demo app (similar to examples/camera) rather than a reusable library, which is what videoutils/ typically hosts (openh264, x264). That said, I'm open to moving it if you feel videoutils/ is a better fit — happy to discuss.
There was a problem hiding this comment.
for me examples/uvc_cam is okay :-)
|
Awesome! @JianyuWang0623 could you also please add Documentation on how to use this application as part of documentation in apache/nuttx#18609 bundle? :-) |
Usage: uvc_cam [nframes] [video_dev] [uvc_dev] V4L2 capture -> write UVC gadget device. Uses boardctl to initialize/deinitialize UVC gadget. Queries sensor pixel format, resolution and frame rate via V4L2. Uses poll() to wait for USB host streaming state. Supports optional device path arguments (default /dev/video0, /dev/uvc0). Supports configurable frame count (0=infinite). Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
1861b5f to
18f177f
Compare
@cederom Will do! I’ve just added the usage documentation here: https://github.com/apache/nuttx/compare/9d2ec9642d7bf0c41699f104c06948febeac64b4..e4babac55082a02feef90ad9ed128a5c5ad84648 |
TANK U SIR! =) |
Summary
Add a UVC camera streaming example application (
examples/uvc_cam) that captures frames from a V4L2 camera sensor and streams them to a USB host via the UVC gadget driver.The application:
VIDIOC_ENUM_FMT,VIDIOC_ENUM_FRAMESIZES, andVIDIOC_ENUM_FRAMEINTERVALS— no hardcoded video parameters.boardctl(BOARDIOC_USBDEV_CONTROL).poll()withPOLLOUTto wait for the USB host to start streaming, and to detect host disconnect/reconnect.uvc_cam [nframes] [video_dev] [uvc_dev].CONFIG_EXAMPLES_UVC_CAM_NFRAMES, 0 = infinite).Depends on the nuttx UVC gadget class driver (apache/nuttx#18609).
Impact
New example application only. No impact on existing code or build.
Adds Kconfig symbol
CONFIG_EXAMPLES_UVC_CAM(depends onUSBUVC), with sub-options for program name, priority, stack size, and frame count.Testing
xtensalckfb-szpi-esp32s3:uvcmake distclean && ./tools/configure.sh lckfb-szpi-esp32s3:uvc && make -j$(nproc)— clean build, zero warnings.ffplay -f v4l2 -video_size 320x240 -i /dev/video1. Verified host disconnect/reconnect recovery.