diff --git a/ChangeLog b/ChangeLog index 3f37f90c26..4321b37787 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-05-19 Tim-Philipp Müller + + * 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 * gst/gsttypefind.c: (gst_type_find_get_type): diff --git a/common b/common index a5b66304e7..764c5f2510 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit a5b66304e7abe1440a0f8b0ed232ffbc56e8f3de +Subproject commit 764c5f25101d20da7f26942c36ba840ba65c63d7 diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 28100d95af..3dda58f02b 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -501,6 +501,7 @@ gst_element_query_duration gst_element_send_event +gst_element_seek_simple gst_element_seek diff --git a/gst/gstutils.c b/gst/gstutils.c index 1a10fbff37..bbc749c99d 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -1916,6 +1916,40 @@ gst_element_query_convert (GstElement * element, GstFormat src_format, return ret; } +/** + * 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. diff --git a/gst/gstutils.h b/gst/gstutils.h index 3d335e94d3..f2fc2dcb9d 100644 --- a/gst/gstutils.h +++ b/gst/gstutils.h @@ -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); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 1463d36dba..80b3c0a467 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -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