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 760421 - info: expose custom vasprintf implementation
info: expose custom vasprintf implementation
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: 1.7.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-11 05:45 UTC by Matthew Waters (ystreet00)
Modified: 2016-01-13 00:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
info: expose debugging printf functions (4.58 KB, patch)
2016-01-11 05:46 UTC, Matthew Waters (ystreet00)
needs-work Details | Review

Description Matthew Waters (ystreet00) 2016-01-11 05:45:18 UTC
gst libraries and/or elements may want to add some debug logging to an external debug system or implement delayed debugging for performance reasons.
Comment 1 Matthew Waters (ystreet00) 2016-01-11 05:46:27 UTC
Created attachment 318689 [details] [review]
info: expose debugging printf functions
Comment 2 Tim-Philipp Müller 2016-01-11 18:27:24 UTC
Do you need all these different variants? If so, looks fine to me.

>+  if (gst_info_vasprintf (&ret, format, args) <= 0)
>+    ret = NULL;

Not sure about the <= 0 here, format="" should result in an empty return string and not NULL I suppose, or does the return value include the terminator? (Not that it's a terribly important corner case for debugging statements..)
Comment 3 Matthew Waters (ystreet00) 2016-01-12 06:03:34 UTC
I need at least vasprintf for the length.  The others can be implemented on top of that wherever.  I also use strdup_vprintf() somewhere else.

format="" results in an empty string of length 0 so the length doesn't include the null terminator.  I'll fix that so we don't leak memory.
Comment 4 Tim-Philipp Müller 2016-01-12 23:51:44 UTC
Ok, just checking, please push once that corner case is fixed.
Comment 5 Matthew Waters (ystreet00) 2016-01-13 00:59:21 UTC
commit 347734e529ba1adadf34116badcddd4e552bfe46
Author: Matthew Waters <matthew@centricular.com>
Date:   Mon Jan 11 16:31:39 2016 +1100

    info: expose debugging printf functions
    
    Other gst libraries and/or elements may want to add some debug logging to an
    external debug system or implement delayed debugging for performance reasons.
    
    Exposes the internal __gst_vasprintf as gst_info_vasprintf which has a fallback
    to g_vasprintf if the debug system is disabled.
    
    API: gst_info_vasprintf
    API: gst_info_strdup_vprintf
    API: gst_info_strdup_printf
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760421