mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 18:51:11 +00:00
videoscale: activate Video meta
Configure the allocator with GstMetaVideo because we can handle that using the GstVideoFrame helpers.
This commit is contained in:
parent
8fbdac9fc6
commit
97567606e2
1 changed files with 25 additions and 1 deletions
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/gstmetavideo.h>
|
||||||
|
|
||||||
#include "gstvideoscale.h"
|
#include "gstvideoscale.h"
|
||||||
#include "gstvideoscaleorc.h"
|
#include "gstvideoscaleorc.h"
|
||||||
|
@ -179,6 +179,8 @@ static gboolean gst_video_scale_set_caps (GstBaseTransform * trans,
|
||||||
GstCaps * in, GstCaps * out);
|
GstCaps * in, GstCaps * out);
|
||||||
static gboolean gst_video_scale_get_unit_size (GstBaseTransform * trans,
|
static gboolean gst_video_scale_get_unit_size (GstBaseTransform * trans,
|
||||||
GstCaps * caps, gsize * size);
|
GstCaps * caps, gsize * size);
|
||||||
|
static gboolean gst_video_scale_setup_allocation (GstBaseTransform * trans,
|
||||||
|
GstQuery * query);
|
||||||
static GstFlowReturn gst_video_scale_transform (GstBaseTransform * trans,
|
static GstFlowReturn gst_video_scale_transform (GstBaseTransform * trans,
|
||||||
GstBuffer * in, GstBuffer * out);
|
GstBuffer * in, GstBuffer * out);
|
||||||
static void gst_video_scale_fixate_caps (GstBaseTransform * base,
|
static void gst_video_scale_fixate_caps (GstBaseTransform * base,
|
||||||
|
@ -228,6 +230,8 @@ gst_video_scale_class_init (GstVideoScaleClass * klass)
|
||||||
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_scale_set_caps);
|
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_scale_set_caps);
|
||||||
trans_class->get_unit_size =
|
trans_class->get_unit_size =
|
||||||
GST_DEBUG_FUNCPTR (gst_video_scale_get_unit_size);
|
GST_DEBUG_FUNCPTR (gst_video_scale_get_unit_size);
|
||||||
|
trans_class->setup_allocation =
|
||||||
|
GST_DEBUG_FUNCPTR (gst_video_scale_setup_allocation);
|
||||||
trans_class->transform = GST_DEBUG_FUNCPTR (gst_video_scale_transform);
|
trans_class->transform = GST_DEBUG_FUNCPTR (gst_video_scale_transform);
|
||||||
trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_video_scale_fixate_caps);
|
trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_video_scale_fixate_caps);
|
||||||
trans_class->src_event = GST_DEBUG_FUNCPTR (gst_video_scale_src_event);
|
trans_class->src_event = GST_DEBUG_FUNCPTR (gst_video_scale_src_event);
|
||||||
|
@ -346,6 +350,26 @@ gst_video_scale_transform_caps (GstBaseTransform * trans,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_video_scale_setup_allocation (GstBaseTransform * trans, GstQuery * query)
|
||||||
|
{
|
||||||
|
GstBufferPool *pool = NULL;
|
||||||
|
guint size, min, max, prefix, alignment;
|
||||||
|
|
||||||
|
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
|
||||||
|
&alignment, &pool);
|
||||||
|
|
||||||
|
if (pool) {
|
||||||
|
GstStructure *config;
|
||||||
|
|
||||||
|
config = gst_buffer_pool_get_config (pool);
|
||||||
|
gst_buffer_pool_config_add_meta (config, GST_META_API_VIDEO);
|
||||||
|
gst_buffer_pool_set_config (pool, config);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_video_scale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
|
gst_video_scale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue