After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 576505 - not all gst_adapter_* methods are wrapped
not all gst_adapter_* methods are wrapped
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other All
: Normal normal
: 0.10.15
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-23 23:37 UTC by Thomas Vander Stichele
Modified: 2009-04-11 14:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Declare 'guint8*' arguments (5.19 KB, patch)
2009-03-24 08:49 UTC, Edward Hervey
committed Details | Review
fixes two mem leaks (523 bytes, patch)
2009-03-26 14:39 UTC, Thomas Vander Stichele
committed Details | Review

Description Thomas Vander Stichele 2009-03-23 23:37:37 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:
Comment 1 Edward Hervey 2009-03-24 08:24:48 UTC
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).
Comment 2 Edward Hervey 2009-03-24 08:49:15 UTC
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).
Comment 3 Thomas Vander Stichele 2009-03-26 14:39:09 UTC
take_buffer leaks.

Patch attached, tell me if it's ok to commit it.
Comment 4 Thomas Vander Stichele 2009-03-26 14:39:48 UTC
Created attachment 131434 [details] [review]
fixes two mem leaks
Comment 5 Edward Hervey 2009-03-26 15:15:46 UTC
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

Comment 6 Jan Schmidt 2009-03-26 15:49:14 UTC
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.
Comment 7 Edward Hervey 2009-04-11 14:50:09 UTC
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