mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
va: pool: Add set_va_alignment() API.
We want to use gst_buffer_pool_config_set_va_alignment() to replace gst_buffer_pool_config_get_video_alignment(). The later one is specific for GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT option. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2301>
This commit is contained in:
parent
74918ab9ea
commit
f35bd6c8bb
2 changed files with 26 additions and 0 deletions
|
@ -68,6 +68,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)
|
||||
{
|
||||
|
@ -338,6 +349,17 @@ gst_buffer_pool_config_set_va_allocation_params (GstStructure * config,
|
|||
gst_structure_set (config, "usage-hint", G_TYPE_UINT, usage_hint, 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)
|
||||
{
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -32,6 +33,9 @@ gboolean gst_va_pool_requires_video_meta (GstBufferPool * pool)
|
|||
void gst_buffer_pool_config_set_va_allocation_params (GstStructure * config,
|
||||
guint usage_hint);
|
||||
|
||||
void gst_buffer_pool_config_set_va_alignment (GstStructure * config,
|
||||
const GstVideoAlignment * align);
|
||||
|
||||
GstBufferPool * gst_va_pool_new_with_config (GstCaps * caps,
|
||||
guint size,
|
||||
guint min_buffers,
|
||||
|
|
Loading…
Reference in a new issue