History

media: v4l: Add new Colorimetry Class

Add Colorimetry control class for colorimetry controls

Stanimir Varbanov committed 5 years ago

Commit f31b9ff1 parent 4ef60392 files · +10 −1Browse files

Unified · Split

2 files
  1. drivers/media/v4l2-core/v4l2-ctrls.c +6 −1
  2. include/uapi/linux/v4l2-controls.h +4 −0
drivers/media/v4l2-core/v4l2-ctrls.c+6−1
@@ -1215,6 +1215,10 @@ const char *v4l2_ctrl_get_name(u32 id) · 1214 unmodified lines
12151215 case V4L2_CID_STATELESS_H264_DECODE_PARAMS: return "H264 Decode Parameters";
12161216 case V4L2_CID_STATELESS_FWHT_PARAMS: return "FWHT Stateless Parameters";
12171217 case V4L2_CID_STATELESS_VP8_FRAME: return "VP8 Frame Parameters";
1218+
1219+ /* Colorimetry controls */
1220+ /* Keep the order of the 'case's the same as in v4l2-controls.h! */
1221+ case V4L2_CID_COLORIMETRY_CLASS: return "Colorimetry Controls";
12181222 default:
12191223 return NULL;
12201224 }
@@ -1418,8 +1422,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, · 197 unmodified lines
14181422 case V4L2_CID_RF_TUNER_CLASS:
14191423 case V4L2_CID_DETECT_CLASS:
14201424 case V4L2_CID_CODEC_STATELESS_CLASS:
1425+ case V4L2_CID_COLORIMETRY_CLASS:
14211426 *type = V4L2_CTRL_TYPE_CTRL_CLASS;
1422− /* You can neither read not write these */
1427+ /* You can neither read nor write these */
14231428 *flags |= V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY;
14241429 *min = *max = *step = *def = 0;
14251430 break;
include/uapi/linux/v4l2-controls.h+4−0
@@ -66,6 +66,7 @@ · 65 unmodified lines
6666 #define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */
6767 #define V4L2_CTRL_CLASS_DETECT 0x00a30000 /* Detection controls */
6868 #define V4L2_CTRL_CLASS_CODEC_STATELESS 0x00a40000 /* Stateless codecs controls */
69+#define V4L2_CTRL_CLASS_COLORIMETRY 0x00a50000 /* Colorimetry controls */
6970
7071 /* User-class control IDs */
7172
@@ -1861,6 +1862,9 @@ struct v4l2_ctrl_vp8_frame { · 1789 unmodified lines
18611862 __u64 flags;
18621863 };
18631864
1865+#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
1866+#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
1867+
18641868 /* MPEG-compression definitions kept for backwards compatibility */
18651869 #ifndef __KERNEL__
18661870 #define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC