[gst-devel] Memory leak on a PushSrc subclass
Corentin BARON
corentin.baron at inrialpes.fr
Wed Aug 16 10:26:06 CEST 2006
Hello list,
I've got a memory leak problem I couldn't deal with. In my create()
function, I instanciate a GstBuffer, and the data I put in it, and
then set the GstBuffer's data pointer to the data I just created.
Everything works fine excepts that the data I created seems to be
lost somewhere in the pipeline.
Here's a part of the create() function:
> static GstFlowReturn gst_blinkysrc_create(GstPushSrc * psrc,
> GstBuffer ** buffer)
> {
> GstBuffer *buf;
> void *dest;
> GstBlinkySrc *filter = GST_BLINKYSRC(psrc);
> [...]
> buf = gst_buffer_new();
> gst_buffer_set_caps(buf, GST_PAD_CAPS(GST_BASE_SRC_PAD(psrc));
> [...]
> outbufsize = 3*filter->buffer.header.width*filter-
> >buffer.header.height/2;
> dest = (void*)buf2I420(filter->buffer, !filter->silent); // This
> function actually initialize dest with a size of (3*width*height/2)
> *sizeof(uint8_t)
> // This is what is lost by the pipeline (that's what
> valgrind told me, I have no reason not
> // to believe it).
> gst_buffer_set_data(buf, dest, outbufsize);
> g_return_val_if_fail(buf != NULL, GST_FLOW_ERROR);
> *buffer = buf;
> return GST_FLOW_OK;
> }
Thx for your help,
Corentin.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: corentinbaron.gpgkey
Type: application/octet-stream
Size: 916 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060816/fb38c5e6/attachment.obj>
-------------- next part --------------
More information about the gstreamer-devel
mailing list