GNOME Bugzilla – Bug 710268
basetransform: cannot answer GST_QUERY_ALLOCATION if its src has ANY caps
Last modified: 2014-05-26 12:26:38 UTC
In gst_base_src_default_negotiate(), if gst_caps_is_any() goto no_nego_needed, which means that gst_base_src_set_caps is never called and no GST_EVENT_CAPS is emitted from the src element. In gst_base_transform_default_query(), when answering GST_QUERY_ALLOCATION, if !priv->negotiated, "not negotiated yet, can't answer ALLOCATION query". priv->negotiated only gets set in response to a GST_EVENT_CAPS, so for some pipelines the transform element is unable to query further downstream with GST_QUERY_ALLOCATION and instead allocates buffers itself. For downstream elements, most notably decoders, that require the use of a specific GstAllocator this means some pipelines fail. For example, assuming myaudiodecoder has a GstAllocator and cannot receive GstBuffers allocated by the default allocator: gst-launch-1.0 filesrc location=/usr/test.mp3 ! myaudiodecoder ! myaudiosink works, i.e. filesrc allocates buffers using an allocator assigned by myaudiodecoder, but gst-launch-1.0 filesrc location=/usr/test.mp3 ! identity ! myaudiodecoder ! myaudiosink fails because the 'identity' element (base class GstBaseTransform) fails to forward the GST_QUERY_ALLOCATION from filesrc (base class GstBaseSrc) to myaudiodecoder because filesrc never emitted a GST_EVENT_CAPS.
Confirmed, that needs to be fixed. However your audiodecoder should use special capsfeatures if it can't work with normal system memory. But that's a separate issue :)
commit 70b38dd9375f747bd8a9218c14a00631553ba792 Author: Sebastian Dröge <sebastian@centricular.com> Date: Mon May 26 14:23:13 2014 +0200 basetransform: Passthrough ALLOCATION queries in passthrough mode even if we had no caps yet Or if the element does not care about caps at all. Also remove an assigned but unused local variable. https://bugzilla.gnome.org/show_bug.cgi?id=710268