History

media: v4l2-ctrl: Add decoder conceal color control

Add decoder v4l2 control to set conceal color.

Stanimir Varbanov committed 5 years ago

Commit b52051a1 parent 15447d13 files · +43 −0Browse files

Unified · Split

3 files
  1. Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +33 −0
  2. drivers/media/v4l2-core/v4l2-ctrls.c +9 −0
  3. include/uapi/linux/v4l2-controls.h +1 −0
Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst+33−0
@@ -674,6 +674,39 @@ enum v4l2_mpeg_video_frame_skip_mode - · 673 unmodified lines
674674 is currently displayed (decoded). This value is reset to 0 whenever
675675 the decoder is started.
676676
677+``V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (integer64)``
678+ This control sets the conceal color in YUV color space. It describes
679+ the client preference of the error conceal color in case of an error
680+ where the reference frame is missing. The decoder should fill the
681+ reference buffer with the preferred color and use it for future
682+ decoding. The control is using 16 bits per channel.
683+ Applicable to decoders.
684+
685+.. flat-table::
686+ :header-rows: 0
687+ :stub-columns: 0
688+
689+ * -
690+ - 8bit format
691+ - 10bit format
692+ - 12bit format
693+ * - Y luminance
694+ - Bit 0:7
695+ - Bit 0:9
696+ - Bit 0:11
697+ * - Cb chrominance
698+ - Bit 16:23
699+ - Bit 16:25
700+ - Bit 16:27
701+ * - Cr chrominance
702+ - Bit 32:39
703+ - Bit 32:41
704+ - Bit 32:43
705+ * - Must be zero
706+ - Bit 48:63
707+ - Bit 48:63
708+ - Bit 48:63
709+
677710 ``V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (boolean)``
678711 If enabled the decoder expects to receive a single slice per buffer,
679712 otherwise the decoder expects a single frame in per buffer.
drivers/media/v4l2-core/v4l2-ctrls.c+9−0
@@ -955,6 +955,7 @@ const char *v4l2_ctrl_get_name(u32 id) · 954 unmodified lines
955955 case V4L2_CID_MPEG_VIDEO_VBV_SIZE: return "VBV Buffer Size";
956956 case V4L2_CID_MPEG_VIDEO_DEC_PTS: return "Video Decoder PTS";
957957 case V4L2_CID_MPEG_VIDEO_DEC_FRAME: return "Video Decoder Frame Count";
958+ case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: return "Video Decoder Conceal Color";
958959 case V4L2_CID_MPEG_VIDEO_VBV_DELAY: return "Initial Delay for VBV Control";
959960 case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: return "Horizontal MV Search Range";
960961 case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: return "Vertical MV Search Range";
@@ -1458,6 +1459,14 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, · 497 unmodified lines
14581459 *max = 0x7fffffffffffffffLL;
14591460 *step = 1;
14601461 break;
1462+ case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR:
1463+ *type = V4L2_CTRL_TYPE_INTEGER64;
1464+ *min = 0;
1465+ /* default for 8 bit black, luma is 16, chroma is 128 */
1466+ *def = 0x8000800010LL;
1467+ *max = 0xffffffffffffLL;
1468+ *step = 1;
1469+ break;
14611470 case V4L2_CID_PIXEL_RATE:
14621471 *type = V4L2_CTRL_TYPE_INTEGER64;
14631472 *flags |= V4L2_CTRL_FLAG_READ_ONLY;
include/uapi/linux/v4l2-controls.h+1−0
@@ -432,6 +432,7 @@ enum v4l2_mpeg_video_multi_slice_mode { · 431 unmodified lines
432432 #define V4L2_CID_MPEG_VIDEO_LTR_COUNT (V4L2_CID_CODEC_BASE+232)
433433 #define V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX (V4L2_CID_CODEC_BASE+233)
434434 #define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (V4L2_CID_CODEC_BASE+234)
435+#define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+235)
435436
436437 /* CIDs for the MPEG-2 Part 2 (H.262) codec */
437438 #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)