diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.c index 792e2c5c8a..f14c8b675a 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.c @@ -80,6 +80,17 @@ gst_buffer_pool_config_get_va_allocation_params (GstStructure * config, return TRUE; } +static inline gboolean +gst_buffer_pool_config_get_va_alignment (GstStructure * config, + GstVideoAlignment * align) +{ + return gst_structure_get (config, + "va-padding-top", G_TYPE_UINT, &align->padding_top, + "va-padding-bottom", G_TYPE_UINT, &align->padding_bottom, + "va-padding-left", G_TYPE_UINT, &align->padding_left, + "va-padding-right", G_TYPE_UINT, &align->padding_right, NULL); +} + static gboolean gst_va_pool_set_config (GstBufferPool * pool, GstStructure * config) { @@ -354,6 +365,17 @@ gst_buffer_pool_config_set_va_allocation_params (GstStructure * config, "use-derived", GST_TYPE_VA_FEATURE, use_derived, NULL); } +void +gst_buffer_pool_config_set_va_alignment (GstStructure * config, + const GstVideoAlignment * align) +{ + gst_structure_set (config, + "va-padding-top", G_TYPE_UINT, align->padding_top, + "va-padding-bottom", G_TYPE_UINT, align->padding_bottom, + "va-padding-left", G_TYPE_UINT, align->padding_left, + "va-padding-right", G_TYPE_UINT, align->padding_right, NULL); +} + gboolean gst_va_pool_requires_video_meta (GstBufferPool * pool) { diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.h b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.h index 15313439f4..e204f46287 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvapool.h @@ -21,6 +21,7 @@ #pragma once #include +#include #include G_BEGIN_DECLS @@ -43,6 +44,9 @@ void gst_buffer_pool_config_set_va_allocation_params (GstStructu guint usage_hint, GstVaFeature use_derived); GST_VA_API +void gst_buffer_pool_config_set_va_alignment (GstStructure * config, + const GstVideoAlignment * align); +GST_VA_API GstBufferPool * gst_va_pool_new_with_config (GstCaps * caps, guint size, guint min_buffers,