GST_QUARK (CUR_TYPE), GST_TYPE_SEEK_TYPE, start_type,
GST_QUARK (CUR), G_TYPE_INT64, start,
GST_QUARK (STOP_TYPE), GST_TYPE_SEEK_TYPE, stop_type,
- GST_QUARK (STOP), G_TYPE_INT64, stop, NULL);
+ GST_QUARK (STOP), G_TYPE_INT64, stop,
+ GST_QUARK (TRICKMODE_INTERVAL), GST_TYPE_CLOCK_TIME, 0, NULL);
event = gst_event_new_custom (GST_EVENT_SEEK, structure);
return event;
}
/**
+ * gst_event_set_seek_trickmode_interval:
+ *
+ * Sets a trickmode interval on a (writable) seek event. Elements
+ * that support TRICKMODE_KEY_UNITS seeks SHOULD use this as the minimal
+ * interval between each frame they may output.
+ *
+ * Since: 1.16
+ */
+void
+gst_event_set_seek_trickmode_interval (GstEvent * event, GstClockTime interval)
+{
+ g_return_if_fail (event != NULL);
+ g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEEK);
+ g_return_if_fail (gst_event_is_writable (event));
+ g_return_if_fail (GST_CLOCK_TIME_IS_VALID (interval));
+
+ gst_structure_id_set (GST_EVENT_STRUCTURE (event),
+ GST_QUARK (TRICKMODE_INTERVAL), GST_TYPE_CLOCK_TIME, interval, NULL);
+}
+
+/**
+ * gst_event_parse_seek_trickmode_interval:
+ * @interval: (out)
+ *
+ * Retrieve the trickmode interval that may have been set on a
+ * seek event with gst_event_set_seek_trickmode_interval().
+ *
+ * Since: 1.16
+ */
+void
+gst_event_parse_seek_trickmode_interval (GstEvent * event,
+ GstClockTime * interval)
+{
+ g_return_if_fail (event != NULL);
+ g_return_if_fail (interval != NULL);
+ g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEEK);
+
+ gst_structure_id_get (GST_EVENT_STRUCTURE (event),
+ GST_QUARK (TRICKMODE_INTERVAL), GST_TYPE_CLOCK_TIME, interval, NULL);
+}
+
+/**
* gst_event_new_navigation:
* @structure: (transfer full): description of the event. The event will take
* ownership of the structure.
"GstMessageStreamsSelected", "GstMessageRedirect", "redirect-entry-locations",
"redirect-entry-taglists", "redirect-entry-structures",
"GstEventStreamGroupDone", "GstQueryBitrate", "nominal-bitrate",
- "GstMessageDeviceChanged", "device-changed"
+ "GstMessageDeviceChanged", "device-changed", "trickmode-interval",
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
GstSeekFlags flags;
GstSeekType start_type, stop_type;
gint64 start, stop;
+ GstClockTime trickmode_interval;
event = gst_event_new_seek (0.5, GST_FORMAT_BYTES,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
fail_unless (stop_type == GST_SEEK_TYPE_NONE);
fail_unless (stop == 0xdeadbeef);
+ gst_event_parse_seek_trickmode_interval (event, &trickmode_interval);
+ fail_unless_equals_uint64 (trickmode_interval, 0);
+
+ gst_event_set_seek_trickmode_interval (event, GST_SECOND);
+ gst_event_parse_seek_trickmode_interval (event, &trickmode_interval);
+ fail_unless_equals_uint64 (trickmode_interval, GST_SECOND);
+
+ gst_event_ref (event);
+ ASSERT_CRITICAL (gst_event_set_seek_trickmode_interval (event,
+ 2 * GST_SECOND));
+ gst_event_unref (event);
+
+ gst_event_unref (event);
+
+ event = gst_event_new_flush_start ();
+ ASSERT_CRITICAL (gst_event_set_seek_trickmode_interval (event, GST_SECOND));
gst_event_unref (event);
}