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 350419 - API: GST_SEGMENT_FORMAT printf extension for GstSegments
API: GST_SEGMENT_FORMAT printf extension for GstSegments
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-08 12:06 UTC by Tim-Philipp Müller
Modified: 2006-08-09 15:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
propsed API addition of GST_SEGMENT_FORMAT printf extension (6.18 KB, patch)
2006-08-08 12:07 UTC, Tim-Philipp Müller
none Details | Review

Description Tim-Philipp Müller 2006-08-08 12:06:37 UTC
Currently it's a bit tedious to dump GstSegment info to the debug log, often involving 5-6 line debug statements.

This could be done much nicer if we registered a printf extension for GstSegments, then we could just do


  GST_DEBUG_OBJECT (dec, "segment now: %" GST_SEGMENT_FORMAT, &dec->segment);

and it would result in something like:

 foobar.c(123):bla_sink_event: time segment last_stop=0:00:00.000000500, start=0:00:00.000000500, stop=0:00:00.000000700, duration=99:99:99.999999999, rate=-2.000000, applied_rate=-1.000000, flags=0x00000000, time=0:00:00.000000200, accum=0:00:00.000000800

Patch attached.
Comment 1 Tim-Philipp Müller 2006-08-08 12:07:32 UTC
Created attachment 70481 [details] [review]
propsed API addition of GST_SEGMENT_FORMAT printf extension
Comment 2 Jan Schmidt 2006-08-08 13:32:23 UTC
I say put it in - looks fine to me from a read-over.
Comment 3 Tim-Philipp Müller 2006-08-09 15:27:24 UTC
Committed:

  2006-08-08  Tim-Philipp Müller  <tim at centricular dot net>

        * configure.ac:
        * docs/gst/gstreamer-sections.txt:
        * gst/gstconfig.h.in:
        * gst/gstinfo.c: (_gst_debug_init), (gst_debug_print_segment),
        (_gst_info_printf_extension_ptr),
        (_gst_info_printf_extension_segment):
          API: add GST_SEGMENT_FORMAT, which is a printf extension we
          register that lets us easily dump GstSegments into debug
          logs (#350419).

        * tests/check/gst/gstinfo.c: (segment_printf_extension_log_func),
        (info_segment_format_printf_extension), (gst_info_suite):
          Add simple unit test that logs a bunch of different segments (not
          valgrinded at the moment because of leaks in 
          gst_debug_add_log_function).