Memory leak happening with gstatomic queue
Patrick Doyle
wpdster at gmail.com
Fri Nov 21 03:42:57 PST 2014
You call gst_buffer_try_new_and_alloc(). When does your application
unref that buffer?
--wpd
On Fri, Nov 21, 2014 at 5:34 AM, HK <shockguy at gmail.com> wrote:
> Hi,
>
> I am creating a push source plugin. This will take the ts data from external
> device. So receiving the data is handled in one thread. The data will be
> received in this thread and will push it to the atomic queue.
>
> In my create function, I will pop the data from queue and pass it to base
> src. But I am observing memory leak and the app is crashing. Please see the
> code below
>
> recv_thread ()
> {
> uint8* data;
> GstBuffer *buf;
> while (1) {
> data = recv_data();
> buf = gst_buffer_try_new_and_alloc(SIZE);
> GST_BUFFER_SIZE (buf) = SIZE;
> memcpy((GST_BUFFER_DATA (buf)), data, SIZE);
>
> gst_atomic_queue_push(Context->atqueue, buf);
> }
> }
>
>
>
> // CREATE METHOD
> src_create(GstBuffer **buffer)
> {
> GstBuffer *buf;
>
> buf = gst_atomic_queue_pop(Context->atqueue);
> *buffer = buf; ( this will give the buffer to base src )
> }
>
> As per my understandig, I am giving the GstBuffer created in my thread to
> base source and base source should unref it. But I am having heavy memory
> leak in this.
> Could someone suggest what is going wrong ?
>
> Regards
> Hari
>
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Memory-leak-happening-with-gstatomic-queue-tp4669601.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list