I have a couple of questions regarding the JPEG and MJPEG support in
the V4L2 CaptureDevice:

- Why are we doing conversions in the CaptureDevice? I think we were
there with LTI-CIVIL, we saw it wasn't a good idea and reimplemented
the whole thing to separate the conversions.

- What good is the device-specific pixel format in AVFrameFormat? As
far as I'm aware of AVFrameFormat as its designer, it describes an
FFmpeg AVFrame so it only needs a FFmpeg pixel format to be aware of.

I have a couple of questions regarding the JPEG and MJPEG support in
the V4L2 CaptureDevice:

- Why are we doing conversions in the CaptureDevice? I think we were
there with LTI-CIVIL, we saw it wasn't a good idea and reimplemented
the whole thing to separate the conversions.

It is not possible to do it with FFMPEG/libswscale. There has no formats that correspond to JPEG/MJPEG (the YUVJ4XX format produce garbage or segfault). If you have another idea to do it, please share it.

- What good is the device-specific pixel format in AVFrameFormat? As
far as I'm aware of AVFrameFormat as its designer, it describes an
FFmpeg AVFrame so it only needs a FFmpeg pixel format to be aware of.

Some native formats can refer to the same FFmpeg format (DirectShow Y41P same as Y411, and in the case of MJPEG/JPEG, the two are converted to RGB24). If we have such cases in method like getV4L2PixFmt()/getDSPixFmt(), we will pick up the first format that match FFmpeg ones and we could hit an unsupported format for our webcam and thus failed to set it on the device.