audio: video: Fix in/outbuf confusion of transform_meta
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Thu, 8 Oct 2020 11:52:33 +0000 (13:52 +0200)
committerJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Thu, 8 Oct 2020 16:30:39 +0000 (18:30 +0200)
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/853>

gst-libs/gst/audio/gstaudiofilter.c
gst-libs/gst/video/gstvideofilter.c
gst/videoscale/gstvideoscale.c

index 6f12159..e6ad740 100644 (file)
@@ -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
index 66a1887..0a42e49 100644 (file)
@@ -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
index 9f4d514..f73950c 100644 (file)
@@ -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 */