Buffers are reference-counted. They will be freed when the last reference to it is dropped.

  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.
  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.
  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.


On 7/27/07, pritesh <digitaldsp@excite.com> wrote:

hi all,

i want to know about gst_buffer_new_and_alloc api

if a buffer is created by this api , and pushed to downstream element(say audiosink) , where its memory is freed.
whether it will be freed in audiosink(say osssink).

Join Excite! - http://www.excite.com
The most personalized portal on the Web!

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
gstreamer-devel mailing list

Edward Hervey
Multimedia editing developer