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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1326>
This commit is contained in:
Haihua Hu 2021-11-09 13:36:28 +08:00 committed by GStreamer Marge Bot
parent 214691b972
commit a66124a79c

View file

@ -463,11 +463,15 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
}
/* add metadata to raw video buffers */
if (pool->add_videometa)
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;