Reffing of gstbuffer is exhausting the system memory ?

ssshukla26 ssshukla26 at gmail.com
Wed Feb 10 10:07:56 UTC 2016


Hi,

My use case is to build a gstreamer plugin working like v4l2src for our
camera which is non-complaint with the v4l2 driver. I have developed the
plugin and its working.

Everything is fine, but my system memory is getting exhausted, when I run
the plugin and finally my system crashes. 

Here what I have done.

1) When my gstreamer plugin calls a external library function made by me, I
make a new GstBuffer wrapping the frame data and return it, as shown below.

GstBuffer * *cam_gst_cgi_getVideoFrame*(void)
{
    GstBuffer *buf =
*gst_buffer_ref*(gst_buffer_new_wrapped(currentVideoFrame->data,YUV_FRAME_SIZE));
    return buf;
}

2) Under my gstreamer plugin whose base class is GstBaseSrc, under *create*
method I do the following.

static GstFlowReturn gst_my_file_src_create (GstBaseSrc *src, guint64
offset, guint size,
        GstBuffer **buf)
{
    *gst_buffer_replace*(buf,*cam_gst_cgi_getVideoFrame*());
    return GST_FLOW_OK;
}

So what I did wrong ?

If I *don't use gst_buffer_ref* it gives me invalid buffer error !
If I *use gst_buffer_ref* the system memory exhausts ? that means unref
isn't able to free buffer as ref count is not reaching zero, but why ? 
If I *use gst_buffer_unref* under my *create* function before the return
statement, it still gives me invalid buffer error !

So what is a solution to this ?? 

Can't I make my own buffer and then give it to my plugin and rest of the
things can be then taken care of by itself ? 

Am so close to complete my plugin development, please help guyz. 






--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Reffing-of-gstbuffer-is-exhausting-the-system-memory-tp4675770.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list