Hi,<br><br>&nbsp; Buffers are reference-counted. They will be freed when the last reference to it is dropped.<br><br>&nbsp; When you create a buffer using gst_buffer_new_and_alloc(), it will return a buffer with a count of 1. When you use gst_pad_push(), that function will TAKE that reference (have a close look at the API documentation) which means that you can no longer use that buffer in your code unless you add a reference.
<br>&nbsp; If that element is just before the audiosink, then once the audiosink has finished with it (when it copied the contents to the ringbuffer), it will unref it by one, which will make the count drop to 0 which means it will be freed.
<br>&nbsp; If you have a non-inplace transformation element in between (audioresample for ex), that element will create a new buffer and put the processed data into it, and the refcount to your buffer will drop when that element is done with it.
<br><br>&nbsp;&nbsp; Edward<br><br><div><span class="gmail_quote">On 7/27/07, <b class="gmail_sendername">pritesh</b> &lt;<a href="mailto:digitaldsp@excite.com">digitaldsp@excite.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 <table bgcolor="white" border="0" cellpadding="3" cellspacing="0" width="100%"><tbody><tr valign="top"><td width="100%"><font color="black" size="2"><br><br>hi all,<br> <br>i want to know about gst_buffer_new_and_alloc api 
<br> <br>if a buffer is created by this api , and pushed to downstream element(say audiosink) , where its memory is freed.<br>  whether it will be freed in audiosink(say osssink).<br><br></font></td></tr></tbody></table><p>
</p><hr><font face="geneva" size="2"><b>Join Excite! - <a href="http://www.excite.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.excite.com</a></b><br>The most personalized portal on the Web!
</font>
<p></p><br>-------------------------------------------------------------------------<br>This SF.net email is sponsored by: Splunk Inc.<br>Still grepping through log files to find problems? &nbsp;Stop.<br>Now Search log events and configuration files using AJAX and a browser.
<br>Download your FREE copy of Splunk now &gt;&gt; &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://get.splunk.com/" target="_blank">http://get.splunk.com/</a><br>_______________________________________________
<br>gstreamer-devel mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Edward Hervey<br>Multimedia editing developer<br><a href="http://www.pitivi.org/">http://www.pitivi.org/
</a>