GNOME Bugzilla – Bug 576505
not all gst_adapter_* methods are wrapped
Last modified: 2009-04-11 14:50:09 UTC
Please describe the problem: Most notibly, peek and take. Without these gst.Adapter isn't very useful. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
You have take_buffer though. There is a way to fix this ... by switching the .defs of Adapter methods to 'gchar *' instead of 'guint8 *' (thereby making the codegenerator understand that they are strings and not pointers to a guint8 value (which it has no clue how to handle).
Created attachment 131232 [details] [review] Declare 'guint8*' arguments This patch teaches codegen about guint8*/const-guint8* arguments. The problem is that... the returned Python strings have got trailing garbage (due to not being \0-terminated).
take_buffer leaks. Patch attached, tell me if it's ok to commit it.
Created attachment 131434 [details] [review] fixes two mem leaks
commit 7aef2834cff525906db15b4af0ee54b723bdd083 Author: Edward Hervey <bilboed@bilboed.com> Date: Thu Mar 26 16:13:48 2009 +0100 New guint8* ArgType. Wraps the various GstAdapter methods. Fixes #576505
As discussed on IRC - I think we should keep this open and add overrides for the GstAdapter methods. Assuming that the data from a take_buffer call even contains a null terminator is dangerous - you're just as likely to overrun the data as to stop too soon. Really, this needs overrides that construct a python character array of the appropriate size, using PyString_FromStringAndSize.
commit ec44907858344a0e07d8da8a652048c5fb0f02ca Author: Edward Hervey <bilboed@bilboed.com> Date: Sat Apr 11 16:37:16 2009 +0200 adapter: overrides for _take/_peek. Fixes #576505. This creates strings of the proper size, unlike the previous patch. commit 0a1bfa3ee19c94e4f4368fb44222697c641bcb2d Author: Edward Hervey <bilboed@bilboed.com> Date: Sat Apr 11 16:48:31 2009 +0200 test_adapter: No longer use slices (which was wrong to start with). commit 04392b2862bc8e05e2e08574e08869ac62e9f9fe Author: Edward Hervey <bilboed@bilboed.com> Date: Sat Apr 11 16:47:07 2009 +0200 arg-types: Remove guint8* argtype. Partially reverts 7aef2834cff525906db15b4af0ee54b723bdd083