mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
gst: Use GstClockTimeDiff instead of GstClockTime as type for GST_SECOND and friends
They were (signed!) gint64 before because of G_GINT64_CONSTANT() already and they are actually used in signed calculations. With this change we at least ensure that an integer type of the correct size is used for GI (it was using gint before).
This commit is contained in:
parent
ddd00c0d2f
commit
c173771ed2
1 changed files with 8 additions and 9 deletions
|
@ -95,31 +95,30 @@ typedef gpointer GstClockID;
|
|||
*/
|
||||
#define GST_CLOCK_STIME_IS_VALID(time) (((GstClockTimeDiff)(time)) != GST_CLOCK_STIME_NONE)
|
||||
|
||||
/* FIXME: still need to explicitly force types on the defines below */
|
||||
/**
|
||||
* GST_SECOND: (value 1000000000) (type GstClockTime)
|
||||
* GST_SECOND: (value 1000000000) (type GstClockTimeDiff)
|
||||
*
|
||||
* Constant that defines one GStreamer second.
|
||||
*/
|
||||
#define GST_SECOND ((GstClockTime)(G_USEC_PER_SEC * G_GINT64_CONSTANT (1000)))
|
||||
#define GST_SECOND ((GstClockTimeDiff)(G_USEC_PER_SEC * G_GINT64_CONSTANT (1000)))
|
||||
/**
|
||||
* GST_MSECOND: (value 1000000) (type GstClockTime)
|
||||
* GST_MSECOND: (value 1000000) (type GstClockTimeDiff)
|
||||
*
|
||||
* Constant that defines one GStreamer millisecond.
|
||||
*/
|
||||
#define GST_MSECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000)))
|
||||
#define GST_MSECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000)))
|
||||
/**
|
||||
* GST_USECOND: (value 1000) (type GstClockTime)
|
||||
* GST_USECOND: (value 1000) (type GstClockTimeDiff)
|
||||
*
|
||||
* Constant that defines one GStreamer microsecond.
|
||||
*/
|
||||
#define GST_USECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000000)))
|
||||
#define GST_USECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000000)))
|
||||
/**
|
||||
* GST_NSECOND: (value 1) (type GstClockTime)
|
||||
* GST_NSECOND: (value 1) (type GstClockTimeDiff)
|
||||
*
|
||||
* Constant that defines one GStreamer nanosecond
|
||||
*/
|
||||
#define GST_NSECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000000000)))
|
||||
#define GST_NSECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000000000)))
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue