GstEvent event;
GstStructure *structure;
+ gint64 running_time_offset;
} GstEventImpl;
#define GST_EVENT_STRUCTURE(e) (((GstEventImpl *)(e))->structure)
} else {
GST_EVENT_STRUCTURE (copy) = NULL;
}
+
+ ((GstEventImpl *) copy)->running_time_offset =
+ ((GstEventImpl *) event)->running_time_offset;
+
return GST_EVENT_CAST (copy);
}
GST_EVENT_TYPE (event) = type;
GST_EVENT_TIMESTAMP (event) = GST_CLOCK_TIME_NONE;
GST_EVENT_SEQNUM (event) = gst_util_seqnum_next ();
+ event->running_time_offset = 0;
}
}
/**
+ * gst_event_get_running_time_offset:
+ * @event: A #GstEvent.
+ *
+ * Retrieve the accumulated running time offset of the event.
+ *
+ * Events passing through #GstPads that have a running time
+ * offset set via gst_pad_set_offset() will get their offset
+ * adjusted according to the pad's offset.
+ *
+ * If the event contains any information that related to the
+ * running time, this information will need to be updated
+ * before usage with this offset.
+ *
+ * Returns: The event's running time offset
+ *
+ * MT safe.
+ *
+ * Since: 1.4
+ */
+gint64
+gst_event_get_running_time_offset (GstEvent * event)
+{
+ g_return_val_if_fail (GST_IS_EVENT (event), 0);
+
+ return ((GstEventImpl *) event)->running_time_offset;
+}
+
+/**
+ * gst_event_set_running_time_offset:
+ * @event: A #GstEvent.
+ * @offset: A the new running time offset
+ *
+ * Set the running time offset of a event. See
+ * gst_event_get_running_time_offset() for more information.
+ *
+ * MT safe.
+ *
+ * Since: 1.4
+ */
+void
+gst_event_set_running_time_offset (GstEvent * event, gint64 offset)
+{
+ g_return_if_fail (GST_IS_EVENT (event));
+
+ ((GstEventImpl *) event)->running_time_offset = offset;
+}
+
+/**
* gst_event_new_flush_start:
*
* Allocate a new flush start event. The flush start event can be sent
guint32 gst_event_get_seqnum (GstEvent *event);
void gst_event_set_seqnum (GstEvent *event, guint32 seqnum);
+/* accumulated pad offsets for the event */
+gint64 gst_event_get_running_time_offset (GstEvent *event);
+void gst_event_set_running_time_offset (GstEvent *event, gint64 offset);
+
/* Stream start event */
GstEvent * gst_event_new_stream_start (const gchar *stream_id) G_GNUC_MALLOC;
void gst_event_parse_stream_start (GstEvent *event, const gchar **stream_id);