[Bug 730914] New: mpegts lib : Ensure all functions/fields are introspectable and are not leaked

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed May 28 23:20:24 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=730914
  GStreamer | gst-plugins-bad | git

           Summary: mpegts lib : Ensure all functions/fields are
                    introspectable and are not leaked
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: bilboed at bilboed.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Yes, this will need an API/ABI break

We have an issue with quite a few of the descriptor parsing functions that
allocate memory.

One (simple) example
========================================
struct _GstMpegTsComponentDescriptor
{
  guint8 stream_content;
  guint8 component_type;
  guint8 component_tag;
  /* FIXME : Make it a separate (allocated, null-terminated) return value  */
  gchar  language_code[4];
  gchar *text;
};

gboolean gst_mpegts_descriptor_parse_dvb_component (const GstMpegTsDescriptor
*descriptor,
                            GstMpegTsComponentDescriptor *res);
========================================

Problem:
1) the text field is allocated but we have no simple way to free it (with
gobject-introspection in mind)
2) there's no registered free/copy/Gtype for the return structure, meaning g-i
will leak it
3) a lot of the annotations aren't correct (ex: the list argument of
gst_mpegts_descriptor_parse_dvb_ca_identifier)

Since 1.4. is coming up RSN, we should not do this break in the middle of it.
Yes, this helper library is in -bad and is an unstable API, but breaking it
halfway through will suck ...


Proposal:
For every parsed structure (such as GstMpegTsComponentDescriptor) that will
have allocated memory:
1) The parsing function will take that argument as a pointer of pointer (ex:
(..., GstMpegTsComponentDescriptor **res))
2) The annotation will indicate (transfer full)
3) There will be a registered GBoxed GType will registered copy/free functions

For every function:
1) make sure the transfer annotations are correct

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list