[gst-devel] Problem using GstAdapter in GstBaseTransform-based element
Dominique Würtz
housirer at gmx.de
Tue Feb 21 08:34:02 CET 2006
Hi,
I'm creating an GstElement derived from GstBaseTransform. For this I
need to use a GstAdapter. Unfortunately, it seems that adapters don't
work with transform elements. A (test) implementation of the
_transform() vfunc as listed below results in a segfault. It seems that
somewhere outside _transform() the inbuf is destroyed though this has
already been done by gst_adapter_flush(). Any ideas what I'm doing wrong?
static GstFlowReturn
my_element_transform (GstBaseTransform *trans, GstBuffer *inbuf,
GstBuffer *outbuf)
{
MyElement *filter;
filter = MY_ELEMENT (trans);
gst_adapter_push (filter->adapter, inbuf);
while (gst_adapter_available (filter->adapter) >= 512) {
gst_adapter_peek (filter->adapter, 512);
gst_adapter_flush (filter->adapter, 512);
}
return GST_FLOW_OK;
}
Regards,
Dominique
More information about the gstreamer-devel
mailing list