diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-08-11 13:35:29 +0200 |
---|---|---|
committer | Hans Verkuil <hans.verkuil@cisco.com> | 2018-08-11 13:35:29 +0200 |
commit | 83062bda386de80f6bcf86da83ec490678b66081 (patch) | |
tree | 9d3bf0766e4f953b6fb3fd434f5bb66f647fa323 | |
parent | 07d2bad6f652798d3ec22cb138524e4816de4014 (diff) |
(c)v4l-helpers: add g_hsv_enc() support
Add g_hsv_enc() helper support: these helpers will return a
valid HSV encoding instead of returning 0 (default) which
isn't useful for HSV.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r-- | utils/common/cv4l-helpers.h | 1 | ||||
-rw-r--r-- | utils/common/v4l-helpers.h | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/utils/common/cv4l-helpers.h b/utils/common/cv4l-helpers.h index 8de6794d..8ef9d1b7 100644 --- a/utils/common/cv4l-helpers.h +++ b/utils/common/cv4l-helpers.h @@ -706,6 +706,7 @@ public: unsigned g_xfer_func() const { return v4l_format_g_xfer_func(this); } void s_xfer_func(unsigned xfer_func) { v4l_format_s_xfer_func(this, xfer_func); } unsigned g_ycbcr_enc() const { return v4l_format_g_ycbcr_enc(this); } + unsigned g_hsv_enc() const { return v4l_format_g_hsv_enc(this); } void s_ycbcr_enc(unsigned ycbcr_enc) { v4l_format_s_ycbcr_enc(this, ycbcr_enc); } unsigned g_quantization() const { return v4l_format_g_quantization(this); } void s_quantization(unsigned quantization) { v4l_format_s_quantization(this, quantization); } diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h index de186856..7c6d3204 100644 --- a/utils/common/v4l-helpers.h +++ b/utils/common/v4l-helpers.h @@ -862,6 +862,14 @@ v4l_format_g_ycbcr_enc(const struct v4l2_format *fmt) } } +static inline unsigned +v4l_format_g_hsv_enc(const struct v4l2_format *fmt) +{ + unsigned hsv_enc = v4l_format_g_ycbcr_enc(fmt); + + return hsv_enc < V4L2_HSV_ENC_180 ? V4L2_HSV_ENC_180 : hsv_enc; +} + static inline void v4l_format_s_quantization(struct v4l2_format *fmt, unsigned quantization) { |