diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-07-22 16:55:04 +0530 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-11-02 13:05:43 +0100 |
commit | f9617bf3f42d0a7f52842e50ea3767639e77e45e (patch) | |
tree | 94f5cb09508de4062942df0da840bfbf80682737 /sys | |
parent | 75680e5d34ac0d2d67d3ca1064798ece8860000d (diff) |
x(v)image: use gst_video_meta_set_alignment()
Use the new API to tell buffer consumers about alignment details.
This change is backward compatible as non ported elements can safely
ignore the alignment information and keep processing buffers as they use
to, copying if necessary.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ximage/ximagepool.c | 6 | ||||
-rw-r--r-- | sys/xvimage/xvimagepool.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/ximage/ximagepool.c b/sys/ximage/ximagepool.c index c79b2e851..3f95e8451 100644 --- a/sys/ximage/ximagepool.c +++ b/sys/ximage/ximagepool.c @@ -648,12 +648,16 @@ ximage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer, gst_buffer_append_memory (ximage, mem); if (xpool->add_metavideo) { + GstVideoMeta *meta; + GST_DEBUG_OBJECT (pool, "adding GstVideoMeta"); /* these are just the defaults for now */ - gst_buffer_add_video_meta_full (ximage, GST_VIDEO_FRAME_FLAG_NONE, + meta = gst_buffer_add_video_meta_full (ximage, 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); + + gst_video_meta_set_alignment (meta, xpool->align); } *buffer = ximage; diff --git a/sys/xvimage/xvimagepool.c b/sys/xvimage/xvimagepool.c index 116c6d1dc..8a62c8b1a 100644 --- a/sys/xvimage/xvimagepool.c +++ b/sys/xvimage/xvimagepool.c @@ -183,11 +183,15 @@ xvimage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer, gst_buffer_append_memory (xvimage, mem); if (xvpool->add_metavideo) { + GstVideoMeta *meta; + GST_DEBUG_OBJECT (pool, "adding GstVideoMeta"); - gst_buffer_add_video_meta_full (xvimage, GST_VIDEO_FRAME_FLAG_NONE, + meta = gst_buffer_add_video_meta_full (xvimage, 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); + + gst_video_meta_set_alignment (meta, xvpool->align); } *buffer = xvimage; |