[gst-devel] Capsfilter and partial fixate bug ? patch comments ?

Antoine Tremblay hexa00 at gmail.com
Fri Dec 2 13:23:07 CET 2005


HI all,

I've come up with the following problem I got something like  "filesrc
location="file.in" ! audio/XXX ! plugin ! fakesink"

Plugin can take audio/XXX,var=x ... So i'm partially setting the caps with
the caps filter

The problems seems to be that they caps are never fixated , my fixate
function in my plugin isn't called nor is my setcaps... and filesrc pushes
me a buffer with caps = NULL :(

I"ve solved it by patching with :

--- gstreamer-cvs/plugins/elements/gstcapsfilter.c      2005-11-29 13:00:
15.000000000 -0500
+++ gstreamer/plugins/elements/gstcapsfilter.c  2005-12-02 15:21:
51.000000000 -0500
@@ -256,7 +256,11 @@
       out_caps = gst_pad_get_allowed_caps (trans->srcpad);
       g_return_val_if_fail (out_caps != NULL, GST_FLOW_ERROR);
     }
-
+
+    if(!gst_caps_is_fixed(out_caps) || gst_caps_is_empty (out_caps)) {
+       out_caps = gst_capsfilter_transform_caps(trans, GST_PAD_UNKNOWN,
out_caps);
+       gst_pad_fixate_caps(trans->srcpad, out_caps);
+    }
     if (gst_caps_is_fixed (out_caps) && !gst_caps_is_empty (out_caps)) {
       GST_DEBUG_OBJECT (trans, "Have fixed output caps %"
           GST_PTR_FORMAT " to apply to buffer with no caps", out_caps);


But i'm really not sure it's a good way to do it :(

I made the patch with the rationale that capsfilter wounldn't be able to set
the caps if they were not fixed .. so I fixed them before but maybe I should
do the fixate on the sinkpad, or do something completly different...

I'm also unsure about what happends when you send a buffer with no caps (the
1st) shouldn't some default fixate function be called then ?

Thanks a lot

Antoine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20051202/b8813ce3/attachment.htm>


More information about the gstreamer-devel mailing list