[gst-devel] Seek howto ?

Ronald S. Bultje R.S.Bultje at students.uu.nl
Thu Jun 24 16:50:02 CEST 2004


Hi,

On Thu, 2004-06-24 at 23:04, Giuliano Pochini wrote:
> I'm experimenting with gstreamer and variousaudio file formats. I have
> problems with seeking. The tutorial says nothing about it, so I tried to use
> the code in gst-plugins-0.8.1/examples/seeking. It works, but I cannot find
> a generic way to seek in any file. The example program builds a "seekable"
> list for each supported format. How can I know what is the element(s) I have
> to send the seek event to ?  Why the event has to be sent to the pads of
> some elements instead of the element itself ?

For a pipeline filesrc ! spider ! audiosink, do:

static gboolean
seek (guint64 ns)
{
  GstEvent *event;
  GstElement *audiosink = ..;

  event = gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_TIME,
      ns);
  return gst_element_send_event (audiosink, event);  
}

And yes, the application development manual needs work... ;).

Ronald





More information about the gstreamer-devel mailing list