diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-11-28 10:58:39 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-11-28 10:58:39 +0000 |
commit | 0e0caaf16a98d999c09811afb651528f4fa559b8 (patch) | |
tree | 81cf65dec74b914981f5346428f74b309f87c0a7 /gst/gstclock.h | |
parent | 7797419321f81f70de8c7c36cd44653be7544232 (diff) | |
download | gstreamer-0e0caaf16a98d999c09811afb651528f4fa559b8.tar.gz |
Start merging in the easy bits of #361155, the monotonic clock patch.
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstclock.h:
* tests/check/gst/gstsystemclock.c: (GST_START_TEST),
(gst_systemclock_suite):
Start merging in the easy bits of #361155, the monotonic clock patch.
This one adds a few handy macros with docs and a testsuite.
Diffstat (limited to 'gst/gstclock.h')
-rw-r--r-- | gst/gstclock.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gst/gstclock.h b/gst/gstclock.h index bc7a9aa92b..3c07d044ce 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -106,6 +106,41 @@ typedef gpointer GstClockID; */ #define GST_NSECOND (GST_SECOND / G_GINT64_CONSTANT (1000000000)) + +/** + * GST_TIME_AS_SECONDS: + * @time: the time + * + * Convert a #GstClockTime to seconds. + * + * Since: 0.10.16 + */ +#define GST_TIME_AS_SECONDS(time) ((time) / GST_SECOND) +/** + * GST_TIME_AS_MSECONDS: + * + * Convert a #GstClockTime to milliseconds (1/1000 of a second). + * + * Since: 0.10.16 + */ +#define GST_TIME_AS_MSECONDS(time) ((time) / G_GINT64_CONSTANT (1000000)) +/** + * GST_TIME_TO_USECONDS: + * + * Convert a #GstClockTime to microseconds (1/1000000 of a second). + * + * Since: 0.10.16 + */ +#define GST_TIME_AS_USECONDS(time) ((time) / G_GINT64_CONSTANT (1000)) +/** + * GST_TIME_TO_NSECONDS: + * + * Convert a #GstClockTime to nanoseconds (1/1000000000 of a second). + * + * Since: 0.10.16 + */ +#define GST_TIME_AS_NSECONDS(time) (time) + /** * GST_CLOCK_DIFF: * @s: the first time |