Rewind a pipeline

Jorge Fernandez Monteagudo jorgefm at cirsa.com
Mon May 20 06:41:28 PDT 2013


Answering myself I've seen using GST_DEBUG that the event is ignored. First I have to set the
pipeline in GST_STATE_PLAYING then send the seek event and now it works!

Sorry for disturbing the list!

________________________________________
From: gstreamer-devel-bounces+jorgefm=cirsa.com at lists.freedesktop.org [gstreamer-devel-bounces+jorgefm=cirsa.com at lists.freedesktop.org] On Behalf Of Jorge Fernandez Monteagudo [jorgefm at cirsa.com]
Sent: Monday, May 20, 2013 3:27 PM
To: gstreamer-devel at lists.freedesktop.org
Subject: Rewind a pipeline

Hi all!

Is it possible to reuse a pipeline? I would like to avoid creating and destroying a pipeline when I
want to have a video playing in a loop. How can I do that? When I try to send a seek event I
always get an error. The next code always print "Send seek event failed!"

    // Set the pipeline ready.
    ret = gst_element_set_state( pipeline, GST_STATE_READY );
    if( ret == GST_STATE_CHANGE_FAILURE ) {
      printf( "Failed to start up pipeline!\n" );
      done = 1;
      return;
    }

    // Seek the stream init.
    GstEvent *seek_event = NULL;

    seek_event = gst_event_new_seek( 1.0, GST_FORMAT_TIME,
                                     (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT),
                                     GST_SEEK_TYPE_SET, 0LL,
                                     GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
    if( gst_element_send_event( pipeline, seek_event ) == false ) {
      printf( "Send seek event failed!\n" );
      done = 1;
      return;
    }

Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o CONFIDENCIAL. Si no es vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.

This message is intended exclusively for its addressee and may contain information that is CONFIDENTIAL and protected by professional privilege.
If you are not the intended recipient you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited by law. If this message has been received in error, please immediately notify us via e-mail and delete it.
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list