From b09b13dbf6921a5474b847ba940f0c38e3e37c71 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Sat, 4 May 2019 16:22:55 -0400 Subject: qcam: format_converter: Add formatFamily enum It is not sustainable to add a new flag for every new video format family (eg. YUYV, RGB, NV, MJPEG, etc), so add a formatFamily enum to indicate these in the FormatConverter. Note that formats are grouped into families based on if they are able to share a set of parameters for conversion. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/qcam/format_converter.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/qcam/format_converter.h') diff --git a/src/qcam/format_converter.h b/src/qcam/format_converter.h index 76cd9f1c..bca44aa3 100644 --- a/src/qcam/format_converter.h +++ b/src/qcam/format_converter.h @@ -20,6 +20,12 @@ public: void convert(const unsigned char *src, size_t size, QImage *dst); private: + enum FormatFamily { + MJPEG, + RGB, + YUV, + }; + void convertRGB(const unsigned char *src, unsigned char *dst); void convertYUV(const unsigned char *src, unsigned char *dst); @@ -27,12 +33,15 @@ private: unsigned int width_; unsigned int height_; + enum FormatFamily formatFamily_; + + /* RGB parameters */ unsigned int bpp_; unsigned int r_pos_; unsigned int g_pos_; unsigned int b_pos_; - bool yuv_; + /* YUV parameters */ unsigned int y_pos_; unsigned int cb_pos_; }; -- cgit v1.2.1