After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586566 - Add GAP Flag support to gstcapsfilter
Add GAP Flag support to gstcapsfilter
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-21 19:53 UTC by Chad
Modified: 2009-06-23 10:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Chad 2009-06-21 19:53:42 UTC
The basic machinery to support GAP Flags is already available to gstcapsfilter since it subclasses GSTBaseTransform.  This patch simply calls the gst_base_transform_set_gap_aware() method


channa@channa-desktop:~/git/gstreamer$ git diff -p master
diff --git a/common b/common
index f3bb51b..6ab11d1 160000
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit f3bb51b867ff403f70d36fc772861d8e57c703ed
+Subproject commit 6ab11d17cb8e4d1ed755da7accac9630d567a097
diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c
index 3442ff3..1a02b84 100644
--- a/plugins/elements/gstcapsfilter.c
+++ b/plugins/elements/gstcapsfilter.c
@@ -122,6 +122,8 @@ gst_capsfilter_class_init (GstCapsFilterClass * klass)
 static void
 gst_capsfilter_init (GstCapsFilter * filter, GstCapsFilterClass * g_class)
 {
+  GstBaseTransform *trans = GST_BASE_TRANSFORM (filter);
+  gst_base_transform_set_gap_aware (trans, TRUE);
   filter->filter_caps = gst_caps_new_any ();
 }
Comment 1 Tim-Philipp Müller 2009-06-21 23:03:36 UTC
What's the point of this? Capsfilter doesn't touch the actual data anyway, does it?
Comment 2 Chad 2009-06-21 23:06:52 UTC
The issue is that the GSTBaseTransform resets the GAP flag by default if this method isn't called.  Pipelines that are trying to preserve GAP flags, but have used a capsfilter, will be broken otherwise.
Comment 3 Sebastian Dröge (slomo) 2009-06-22 05:55:13 UTC
Exactly, and we can't simply forward the GAP flag in basetransform in any case because the meaning of the GAP flag was added in 0.10.15 or something and most elements are not aware of the meaning yet (thus changing data but not changing the GAP flag).
Comment 4 Chad 2009-06-22 16:43:37 UTC
I am confused.  According to 

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseTransform.html#gst-base-transform-set-gap-aware

anything that subclasses GSTBaseTransform and does not use the method

gst_base_transform_set_gap_aware ()

will have its GAP Flag unset.  gstcapsfilter is a case of this.  Therefore a pipeline that has otherwise GAP aware elements cannot use gstcapsfilter and preserve GAPs throughout the pipeline.  What is the harm in this patch?  How does it interfere with other elements?  (I am not advocating changing GSTBaseTransform)
Have I misunderstood something?  Sorry if I have.
Comment 5 Sebastian Dröge (slomo) 2009-06-22 17:44:39 UTC
(In reply to comment #4)
> I am confused.  According to 
> 
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseTransform.html#gst-base-transform-set-gap-aware
> 
> anything that subclasses GSTBaseTransform and does not use the method
> 
> gst_base_transform_set_gap_aware ()
> 
> will have its GAP Flag unset.  gstcapsfilter is a case of this.  Therefore a
> pipeline that has otherwise GAP aware elements cannot use gstcapsfilter and
> preserve GAPs throughout the pipeline.  What is the harm in this patch?  How
> does it interfere with other elements?  (I am not advocating changing
> GSTBaseTransform)
> Have I misunderstood something?  Sorry if I have.

No, your understanding is correct. I'll commit your patch tomorrow, don't worry :)

Comment 6 Sebastian Dröge (slomo) 2009-06-23 10:58:08 UTC
commit 012cb28e45cdf985178cd2a006dca5a90cd15be4
Author: Chad Hanna <channa@ligo.caltech.edu>
Date:   Tue Jun 23 12:56:59 2009 +0200

    capsfilter: Add GAP flag support
    
    capsfilter doesn't actually touch the data so we don't want the GAP flag to
    be unset by basetransform.
    
    Fixes bug #586566.