gst_buffer_unref fails on appsink callback for local variables

Heiher r at hev.cc
Mon Dec 1 16:21:12 PST 2014


Are you sure the buffer isn't NULL?
On Dec 2, 2014 8:05 AM, "ign bra" <enternald at gmail.com> wrote:

> Hello folks, I am playing with appsink and try to get buffer from appsink.
> This part OK.
> Problem is when I do cleaning. GstBuffer fails to unref after pull:
>
> static GstFlowReturn gstre_pull_sample_cb(GstElement* gstappsink,
>                                           gpointer data){
>     GstSample* sample;
>     GstBuffer* buffer;
>     GstCaps* caps;
>     g_signal_emit_by_name (gstappsink, "pull-sample", &sample);
>     if (sample) {
>       buffer = gst_sample_get_buffer(sample);
>       caps = gst_sample_get_caps(sample);
>       gst_buffer_unref(buffer);
>       g_print ("*");
>       gst_sample_unref(sample);
>     }
>
>
>     return GST_FLOW_OK;
> }
>
> I think I am missing something trivial about memory managment, because
> unref
> call simply fails for buffer push:
>
> ** (GstReencoderTest:1624): CRITICAL **: gst_video_frame_map_id: assertion
> 'GST_IS_BUFFER (buffer)' failed
>
> (GstReencoderTest:1624): GStreamer-CRITICAL **: gst_pad_push: assertion
> 'GST_IS_BUFFER (buffer)' failed
>
> (GstReencoderTest:1624): GStreamer-CRITICAL **: gst_mini_object_unref:
> assertion 'mini_object->refcount > 0' failed
>
> How to properly release buffer in callback, I seem to fail and overunref
> it,
> I don't know how.
>
>
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/gst-buffer-unref-fails-on-appsink-callback-for-local-variables-tp4669760.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141202/8982af99/attachment.html>


More information about the gstreamer-devel mailing list