diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2015-04-03 17:54:50 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2015-06-12 17:20:16 -0400 |
commit | b5e4f7bd9dc4380b13fb7370efec581abbd2e6af (patch) | |
tree | 8dab10d0b38f34173a1970b06a4bb8921b0c948a /libs/gst/base/gstcollectpads.h | |
parent | 5cab2e14c4ce445591669984661cd88a9bd6d3cd (diff) | |
download | gstreamer-b5e4f7bd9dc4380b13fb7370efec581abbd2e6af.tar.gz |
collectpads: Add negative DTS support
Make gst_collect_pads_clip_running_time() function also store the
signed DTS in the CollectData. This signed DTS value can be used by
muxers to properly handle streams where DTS can be negative initially.
https://bugzilla.gnome.org/show_bug.cgi?id=740575
Diffstat (limited to 'libs/gst/base/gstcollectpads.h')
-rw-r--r-- | libs/gst/base/gstcollectpads.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/libs/gst/base/gstcollectpads.h b/libs/gst/base/gstcollectpads.h index 9d5661417a..bfebaef253 100644 --- a/libs/gst/base/gstcollectpads.h +++ b/libs/gst/base/gstcollectpads.h @@ -104,12 +104,38 @@ typedef enum { #define GST_COLLECT_PADS_STATE_UNSET(data,flag) (GST_COLLECT_PADS_STATE (data) &= ~(flag)) /** + * GST_COLLECT_PADS_DTS: + * @data: A #GstCollectData. + * + * Returns the DTS that has been converted to running time when using + * gst_collect_pads_clip_running_time(). Unlike the value saved into + * the buffer, this value is of type gint64 and may be negative. This allow + * properly handling streams with frame reordering where the first DTS may + * be negative. If the initial DTS was not set, this value will be + * set to %G_MININT64. + * + * Since 1.6 + */ +#define GST_COLLECT_PADS_DTS(data) (((GstCollectData *) data)->ABI.abi.dts) + +/** + * GST_COLLECT_PADS_DTS_IS_VALID: + * @data: A #GstCollectData. + * + * Check if running DTS value store is valid. + * + * Since 1.6 + */ +#define GST_COLLECT_PADS_DTS_IS_VALID(data) (GST_CLOCK_STIME_IS_VALID (GST_COLLECT_PADS_DTS (data))) + +/** * GstCollectData: * @collect: owner #GstCollectPads * @pad: #GstPad managed by this data * @buffer: currently queued buffer. * @pos: position in the buffer * @segment: last segment received. + * @dts: the signed version of the DTS converted to running time. Since 1.6 * * Structure used by the collect_pads. */ @@ -129,7 +155,14 @@ struct _GstCollectData GstCollectDataPrivate *priv; - gpointer _gst_reserved[GST_PADDING]; + /*< public >*/ + union { + struct { + gint64 dts; + } abi; + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; + } ABI; }; /** @@ -363,7 +396,7 @@ void gst_collect_pads_set_waiting (GstCollectPads *pads, GstCollect /* convenience helper */ GstFlowReturn gst_collect_pads_clip_running_time (GstCollectPads * pads, - GstCollectData * cdata, + GstCollectData * cdata, GstBuffer * buf, GstBuffer ** outbuf, gpointer user_data); |