API: add gst_element_seek_simple() (#342238).
authorTim-Philipp Müller <tim@centricular.net>
Fri, 19 May 2006 10:29:07 +0000 (10:29 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Fri, 19 May 2006 10:29:07 +0000 (10:29 +0000)
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* win32/common/libgstreamer.def:
* gst/gstutils.c: (gst_element_seek_simple):
* gst/gstutils.h:
API: add gst_element_seek_simple() (#342238).

ChangeLog
common
docs/gst/gstreamer-sections.txt
gst/gstutils.c
gst/gstutils.h
win32/common/libgstreamer.def

index 3f37f90..4321b37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-05-19  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * docs/gst/gstreamer-sections.txt:
+       * win32/common/libgstreamer.def:
+       * gst/gstutils.c: (gst_element_seek_simple):
+       * gst/gstutils.h:
+         API: add gst_element_seek_simple() (#342238).
+
 2006-05-18  Edward Hervey  <edward@fluendo.com>
 
        * gst/gsttypefind.c: (gst_type_find_get_type):
diff --git a/common b/common
index a5b6630..764c5f2 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit a5b66304e7abe1440a0f8b0ed232ffbc56e8f3de
+Subproject commit 764c5f25101d20da7f26942c36ba840ba65c63d7
index 28100d9..3dda58f 100644 (file)
@@ -501,6 +501,7 @@ gst_element_query_duration
 
 <SUBSECTION element-event>
 gst_element_send_event
+gst_element_seek_simple
 gst_element_seek
 
 <SUBSECTION Standard>
index 1a10fbf..bbc749c 100644 (file)
@@ -1917,6 +1917,40 @@ gst_element_query_convert (GstElement * element, GstFormat src_format,
 }
 
 /**
+ * gst_element_seek_simple
+ * @element: a #GstElement to seek on
+ * @format: a #GstFormat to execute the seek in, such as #GST_FORMAT_TIME
+ * @seek_flags: seek options
+ * @seek_pos: position to seek to (relative to the start); if you are doing
+ *            a seek in #GST_FORMAT_TIME this value is in nanoseconds -
+ *            multiply with #GST_SECOND to convert seconds to nanoseconds or
+ *            with #GST_MSECOND to convert milliseconds to nanoseconds.
+ *
+ * Simple API to perform a seek on the given element, meaning it just seeks
+ * to the given position relative to the start of the stream. For more complex
+ * operations like segment seeks (e.g. for looping) or changing the playback
+ * rate or seeking relative to the current position or seeking relative to
+ * the end of the stream you should use gst_element_seek ().
+ *
+ * Note that seeking is usually only possible in PAUSED or PLAYING state.
+ *
+ * Returns: TRUE if the seek operation succeeded (the seek
+ *          might not always be executed instantly though)
+ *
+ * Since: 0.10.7
+ */
+gboolean
+gst_element_seek_simple (GstElement * element, GstFormat format,
+    GstSeekFlags seek_flags, gint64 seek_pos)
+{
+  g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
+  g_return_val_if_fail (seek_pos >= 0, FALSE);
+
+  return gst_element_seek (element, 1.0, format, seek_flags,
+      GST_SEEK_TYPE_SET, seek_pos, GST_SEEK_TYPE_NONE, 0);
+}
+
+/**
  * gst_pad_can_link:
  * @srcpad: the source #GstPad to link.
  * @sinkpad: the sink #GstPad to link.
index 3d335e9..f2fc2dc 100644 (file)
@@ -533,6 +533,12 @@ void                    gst_element_unlink_pads         (GstElement *src, const
 gboolean               gst_element_link_pads_filtered  (GstElement * src, const gchar * srcpadname,
                                                          GstElement * dest, const gchar * destpadname,
                                                          GstCaps *filter);
+
+gboolean        gst_element_seek_simple (GstElement   *element,
+                                         GstFormat     format,
+                                         GstSeekFlags  seek_flags,
+                                         gint64        seek_pos);
+
 /* util elementfactory functions */
 gboolean               gst_element_factory_can_src_caps(GstElementFactory *factory, const GstCaps *caps);
 gboolean               gst_element_factory_can_sink_caps(GstElementFactory *factory, const GstCaps *caps);
index 1463d36..80b3c0a 100644 (file)
@@ -222,6 +222,7 @@ EXPORTS
        gst_element_remove_pad
        gst_element_requires_clock
        gst_element_seek
+       gst_element_seek_simple
        gst_element_send_event
        gst_element_set_base_time
        gst_element_set_bus