GNOME Bugzilla – Bug 350419
API: GST_SEGMENT_FORMAT printf extension for GstSegments
Last modified: 2006-08-09 15:27:24 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.
Created attachment 70481 [details] [review] propsed API addition of GST_SEGMENT_FORMAT printf extension
I say put it in - looks fine to me from a read-over.
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).