瀏覽代碼

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
Kurt Kartaltepe 5 年之前
父節點
當前提交
0cad2abbbe
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/linux-v4l2/v4l2-input.c

+ 1 - 1
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: