Re: [RFC PATCH 1/1] media: uvcvideo: Add no drop parameter for MJPEG_NO_EOF quirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 17, 2024 at 11:21:38AM +0000, Isaac Scott wrote:
> In use cases where a camera needs to use the UVC_QUIRK_MJPEG_NO_EOF,
> erroneous frames that do not conform to MJPEG standards are correctly
> being marked as erroneous. However, when using the camera in a product,
> manufacturers usually want to enable the quirk in order to pass the
> buffers into user space. To do this, they have to enable the uvc_no_drop
> parameter. To avoid the extra steps to configure the kernel in such a
> way, enable the no_drop parameter by default to comply with this use
> case.
> 
> Signed-off-by: Isaac Scott <isaac.scott@xxxxxxxxxxxxxxxx>
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 947c4bf6bfeb..45028b45906a 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -1948,6 +1948,13 @@ int uvc_register_video_device(struct uvc_device *dev,
>  {
>  	int ret;
>  
> +	/*
> +	 * If the MJPEG stream occasionally loses the EOF marker, we set the
> +	 * no_drop parameter by default to avoid dropping frames erroneously.
> +	 */
> +	if (dev->quirks & UVC_QUIRK_MJPEG_NO_EOF)
> +		uvc_no_drop_param = 1;

One issue with this is that it becomes impossible for someone to unset
the no_drop parameter.

This being said, I think we should have enabled no_drop by default. I
wonder if that's a change we could do.

> +
>  	/* Initialize the video buffers queue. */
>  	ret = uvc_queue_init(queue, type, !uvc_no_drop_param);
>  	if (ret)

-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux