MLK-22507: mxc-jpeg: Return rgb24 pixfmt from decoder when app14 is present
authorMirela Rabulea <mirela.rabulea@nxp.com>
Mon, 26 Aug 2019 15:51:20 +0000 (18:51 +0300)
committerMirela Rabulea <mirela.rabulea@nxp.com>
Fri, 30 Aug 2019 15:20:28 +0000 (18:20 +0300)
commit6bf880792149920c6a8982b3c30f6a043368154c
treef69a6dca6c48b521d6b191c607851c701e708e64
parent47428147b363d8ebdd2bac59345568e5257717b4
MLK-22507: mxc-jpeg: Return rgb24 pixfmt from decoder when app14 is present

When GST receives V4L2_EVENT_SOURCE_CHANGE, it calls g_fmt ioctl and
expects that the driver will report the pixel format.
So far, the driver was unable to distinguish, by looking at the jpeg
SOF marker, if an image is YUV444 or RGB24, both have 3 color components
and no subsampling.
Consider the colorspace is RGB if the transform flag from APP14 marker
segment has the value 0, in mxc_jpeg_parse, if needed, update the pixel
format from yuv444 to rgb24.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
drivers/media/platform/imx8/mxc-jpeg.c
drivers/media/platform/imx8/mxc-jpeg.h