<div dir="ltr">Thanks Thiago, that was it. Thought NULL check would be reasonable here.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 2, 2014 at 2:21 AM, Heiher <span dir="ltr"><<a href="mailto:r@hev.cc" target="_blank">r@hev.cc</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Are you sure the buffer isn't NULL?</p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Dec 2, 2014 8:05 AM, "ign bra" <<a href="mailto:enternald@gmail.com" target="_blank">enternald@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello folks, I am playing with appsink and try to get buffer from appsink.<br>
This part OK.<br>
Problem is when I do cleaning. GstBuffer fails to unref after pull:<br>
<br>
static GstFlowReturn gstre_pull_sample_cb(GstElement* gstappsink,<br>
                                          gpointer data){<br>
    GstSample* sample;<br>
    GstBuffer* buffer;<br>
    GstCaps* caps;<br>
    g_signal_emit_by_name (gstappsink, "pull-sample", &sample);<br>
    if (sample) {<br>
      buffer = gst_sample_get_buffer(sample);<br>
      caps = gst_sample_get_caps(sample);<br>
      gst_buffer_unref(buffer);<br>
      g_print ("*");<br>
      gst_sample_unref(sample);<br>
    }<br>
<br>
<br>
    return GST_FLOW_OK;<br>
}<br>
<br>
I think I am missing something trivial about memory managment, because unref<br>
call simply fails for buffer push:<br>
<br>
** (GstReencoderTest:1624): CRITICAL **: gst_video_frame_map_id: assertion<br>
'GST_IS_BUFFER (buffer)' failed<br>
<br>
(GstReencoderTest:1624): GStreamer-CRITICAL **: gst_pad_push: assertion<br>
'GST_IS_BUFFER (buffer)' failed<br>
<br>
(GstReencoderTest:1624): GStreamer-CRITICAL **: gst_mini_object_unref:<br>
assertion 'mini_object->refcount > 0' failed<br>
<br>
How to properly release buffer in callback, I seem to fail and overunref it,<br>
I don't know how.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/gst-buffer-unref-fails-on-appsink-callback-for-local-variables-tp4669760.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/gst-buffer-unref-fails-on-appsink-callback-for-local-variables-tp4669760.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>
</div></div><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>