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 608213 - add some more debugging macros to gstclock.h and gstbuffer.h
add some more debugging macros to gstclock.h and gstbuffer.h
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-27 00:35 UTC by Kipp
Modified: 2012-12-10 12:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add two _FORMAT strings and matching _ARGS() macros (3.22 KB, patch)
2010-01-27 00:35 UTC, Kipp
reviewed Details | Review
add two _FORMAT strings and matching _ARGS() macros (3.23 KB, patch)
2010-01-29 00:22 UTC, Kipp
none Details | Review
add two _FORMAT strings and matching _ARGS() macros (3.22 KB, patch)
2010-01-29 00:25 UTC, Kipp
none Details | Review
add GST_TIME_SECONDS_FORMAT GST_BUFFER_BOUNDARIES_FORMAT (3.11 KB, patch)
2011-05-27 04:25 UTC, Kipp
needs-work Details | Review
add GST_TIME_SECONDS_FORMAT, GST_TIME_SECONDS_ARGS() (1.67 KB, patch)
2011-05-27 21:45 UTC, Kipp
none Details | Review
add GST_BUFFER_BOUNDARIES_FORMAT, GST_BUFFER_BOUNDARIES_ARGS() (2.02 KB, patch)
2011-05-27 21:46 UTC, Kipp
none Details | Review

Description Kipp 2010-01-27 00:35:46 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.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-01-28 15:14:01 UTC
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.
Comment 2 Kipp 2010-01-29 00:22:11 UTC
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.
Comment 3 Kipp 2010-01-29 00:25:53 UTC
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.
Comment 4 Kipp 2010-11-30 22:34:56 UTC
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".
Comment 5 Sebastian Dröge (slomo) 2011-05-23 14:54:15 UTC
Stefan? What shall we do with this patch?
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-23 21:25:01 UTC
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.
Comment 7 Kipp 2011-05-27 04:25:24 UTC
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 8 Sebastian Dröge (slomo) 2011-05-27 07:15:22 UTC
Comment on attachment 188724 [details] [review]
add GST_TIME_SECONDS_FORMAT GST_BUFFER_BOUNDARIES_FORMAT

Please make this two patches then
Comment 9 Kipp 2011-05-27 21:45:42 UTC
Created attachment 188782 [details] [review]
add GST_TIME_SECONDS_FORMAT, GST_TIME_SECONDS_ARGS()

patch for gst/gstclock.h
Comment 10 Kipp 2011-05-27 21:46:30 UTC
Created attachment 188783 [details] [review]
add GST_BUFFER_BOUNDARIES_FORMAT,  GST_BUFFER_BOUNDARIES_ARGS()

patch gst/gstbuffer.h
Comment 11 Kipp 2011-05-27 21:48:34 UTC
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).
Comment 12 Wim Taymans 2012-12-10 12:48:20 UTC
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.