GNOME Bugzilla – Bug 586566
Add GAP Flag support to gstcapsfilter
Last modified: 2009-06-23 10:58:08 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 (); }
What's the point of this? Capsfilter doesn't touch the actual data anyway, does it?
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.
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).
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.
(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 :)
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.