API: GST_BUFFER_DTS_OR_PTS
Many scenarios/elements require dealing with streams of buffers that
might have DTS set (i.e. encoded data, potentially reordered)
To simplify getting the increasing "timestamp" of those buffers, create
a macro that will return the DTS if valid, and if not the PTS
GST_BUFFER_PTS
GST_BUFFER_DTS
+GST_BUFFER_DTS_OR_PTS
GST_BUFFER_DURATION
GST_BUFFER_OFFSET
GST_BUFFER_OFFSET_END
* Value will be %GST_CLOCK_TIME_NONE if the dts is unknown.
*/
#define GST_BUFFER_DTS(buf) (GST_BUFFER_CAST(buf)->dts)
+/**
+ * GST_BUFFER_DTS_OR_PTS:
+ * @buf: a #GstBuffer.:
+ *
+ * Returns the buffer decoding timestamp (dts) if valid, else the buffer
+ * presentation time (pts)
+ */
+#define GST_BUFFER_DTS_OR_PTS(buf) (GST_BUFFER_DTS_IS_VALID(buf) ? GST_BUFFER_DTS(buf) : GST_BUFFER_PTS (buf))
/**
* GST_BUFFER_DURATION:
* @buf: a #GstBuffer.