From aa89ae8beb3c1cc5630b4f828ac3b07bf2bcca07 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 8 Oct 2020 13:52:33 +0200 Subject: [PATCH] audio: video: Fix in/outbuf confusion of transform_meta There are three instances where in- and outbuf have been swapped. This didn't affect the correctness of the libs *filter code, but the videoscale implementation swapped the arguments of meta->transform_func. Part-of: --- gst-libs/gst/audio/gstaudiofilter.c | 6 +++--- gst-libs/gst/video/gstvideofilter.c | 8 ++++---- gst/videoscale/gstvideoscale.c | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/audio/gstaudiofilter.c b/gst-libs/gst/audio/gstaudiofilter.c index 6f12159..e6ad740 100644 --- a/gst-libs/gst/audio/gstaudiofilter.c +++ b/gst-libs/gst/audio/gstaudiofilter.c @@ -71,8 +71,8 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstAudioFilter, gst_audio_filter, GST_TYPE_BASE_TRANSFORM, do_init); static gboolean -gst_audio_filter_transform_meta (GstBaseTransform * trans, GstBuffer * inbuf, - GstMeta * meta, GstBuffer * outbuf) +gst_audio_filter_transform_meta (GstBaseTransform * trans, GstBuffer * outbuf, + GstMeta * meta, GstBuffer * inbuf) { const GstMetaInfo *info = meta->info; const gchar *const *tags; @@ -85,7 +85,7 @@ gst_audio_filter_transform_meta (GstBaseTransform * trans, GstBuffer * inbuf, return GST_BASE_TRANSFORM_CLASS (gst_audio_filter_parent_class)->transform_meta - (trans, inbuf, meta, outbuf); + (trans, outbuf, meta, inbuf); } static void diff --git a/gst-libs/gst/video/gstvideofilter.c b/gst-libs/gst/video/gstvideofilter.c index 66a1887..0a42e49 100644 --- a/gst-libs/gst/video/gstvideofilter.c +++ b/gst-libs/gst/video/gstvideofilter.c @@ -348,8 +348,8 @@ invalid_buffer: } static gboolean -gst_video_filter_transform_meta (GstBaseTransform * trans, GstBuffer * inbuf, - GstMeta * meta, GstBuffer * outbuf) +gst_video_filter_transform_meta (GstBaseTransform * trans, GstBuffer * outbuf, + GstMeta * meta, GstBuffer * inbuf) { const GstMetaInfo *info = meta->info; const gchar *const *tags; @@ -360,8 +360,8 @@ gst_video_filter_transform_meta (GstBaseTransform * trans, GstBuffer * inbuf, && gst_meta_api_type_has_tag (info->api, META_TAG_VIDEO))) return TRUE; - return GST_BASE_TRANSFORM_CLASS (parent_class)->transform_meta (trans, inbuf, - meta, outbuf); + return GST_BASE_TRANSFORM_CLASS (parent_class)->transform_meta (trans, outbuf, + meta, inbuf); } static void diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 9f4d514..f73950c 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -195,7 +195,7 @@ static GstCaps *gst_video_scale_transform_caps (GstBaseTransform * trans, static GstCaps *gst_video_scale_fixate_caps (GstBaseTransform * base, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps); static gboolean gst_video_scale_transform_meta (GstBaseTransform * trans, - GstBuffer * inbuf, GstMeta * meta, GstBuffer * outbuf); + GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf); static gboolean gst_video_scale_set_info (GstVideoFilter * filter, GstCaps * in, GstVideoInfo * in_info, GstCaps * out, @@ -500,8 +500,8 @@ gst_video_scale_transform_caps (GstBaseTransform * trans, } static gboolean -gst_video_scale_transform_meta (GstBaseTransform * trans, GstBuffer * inbuf, - GstMeta * meta, GstBuffer * outbuf) +gst_video_scale_transform_meta (GstBaseTransform * trans, GstBuffer * outbuf, + GstMeta * meta, GstBuffer * inbuf) { GstVideoFilter *videofilter = GST_VIDEO_FILTER (trans); const GstMetaInfo *info = meta->info; @@ -535,7 +535,7 @@ gst_video_scale_transform_meta (GstBaseTransform * trans, GstBuffer * inbuf, /* Cant handle the tags in this meta, let the parent class handle it */ if (!should_copy) { return GST_BASE_TRANSFORM_CLASS (parent_class)->transform_meta (trans, - inbuf, meta, outbuf); + outbuf, meta, inbuf); } /* This meta is size sensitive, try to transform it accordingly */ -- 2.7.4