gst_structure_set_parent_refcount (s, NULL);
gst_structure_free (s);
}
+#ifdef USE_POISONING
+ memset (event, 0xff, sizeof (GstEventImpl));
+#endif
g_slice_free1 (sizeof (GstEventImpl), event);
}
* New custom events can also be created by subclassing the event type if
* needed.
*
- * Returns: (transfer full): the new custom event.
+ * Returns: (transfer full) (nullable): the new custom event.
*/
GstEvent *
gst_event_new_custom (GstEventType type, GstStructure * structure)
gst_event_set_seqnum (GstEvent * event, guint32 seqnum)
{
g_return_if_fail (GST_IS_EVENT (event));
+ g_return_if_fail (seqnum != GST_SEQNUM_INVALID);
+ g_return_if_fail (gst_event_is_writable (event));
GST_EVENT_SEQNUM (event) = seqnum;
}
gst_event_set_running_time_offset (GstEvent * event, gint64 offset)
{
g_return_if_fail (GST_IS_EVENT (event));
+ g_return_if_fail (gst_event_is_writable (event));
((GstEventImpl *) event)->running_time_offset = offset;
}
* synchronized with the buffer flow and contains the format of the buffers
* that will follow after the event.
*
- * Returns: (transfer full): the new CAPS event.
+ * Returns: (transfer full) (nullable): the new CAPS event.
*/
GstEvent *
gst_event_new_caps (GstCaps * caps)
*
* time + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
*
- * Returns: (transfer full): the new SEGMENT event.
+ * Returns: (transfer full) (nullable): the new SEGMENT event.
*/
GstEvent *
gst_event_new_segment (const GstSegment * segment)
* The application can use general event probes to intercept the QoS
* event and implement custom application specific QoS handling.
*
- * Returns: (transfer full): a new QOS event.
+ * Returns: (transfer full) (nullable): a new QOS event.
*/
GstEvent *
gst_event_new_qos (GstQOSType type, gdouble proportion,
* #GST_QUERY_POSITION and update the playback segment current position with a
* #GST_SEEK_TYPE_SET to the desired position.
*
- * Returns: (transfer full): a new seek event.
+ * Returns: (transfer full) (nullable): a new seek event.
*/
GstEvent *
gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags,
g_return_val_if_fail (rate != 0.0, NULL);
+ /* SNAP flags only make sense in combination with the KEYUNIT flag. Warn
+ * and unset the SNAP flags if they're set without the KEYUNIT flag */
+ if (!(flags & GST_SEEK_FLAG_KEY_UNIT) &&
+ (flags & (GST_SEEK_FLAG_SNAP_BEFORE | GST_SEEK_FLAG_SNAP_AFTER |
+ GST_SEEK_FLAG_SNAP_NEAREST))) {
+ g_warning ("SNAP seeks only work in combination with the KEY_UNIT "
+ "flag, ignoring SNAP flags");
+ flags &=
+ ~(GST_SEEK_FLAG_SNAP_BEFORE | GST_SEEK_FLAG_SNAP_AFTER |
+ GST_SEEK_FLAG_SNAP_NEAREST);
+ }
+
if (format == GST_FORMAT_TIME) {
GST_CAT_INFO (GST_CAT_EVENT,
"creating seek rate %lf, format TIME, flags %d, "
* The @intermediate flag instructs the pipeline that this step operation is
* part of a larger step operation.
*
- * Returns: (transfer full): a new #GstEvent
+ * Returns: (transfer full) (nullable): a new #GstEvent
*/
GstEvent *
gst_event_new_step (GstFormat format, guint64 amount, gdouble rate,
/**
* gst_event_parse_stream:
* @event: a stream-start event
- * @stream: (out) (transfer full): adress of variable to store the stream
+ * @stream: (out) (transfer full): address of variable to store the stream
*
* Parse a stream-start @event and extract the #GstStream from it.
*
* string uniquely identifying a content protection system.
* @data: (out) (allow-none) (transfer none): pointer to store a #GstBuffer
* holding protection system specific information.
- * @origin: (allow-none) (transfer none): pointer to store a value that
+ * @origin: (out) (allow-none) (transfer none): pointer to store a value that
* indicates where the protection information carried by @event was extracted
* from.
*