v4l2codecs: Enable MediaTek MM21 (NV12_16L32S)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>
This commit is contained in:
Nicolas Dufresne 2022-01-26 13:39:40 -05:00 committed by GStreamer Marge Bot
parent 3005dbc55a
commit 8883809ef9
2 changed files with 6 additions and 1 deletions

View file

@ -36,6 +36,7 @@ static struct FormatEntry format_map[] = {
{V4L2_PIX_FMT_YUYV, 1, GST_VIDEO_FORMAT_YUY2, 8, 422}, {V4L2_PIX_FMT_YUYV, 1, GST_VIDEO_FORMAT_YUY2, 8, 422},
{V4L2_PIX_FMT_SUNXI_TILED_NV12, 1, GST_VIDEO_FORMAT_NV12_32L32, 8, 422}, {V4L2_PIX_FMT_SUNXI_TILED_NV12, 1, GST_VIDEO_FORMAT_NV12_32L32, 8, 422},
{V4L2_PIX_FMT_NV12_4L4, 1, GST_VIDEO_FORMAT_NV12_4L4, 8, 420}, {V4L2_PIX_FMT_NV12_4L4, 1, GST_VIDEO_FORMAT_NV12_4L4, 8, 420},
{V4L2_PIX_FMT_MM21, 2, GST_VIDEO_FORMAT_NV12_16L32S, 8, 420},
{0,} {0,}
}; };
@ -82,6 +83,10 @@ set_stride (GstVideoInfo * info, gint plane, gint stride)
ws = GST_VIDEO_FORMAT_INFO_TILE_WS (finfo); ws = GST_VIDEO_FORMAT_INFO_TILE_WS (finfo);
hs = GST_VIDEO_FORMAT_INFO_TILE_HS (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;
padded_height = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, plane, padded_height = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, plane,
info->height); info->height);
padded_height = GST_ROUND_UP_N (padded_height, 1 << hs); padded_height = GST_ROUND_UP_N (padded_height, 1 << hs);

View file

@ -24,7 +24,7 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include "linux/videodev2.h" #include "linux/videodev2.h"
#define GST_V4L2_DEFAULT_VIDEO_FORMATS "{ NV12, YUY2, NV12_4L4, NV12_32L32 }" #define GST_V4L2_DEFAULT_VIDEO_FORMATS "{ NV12, YUY2, NV12_4L4, NV12_32L32, NV12_16L32S }"
gboolean gst_v4l2_format_to_video_info (struct v4l2_format * fmt, gboolean gst_v4l2_format_to_video_info (struct v4l2_format * fmt,
GstVideoInfo * out_info); GstVideoInfo * out_info);