History

[media] videodev2.h Add HSV encoding

Some hardware maps the Hue between 0 and 255 instead of 0-179. Support this format with a new field hsv_enc.

Ricardo Ribalda Delgado committed 10 years ago

Commit 8a0d62a1 parent f1eb9261 file · +27 −5Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/videodev2.h+27−5
@@ -334,6 +334,19 @@ enum v4l2_ycbcr_encoding { · 333 unmodified lines
334334 V4L2_YCBCR_ENC_SMPTE240M = 8,
335335 };
336336
337+/*
338+ * enum v4l2_hsv_encoding values should not collide with the ones from
339+ * enum v4l2_ycbcr_encoding.
340+ */
341+enum v4l2_hsv_encoding {
342+
343+ /* Hue mapped to 0 - 179 */
344+ V4L2_HSV_ENC_180 = 128,
345+
346+ /* Hue mapped to 0-255 */
347+ V4L2_HSV_ENC_256 = 129,
348+};
349+
337350 /*
338351 * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding.
339352 * This depends on the colorspace.
@@ -362,9 +375,10 @@ enum v4l2_quantization { · 22 unmodified lines
362375 * This depends on whether the image is RGB or not, the colorspace and the
363376 * Y'CbCr encoding.
364377 */
365−#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \
366− (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \
367− (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
378+#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv, colsp, ycbcr_enc) \
379+ (((is_rgb_or_hsv) && (colsp) == V4L2_COLORSPACE_BT2020) ? \
380+ V4L2_QUANTIZATION_LIM_RANGE : \
381+ (((is_rgb_or_hsv) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
368382 (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) || \
369383 (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == V4L2_COLORSPACE_SRGB ? \
370384 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
@@ -462,7 +476,12 @@ struct v4l2_pix_format { · 91 unmodified lines
462476 __u32 colorspace; /* enum v4l2_colorspace */
463477 __u32 priv; /* private data, depends on pixelformat */
464478 __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */
465− __u32 ycbcr_enc; /* enum v4l2_ycbcr_encoding */
479+ union {
480+ /* enum v4l2_ycbcr_encoding */
481+ __u32 ycbcr_enc;
482+ /* enum v4l2_hsv_encoding */
483+ __u32 hsv_enc;
484+ };
466485 __u32 quantization; /* enum v4l2_quantization */
467486 __u32 xfer_func; /* enum v4l2_xfer_func */
468487 };
@@ -2012,7 +2031,10 @@ struct v4l2_pix_format_mplane { · 1543 unmodified lines
20122031 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
20132032 __u8 num_planes;
20142033 __u8 flags;
2015− __u8 ycbcr_enc;
2034+ union {
2035+ __u8 ycbcr_enc;
2036+ __u8 hsv_enc;
2037+ };
20162038 __u8 quantization;
20172039 __u8 xfer_func;
20182040 __u8 reserved[7];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t