From 0cad2abbbe77d54851f87b7b3129d02770e6e983 Mon Sep 17 00:00:00 2001 From: Kurt Kartaltepe Date: Sat, 26 Sep 2020 13:18:06 -0700 Subject: [PATCH] v4l2-linux: Fix nv12 linesize unlike other YUV based formats nv12 chroma plane has the same padding as the luma plane. ref: https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/pixfmt-nv12.html --- plugins/linux-v4l2/v4l2-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/linux-v4l2/v4l2-input.c b/plugins/linux-v4l2/v4l2-input.c index fe98a8bf8..cca0cae3f 100644 --- a/plugins/linux-v4l2/v4l2-input.c +++ b/plugins/linux-v4l2/v4l2-input.c @@ -123,7 +123,7 @@ static void v4l2_prep_obs_frame(struct v4l2_data *data, switch (data->pixfmt) { case V4L2_PIX_FMT_NV12: frame->linesize[0] = data->linesize; - frame->linesize[1] = data->linesize / 2; + frame->linesize[1] = data->linesize; plane_offsets[1] = data->linesize * data->height; break; case V4L2_PIX_FMT_YVU420: