This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 4487be00551c1a4ff7f4d8f94a85dfcba75f7e08
Author: fangyibo <[email protected]>
AuthorDate: Tue Oct 27 17:10:52 2026 +0800

    examples/uvc_cam: stop setting buf_type of frmsizeenum and frmivalenum
    
    struct v4l2_frmsizeenum and struct v4l2_frmivalenum carry a buf_type
    field that Linux does not have, and the V4L2 capture driver never reads
    it. Stop setting it, so that the example keeps building once these
    structs are aligned with the Linux UAPI.
    
    While here, fix the two nxstyle errors in the file (missing blank line
    after declarations).
    
    No functional change.
    
    Assisted-by: Kiro:claude-opus-5-5
    Signed-off-by: fangyibo <[email protected]>
---
 examples/uvc_cam/uvc_cam_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/uvc_cam/uvc_cam_main.c b/examples/uvc_cam/uvc_cam_main.c
index a47d97e84..4790754ec 100644
--- a/examples/uvc_cam/uvc_cam_main.c
+++ b/examples/uvc_cam/uvc_cam_main.c
@@ -125,7 +125,6 @@ static int camera_init(int fd, FAR uint32_t *pixfmt, FAR 
uint16_t *width,
 
   memset(&frmsize, 0, sizeof(frmsize));
   frmsize.index        = 0;
-  frmsize.buf_type     = V4L2_BUF_TYPE_VIDEO_CAPTURE;
   frmsize.pixel_format = fmtdesc.pixelformat;
 
   ret = ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frmsize);
@@ -181,7 +180,6 @@ static int camera_init(int fd, FAR uint32_t *pixfmt, FAR 
uint16_t *width,
 
   memset(&frmival, 0, sizeof(frmival));
   frmival.index        = 0;
-  frmival.buf_type     = V4L2_BUF_TYPE_VIDEO_CAPTURE;
   frmival.pixel_format = fmtdesc.pixelformat;
   frmival.width        = frmsize.discrete.width;
   frmival.height       = frmsize.discrete.height;
@@ -235,6 +233,7 @@ static int camera_capture_frame(int camfd, FAR uint8_t 
*buf, size_t buflen,
   if (do_streamon)
     {
       enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
       ret = ioctl(camfd, VIDIOC_STREAMON, &type);
       if (ret < 0)
         {
@@ -391,6 +390,7 @@ int main(int argc, FAR char *argv[])
   /* Wait for USB host to enumerate and start streaming */
 
   struct pollfd pfd;
+
   pfd.fd     = uvcfd;
   pfd.events = POLLOUT;
 

Reply via email to