v4l2: Add NV12_8L128 and NV12_10BE_8L128

These formats are used by i.MX 8QXP/8QM VPU.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1379>
This commit is contained in:
Ming Qian 2021-10-19 14:41:04 +08:00 committed by Nicolas Dufresne
parent 094d121812
commit 2861bd9456
2 changed files with 16 additions and 0 deletions

View file

@ -626,6 +626,8 @@ struct v4l2_pix_format {
/* Tiled YUV formats, non contiguous planes */ /* Tiled YUV formats, non contiguous planes */
#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */ #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */
#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */
#define V4L2_PIX_FMT_NV12M_8L128 v4l2_fourcc('N', 'A', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */
#define V4L2_PIX_FMT_NV12M_10BE_8L128 v4l2_fourcc_be('N', 'T', '1', '2') /* Y/CbCr 4:2:0 10-bit 8x128 tiles */
/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */

View file

@ -152,6 +152,8 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = {
{V4L2_PIX_FMT_NV12M, TRUE, GST_V4L2_RAW}, {V4L2_PIX_FMT_NV12M, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12MT, TRUE, GST_V4L2_RAW}, {V4L2_PIX_FMT_NV12MT, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12MT_16X16, TRUE, GST_V4L2_RAW}, {V4L2_PIX_FMT_NV12MT_16X16, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12M_8L128, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12M_10BE_8L128, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV21, TRUE, GST_V4L2_RAW}, {V4L2_PIX_FMT_NV21, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV21M, TRUE, GST_V4L2_RAW}, {V4L2_PIX_FMT_NV21M, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV16, TRUE, GST_V4L2_RAW}, {V4L2_PIX_FMT_NV16, TRUE, GST_V4L2_RAW},
@ -1066,6 +1068,8 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_NV61M: /* Same as NV61 */ case V4L2_PIX_FMT_NV61M: /* Same as NV61 */
case V4L2_PIX_FMT_NV24: /* 24 Y/CrCb 4:4:4 */ case V4L2_PIX_FMT_NV24: /* 24 Y/CrCb 4:4:4 */
case V4L2_PIX_FMT_MM21: /* NV12 Y 16x32, UV 16x16 tile */ case V4L2_PIX_FMT_MM21: /* NV12 Y 16x32, UV 16x16 tile */
case V4L2_PIX_FMT_NV12M_8L128:
case V4L2_PIX_FMT_NV12M_10BE_8L128:
rank = YUV_ODD_BASE_RANK; rank = YUV_ODD_BASE_RANK;
break; break;
@ -1344,6 +1348,11 @@ gst_v4l2_object_v4l2fourcc_to_video_format (guint32 fourcc)
break; break;
case V4L2_PIX_FMT_MM21: case V4L2_PIX_FMT_MM21:
format = GST_VIDEO_FORMAT_NV12_16L32S; format = GST_VIDEO_FORMAT_NV12_16L32S;
case V4L2_PIX_FMT_NV12M_8L128:
format = GST_VIDEO_FORMAT_NV12_8L128;
break;
case V4L2_PIX_FMT_NV12M_10BE_8L128:
format = GST_VIDEO_FORMAT_NV12_10BE_8L128;
break; break;
case V4L2_PIX_FMT_NV21: case V4L2_PIX_FMT_NV21:
case V4L2_PIX_FMT_NV21M: case V4L2_PIX_FMT_NV21M:
@ -1514,6 +1523,8 @@ gst_v4l2_object_v4l2fourcc_to_bare_struct (guint32 fourcc)
case V4L2_PIX_FMT_NV12M: case V4L2_PIX_FMT_NV12M:
case V4L2_PIX_FMT_NV12MT: case V4L2_PIX_FMT_NV12MT:
case V4L2_PIX_FMT_MM21: case V4L2_PIX_FMT_MM21:
case V4L2_PIX_FMT_NV12M_8L128:
case V4L2_PIX_FMT_NV12M_10BE_8L128:
case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */ case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */
case V4L2_PIX_FMT_NV21M: case V4L2_PIX_FMT_NV21M:
case V4L2_PIX_FMT_NV16: /* 16 Y/CbCr 4:2:2 */ case V4L2_PIX_FMT_NV16: /* 16 Y/CbCr 4:2:2 */
@ -1797,6 +1808,9 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
case GST_VIDEO_FORMAT_NV12_16L32S: case GST_VIDEO_FORMAT_NV12_16L32S:
fourcc_nc = V4L2_PIX_FMT_MM21; fourcc_nc = V4L2_PIX_FMT_MM21;
break; break;
case GST_VIDEO_FORMAT_NV12_10BE_8L128:
fourcc_nc = V4L2_PIX_FMT_NV12M_10BE_8L128;
break;
case GST_VIDEO_FORMAT_NV21: case GST_VIDEO_FORMAT_NV21:
fourcc = V4L2_PIX_FMT_NV21; fourcc = V4L2_PIX_FMT_NV21;
fourcc_nc = V4L2_PIX_FMT_NV21M; fourcc_nc = V4L2_PIX_FMT_NV21M;