History

media: v4l2-ctrl: Make display delay and display enable std controls

Make display delay and display delay enable MFC controls standard v4l controls. This will allow reuse of the controls for other decoder drivers. Also the new proposed controls are now codec agnostic because they could be used for any codec.

Stanimir Varbanov committed 6 years ago

Commit 9f3d1051 parent 86ee6723 files · +22 −0Browse files

Unified · Split

3 files
  1. Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +15 −0
  2. drivers/media/v4l2-core/v4l2-ctrls.c +4 −0
  3. include/uapi/linux/v4l2-controls.h +3 −0
Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst+15−0
@@ -679,6 +679,21 @@ enum v4l2_mpeg_video_frame_skip_mode - · 678 unmodified lines
679679 otherwise the decoder expects a single frame in per buffer.
680680 Applicable to the decoder, all codecs.
681681
682+``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (boolean)``
683+ If the display delay is enabled then the decoder is forced to return
684+ a CAPTURE buffer (decoded frame) after processing a certain number
685+ of OUTPUT buffers. The delay can be set through
686+ ``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY``. This
687+ feature can be used for example for generating thumbnails of videos.
688+ Applicable to the decoder.
689+
690+``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (integer)``
691+ Display delay value for decoder. The decoder is forced to
692+ return a decoded frame after the set 'display delay' number of
693+ frames. If this number is low it may result in frames returned out
694+ of display order, in addition the hardware may still be using the
695+ returned buffer as a reference picture for subsequent frames.
696+
682697 ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)``
683698 Enable writing sample aspect ratio in the Video Usability
684699 Information. Applicable to the H264 encoder.
drivers/media/v4l2-core/v4l2-ctrls.c+4−0
@@ -874,6 +874,8 @@ const char *v4l2_ctrl_get_name(u32 id) · 873 unmodified lines
874874 case V4L2_CID_MPEG_VIDEO_HEADER_MODE: return "Sequence Header Mode";
875875 case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC: return "Max Number of Reference Pics";
876876 case V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE: return "Frame Skip Mode";
877+ case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY: return "Display Delay";
878+ case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE: return "Display Delay Enable";
877879 case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP: return "H263 I-Frame QP Value";
878880 case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP: return "H263 P-Frame QP Value";
879881 case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP: return "H263 B-Frame QP Value";
@@ -1241,6 +1243,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, · 361 unmodified lines
12411243 case V4L2_CID_FLASH_READY:
12421244 case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER:
12431245 case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE:
1246+ case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE:
12441247 case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE:
12451248 case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE:
12461249 case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM:
@@ -1276,6 +1279,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, · 29 unmodified lines
12761279 break;
12771280 case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE:
12781281 case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE:
1282+ case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY:
12791283 *type = V4L2_CTRL_TYPE_INTEGER;
12801284 break;
12811285 case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME:
include/uapi/linux/v4l2-controls.h+3−0
@@ -797,6 +797,9 @@ enum v4l2_mpeg_video_frame_skip_mode { · 796 unmodified lines
797797 #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MIN_QP (V4L2_CID_CODEC_BASE + 651)
798798 #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP (V4L2_CID_CODEC_BASE + 652)
799799
800+#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653)
801+#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654)
802+
800803 /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
801804 #define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000)
802805 #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0)