mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
videoconvert: use base class new vmethods
Use the base class filter_meta to proxy all metadata upstream. Use the base class transform_meta to let it copy all non-colorspace dependent metadata.
This commit is contained in:
parent
1ede067d27
commit
abca785f0f
1 changed files with 30 additions and 0 deletions
|
@ -158,6 +158,14 @@ gst_video_convert_fixate_caps (GstBaseTransform * trans,
|
|||
return result;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_video_convert_filter_meta (GstBaseTransform * trans, GstQuery * query,
|
||||
GType api)
|
||||
{
|
||||
/* propose all metadata upstream */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* The caps can be transformed into any other caps with format info removed.
|
||||
* However, we should prefer passthrough, so if passthrough is possible,
|
||||
* put it first in the list. */
|
||||
|
@ -185,6 +193,24 @@ gst_video_convert_transform_caps (GstBaseTransform * btrans,
|
|||
return result;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_video_convert_transform_meta (GstBaseTransform * trans, GstBuffer * outbuf,
|
||||
GstMeta * meta, GstBuffer * inbuf)
|
||||
{
|
||||
const GstMetaInfo *info = meta->info;
|
||||
gboolean ret;
|
||||
|
||||
if (gst_meta_api_type_has_tag (info->api, _colorspace_quark)) {
|
||||
/* don't copy colorspace specific metadata, FIXME, we need a MetaTransform
|
||||
* for the colorspace metadata. */
|
||||
ret = FALSE;
|
||||
} else {
|
||||
/* copy other metadata */
|
||||
ret = TRUE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_video_convert_set_info (GstVideoFilter * filter,
|
||||
GstCaps * incaps, GstVideoInfo * in_info, GstCaps * outcaps,
|
||||
|
@ -348,6 +374,10 @@ gst_video_convert_class_init (GstVideoConvertClass * klass)
|
|||
GST_DEBUG_FUNCPTR (gst_video_convert_transform_caps);
|
||||
gstbasetransform_class->fixate_caps =
|
||||
GST_DEBUG_FUNCPTR (gst_video_convert_fixate_caps);
|
||||
gstbasetransform_class->filter_meta =
|
||||
GST_DEBUG_FUNCPTR (gst_video_convert_filter_meta);
|
||||
gstbasetransform_class->transform_meta =
|
||||
GST_DEBUG_FUNCPTR (gst_video_convert_transform_meta);
|
||||
|
||||
gstbasetransform_class->passthrough_on_same_caps = TRUE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue