[gst-devel] gst_buffer_new_and_alloc:unreferencing

Edward Hervey bilboed at gmail.com
Fri Jul 27 19:30:19 CEST 2007


Hi,

  The general rule is that you want to avoid as many memcpy's as possible.
So if your plugin is, let's say, an mp3 decoder, you need to have a look at
how to have the actual decoding process put its output in the outgoing
buffer. You have several options:
  A) The decoder allows you to give a pointer to a region of data where it
will write its output. In that case you need to allocate a buffer before and
give it GST_BUFFER_DATA (outputbuffer).
  B) The decoder gives you an allocated region of memory every time (new for
every time you call it). In that case you can use gst_buffer_new(), which
doesn't allocate data, and you can set GST_BUFFER_DATA() to that adress.
  C) The decoder always outputs in one identical region of memory (only
allocated once at the beginning). In that case you need to copy over the
data into your newly allocated buffer.

  A) and B) are the best options. C) requires you to copy at every
iteration.

   Hope it helps, but maybe some

      Edward

On 7/27/07, pritesh <digitaldsp at excite.com> wrote:
>
>
> hi,
> ok i got it ,
> what wiil be the overhead of calling this api before decoding a frame ,
> repeatedly for each encoded frame(say mp3)
> here i am saying this in reference to embedded system.
>
>
>
> ------------------------------
> *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
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>


-- 
Edward Hervey
Multimedia editing developer
http://www.pitivi.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070727/72b5e188/attachment.htm>


More information about the gstreamer-devel mailing list