From a66124a79c4b0d4a5c6c3d2e253aa19c1028fa07 Mon Sep 17 00:00:00 2001 From: Haihua Hu Date: Tue, 9 Nov 2021 13:36:28 +0800 Subject: [PATCH] v4l2bufferpool: set video alignment of video meta need apply video alignment info on video meta, downstream element can get buffer alignment from video meta Part-of: --- subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c index 7b5050a..45c672d 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c @@ -463,11 +463,15 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer, } /* add metadata to raw video buffers */ - if (pool->add_videometa) - gst_buffer_add_video_meta_full (newbuf, GST_VIDEO_FRAME_FLAG_NONE, + if (pool->add_videometa) { + GstVideoMeta *videometa = + gst_buffer_add_video_meta_full (newbuf, GST_VIDEO_FRAME_FLAG_NONE, GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info), info->offset, info->stride); + if (videometa) + gst_video_meta_set_alignment (videometa, obj->align); + } *buffer = newbuf; -- 2.7.4