GNOME Bugzilla – Bug 608213
add some more debugging macros to gstclock.h and gstbuffer.h
Last modified: 2012-12-10 12:48:20 UTC
Created attachment 152369 [details] [review] add two _FORMAT strings and matching _ARGS() macros I find the following macros useful in the things I do. Perhaps they would be useful to others as well.
Review of attachment 152369 [details] [review]: Some of the doc additions are fine with me. Not sure about the extra macros. Should not hurt. ::: gst/gstbuffer.h @@ +212,3 @@ + * + * printf("%" GST_BUFFER_BOUNDARIES_FORMAT "\n", GST_BUFFER_BOUNDARIES_ARGS(buf)); + * could you change this into: |[ printf("%" GST_BUFFER_BOUNDARIES_FORMAT "\n", GST_BUFFER_BOUNDARIES_ARGS(buf)); ]| Thats gtk-doc shortcut syntax for <informalexample><programmlisting>...</programmlisting></informalexample> ::: gst/gstclock.h @@ +209,3 @@ + * #GstClockTime value in h:m:s format. Use GST_TIME_ARGS to construct + * the matching arguments. + * You would use "Use GST_TIME_ARGS() to construct" to make it xref'ed.
Created attachment 152534 [details] [review] add two _FORMAT strings and matching _ARGS() macros new version using "...()" for xrefs. sorry, I'm not setup to build the docs locally so I can't test.
Created attachment 152535 [details] [review] add two _FORMAT strings and matching _ARGS() macros oops, forgot to add the |[...]| delimiters for the example code. this version does that, too.
Hi, Can I ping you guys on this one again? Some of the other people I'm working with have expressed a desire to have at least the GST_TIME_FORMAT and GST_TIME_ARGS() macros available upstream. The reason is that next we'd like to propose a patch to the time overlay element, to add a feature to allow it to optionally format its output using these macros instead of the h:m:s format it currently uses. Some explanation: we work with data streams that are time-stamped using GPS clocks, so the natural time foramt for us is the count of seconds since the GPS epoch. We're more familiar with "874000000.0 s" than with "242777:46:40.0".
Stefan? What shall we do with this patch?
I have pushed the doc improvement parts. commit 696a9a694f4f4dfe2f2fbf5929b96bb030a3af18 Author: Kipp Cannon <kcannon@cita.utoronto.ca> Date: Tue May 24 00:26:40 2011 +0300 clock: improve the GST_TIME_FORMAT/ARGS docs I am a bit unsure about the macros. So far I haven't missed them, but some people might find them handy. Would be nice to get an updated patch in git format.
Created attachment 188724 [details] [review] add GST_TIME_SECONDS_FORMAT GST_BUFFER_BOUNDARIES_FORMAT Updated patch in git-format-patch format. Thanks for looking into this. It would really be useful to have the time macros for printing GstClockTime objects in seconds available upstream. The buffer boundaries macro has made writing debugging messages easier, when trying to watch the samples and time stamps moving around in pipelines, but is less urgent.
Comment on attachment 188724 [details] [review] add GST_TIME_SECONDS_FORMAT GST_BUFFER_BOUNDARIES_FORMAT Please make this two patches then
Created attachment 188782 [details] [review] add GST_TIME_SECONDS_FORMAT, GST_TIME_SECONDS_ARGS() patch for gst/gstclock.h
Created attachment 188783 [details] [review] add GST_BUFFER_BOUNDARIES_FORMAT, GST_BUFFER_BOUNDARIES_ARGS() patch gst/gstbuffer.h
OK, done. The gstbuffer.h needs to be applied after the gstclock.h patch (but I suppose that's reflected in the metadata in the patch files).
GST_PTR_FORMAT on a GstBuffer is much easier and more useful, IMO. Surely the time macro doesn't need to be in core either, you can add it where you need it along with the million other ways of formatting a time format.