casaroli commented on code in PR #21471:
URL: https://github.com/apache/nuttx/pull/21471#discussion_r4494422669


##########
drivers/video/v4l2_cap.c:
##########
@@ -1557,6 +1590,13 @@ static size_t get_bufsize(FAR video_format_t *vf)
     }
 }
 
+static bool is_bufsize_exact(FAR video_format_t *vf)
+{
+  return vf->sizeimage > 0 ||
+         (vf->pixelformat != V4L2_PIX_FMT_JPEG &&
+          vf->pixelformat != V4L2_PIX_FMT_ENTROPY);

Review Comment:
   `V4L2_PIX_FMT_JPEG_WITH_SUBIMG` is compressed too, but this returns true for 
it, and `get_bufsize()` gives `width * height * 2` for it (the default case; 
`sizeimage` is not used). cxd56 with ISX012/ISX019 supports it, and 
`cisif_set_intlev_sarea()` needs only the sub-image plus room for the JPEG. A 
USERPTR JPEG + sub-image buffer at FullHD now needs 4,147,200 bytes, so QBUF 
returns EINVAL where master accepts it.
   
   Fix: in `is_bufsize_exact()`, return false for 
`V4L2_PIX_FMT_JPEG_WITH_SUBIMG` as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to