[gstreamer-bugs] [Bug 584465] basetransform does unneeded pad_allocs

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Thu Jul 23 05:22:31 PDT 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=584465

  GStreamer | gstreamer (core) | Ver: git




------- Comment #4 from Stefan Kost (gstreamer, gtkdoc dev)  2009-07-23 12:22 UTC -------
Created an attachment (id=139068)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=139068&action=view)
track pad_alloced buffers in a hashtable

I am giving up on this for now. What we need here is beeing able to distinguish
normal alloced buffers from pad_alloced buffers. If a buffer has been created
via pad_alloc, reverse-negotiation would already have been taken care of.

In the new patch I replace the free_func in the buffer with an own and chain up
on destruction. I can identify pad_alloced buffers by checking if the free-func
is mine.

problems:
* in the free function I have no context (need to make the hash table global
and protect with a lock).
* if an element overrides pad_alloc we don't mark it :/ Even though that
basetransform could check if that method is overridden, it does not tell that
it was used to create that buffer (we could if we would require to chain up).

In my tests this till catches 2/3 of the cases though.

One last idea would be adding a buffer flag, to indicate that the buffer has
been allocated using pad_alloc. This would have the same effect as the current
code, but is faster and does not leak buffers. The efficiency could be improved
by adding usage of the flag to functions that override pad_alloc.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=584465.




More information about the Gstreamer-bugs mailing list