mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-17 21:06:17 +00:00
video4linux2: Add MM21 support
This enables mtk-vcodec and MDP driver from mainline Linux kernel. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>
This commit is contained in:
parent
bab9041c4b
commit
ec9585d148
1 changed files with 14 additions and 1 deletions
|
@ -160,6 +160,7 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = {
|
|||
{V4L2_PIX_FMT_NV61M, TRUE, GST_V4L2_RAW},
|
||||
{V4L2_PIX_FMT_NV24, TRUE, GST_V4L2_RAW},
|
||||
{V4L2_PIX_FMT_NV42, TRUE, GST_V4L2_RAW},
|
||||
{V4L2_PIX_FMT_MM21, TRUE, GST_V4L2_RAW},
|
||||
|
||||
/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
|
||||
{V4L2_PIX_FMT_SBGGR8, TRUE, GST_V4L2_RAW},
|
||||
|
@ -1067,6 +1068,7 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
|
|||
case V4L2_PIX_FMT_NV61: /* 16 Y/CrCb 4:2:2 */
|
||||
case V4L2_PIX_FMT_NV61M: /* Same as NV61 */
|
||||
case V4L2_PIX_FMT_NV24: /* 24 Y/CrCb 4:4:4 */
|
||||
case V4L2_PIX_FMT_MM21: /* NV12 Y 16x32, UV 16x16 tile */
|
||||
rank = YUV_ODD_BASE_RANK;
|
||||
break;
|
||||
|
||||
|
@ -1343,6 +1345,9 @@ gst_v4l2_object_v4l2fourcc_to_video_format (guint32 fourcc)
|
|||
case V4L2_PIX_FMT_NV12MT:
|
||||
format = GST_VIDEO_FORMAT_NV12_64Z32;
|
||||
break;
|
||||
case V4L2_PIX_FMT_MM21:
|
||||
format = GST_VIDEO_FORMAT_NV12_16L32S;
|
||||
break;
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_NV21M:
|
||||
format = GST_VIDEO_FORMAT_NV21;
|
||||
|
@ -1511,6 +1516,7 @@ gst_v4l2_object_v4l2fourcc_to_bare_struct (guint32 fourcc)
|
|||
case V4L2_PIX_FMT_NV12: /* 12 Y/CbCr 4:2:0 */
|
||||
case V4L2_PIX_FMT_NV12M:
|
||||
case V4L2_PIX_FMT_NV12MT:
|
||||
case V4L2_PIX_FMT_MM21:
|
||||
case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */
|
||||
case V4L2_PIX_FMT_NV21M:
|
||||
case V4L2_PIX_FMT_NV16: /* 16 Y/CbCr 4:2:2 */
|
||||
|
@ -1791,6 +1797,9 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
|
|||
case GST_VIDEO_FORMAT_NV12_64Z32:
|
||||
fourcc_nc = V4L2_PIX_FMT_NV12MT;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_NV12_16L32S:
|
||||
fourcc_nc = V4L2_PIX_FMT_MM21;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_NV21:
|
||||
fourcc = V4L2_PIX_FMT_NV21;
|
||||
fourcc_nc = V4L2_PIX_FMT_NV21M;
|
||||
|
@ -3172,9 +3181,13 @@ gst_v4l2_object_set_stride (GstVideoInfo * info, GstVideoAlignment * align,
|
|||
if (GST_VIDEO_FORMAT_INFO_IS_TILED (finfo)) {
|
||||
gint x_tiles, y_tiles, ws, hs, tile_height, padded_height;
|
||||
|
||||
|
||||
ws = GST_VIDEO_FORMAT_INFO_TILE_WS (finfo);
|
||||
hs = GST_VIDEO_FORMAT_INFO_TILE_HS (finfo);
|
||||
|
||||
/* this only works for what we support, NV12 subsampled tiles */
|
||||
if (GST_VIDEO_FORMAT_INFO_HAS_SUBTILES (finfo) && plane == 1)
|
||||
hs -= 1;
|
||||
|
||||
tile_height = 1 << hs;
|
||||
|
||||
padded_height = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, plane,
|
||||
|
|
Loading…
Reference in a new issue