GNOME Bugzilla – Bug 680237
QGst::ClockTime is inconvenient to use
Last modified: 2012-12-18 16:35:35 UTC
Created attachment 219208 [details] [review] Add convenience constructors for ClockTime QGst::ClockTime is inconvenient to use: It always needs some thought to remember the proper scale for turning nanoseconds into milliseconds or similar, and even if you do out of sleep, it's easy to accidentally drop some of the significant zeros.
Just on a side note, GStreamer defines GST_SECOND, GST_MSECOND etc. so you can write 5 * GST_SECOND or 5 * GST_MSECOND to get the right amount of nanoseconds (but explicit constructors are nicer of course).
(In reply to comment #1) > Just on a side note, GStreamer defines GST_SECOND, GST_MSECOND etc. so you can > write 5 * GST_SECOND or 5 * GST_MSECOND to get the right amount of nanoseconds > (but explicit constructors are nicer of course). QtGStreamer explicitly doesn't include the GStreamer headers to avoid bad interactions between Qt convenience macros (slots, signals, foreach, forever, ...) and GLib related headers.
Review of attachment 219208 [details] [review]: Looks fine, thanks.
(In reply to comment #2) > (In reply to comment #1) > > Just on a side note, GStreamer defines GST_SECOND, GST_MSECOND etc. so you can > > write 5 * GST_SECOND or 5 * GST_MSECOND to get the right amount of nanoseconds > > (but explicit constructors are nicer of course). > > QtGStreamer explicitly doesn't include the GStreamer headers to avoid bad > interactions between Qt convenience macros (slots, signals, foreach, forever, > ...) and GLib related headers. Fwiw, the reason that QtGStreamer does not include GStreamer headers in its public headers is not that. The reason is that I don't want applications to be polluted with too many includes that are not necessarily required. This way, you don't have to install the gstreamer, glib and libxml development packages in order to use QtGStreamer and you also don't need to force applications to link to gstreamer and glib. This makes compilation and linking faster and serves as an abstraction layer in the (highly unlikely) case gstreamer and/or glib break ABI without API at some point (only QtGStreamer would require recompilation). I admit though that having some macros from GStreamer would be convenient.