Seek operation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Seek operation

Sumanth V
Hi All,
       I am writing a application which dose a trickmode operation on the stored file. When i do PAUSE and then PLAY it resumes play from where i had PAUSED. But when i do seek forward by setting the rate to 2.0 / 4.0 FORWARD happens but when i press PLAY the play back dose not resume from where i pressed PLAY but instead starts playing from offset where i had selected to forward.
To play while forwarding i send this seek event.

gst_element_seek( pipeline, 1.0,GST_FORMAT_TIME ,GST_SEEK_FLAG_FLUSH ,
                                               GST_SEEK_TYPE_CUR, 0, GST_SEEK_TYPE_NONE, -1 );

Is this this the correct seek event format??

------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Seek operation

michael smith-6-3
On Wed, Dec 24, 2008 at 12:19 AM, Sumanth V <[hidden email]> wrote:

> Hi All,
>        I am writing a application which dose a trickmode operation on the
> stored file. When i do PAUSE and then PLAY it resumes play from where i had
> PAUSED. But when i do seek forward by setting the rate to 2.0 / 4.0 FORWARD
> happens but when i press PLAY the play back dose not resume from where i
> pressed PLAY but instead starts playing from offset where i had selected to
> forward.
> To play while forwarding i send this seek event.
>
> gst_element_seek( pipeline, 1.0,GST_FORMAT_TIME ,GST_SEEK_FLAG_FLUSH ,
>                                                GST_SEEK_TYPE_CUR, 0,
> GST_SEEK_TYPE_NONE, -1 );

That's because you're doing a flushing seek. Remove
GST_SEEK_FLAG_FLUSH to avoid flushing the pipeline.

Mike

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Seek operation

Eric Zhang-6
In reply to this post by Sumanth V
Hi, gstreamer-devel:

    Did your seek operation succeed? Which state do you seek the pipeline? PAUSED or PLAYING? Maybe you can describe your steps more clearly.

Eric Zhang

2008/12/24 Sumanth V <[hidden email]>
Hi All,
       I am writing a application which dose a trickmode operation on the stored file. When i do PAUSE and then PLAY it resumes play from where i had PAUSED. But when i do seek forward by setting the rate to 2.0 / 4.0 FORWARD happens but when i press PLAY the play back dose not resume from where i pressed PLAY but instead starts playing from offset where i had selected to forward.
To play while forwarding i send this seek event.

gst_element_seek( pipeline, 1.0,GST_FORMAT_TIME ,GST_SEEK_FLAG_FLUSH ,
                                               GST_SEEK_TYPE_CUR, 0, GST_SEEK_TYPE_NONE, -1 );

Is this this the correct seek event format??

------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Seek operation

Sumanth V
Thanks for your reply..

   When i want to do PAUSE operation i send
gst_element_set_state (pipeline, GST_STATE_PAUSED)..

when i want to do FORWARD operation i send the following seek event.
gst_element_set_state (pipeline, GST_STATE_PLAYING);
 RetVal = gst_element_seek( pipeline,4.0, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, 0, GST_SEEK_TYPE_NONE, -1 );

forward operation dose happen but it takes some time( after few seconds ). when in FORWARD
i PAUSE the operation by gst_element_set_state (pipeline, GST_STATE_PAUSED).

now i want to resume the play in normal speed i do the following:-

gst_element_set_state (pipeline, GST_STATE_PLAYING);
RetVal = gst_element_seek( pipeline, 1.0,GST_FORMAT_TIME ,  GST_SEEK_FLAG_NONE,GST_SEEK_TYPE_CUR, 0, GST_SEEK_TYPE_NONE, -1 );

but still it dose not resume the play from position where i had PAUSEd in FORWARD mode, but instead it resume the Play back from where i had pressed PAUSE before performing FORWARD operation.

is it the right way of performing the seek operation? previously i used to use the  GST_SEEK_FLAG_FLUSH, now i have removed it, but still its playing from the wrong offset.

Thanks.

On Thu, Dec 25, 2008 at 3:13 PM, Eric Zhang <[hidden email]> wrote:
Hi, gstreamer-devel:

    Did your seek operation succeed? Which state do you seek the pipeline? PAUSED or PLAYING? Maybe you can describe your steps more clearly.

Eric Zhang

2008/12/24 Sumanth V <[hidden email]>
Hi All,
       I am writing a application which dose a trickmode operation on the stored file. When i do PAUSE and then PLAY it resumes play from where i had PAUSED. But when i do seek forward by setting the rate to 2.0 / 4.0 FORWARD happens but when i press PLAY the play back dose not resume from where i pressed PLAY but instead starts playing from offset where i had selected to forward.
To play while forwarding i send this seek event.

gst_element_seek( pipeline, 1.0,GST_FORMAT_TIME ,GST_SEEK_FLAG_FLUSH ,
                                               GST_SEEK_TYPE_CUR, 0, GST_SEEK_TYPE_NONE, -1 );

Is this this the correct seek event format??

------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Seek operation

Eric Zhang-6
Hi, gstreamer-devel:
 
    Read the GstSeekType manual:
 
    GST_SEEK_TYPE_CUR -- change relative to currently configured segment. This can't be used to seek relative to the current playback position - do a position query, calculate the desired position and then do an absolute position seek instead if that's what you want to do.
 
    Got it? GST_SEEK_TYPE_CUR is not current playback position, it's currently configured segment. That's why your issue occurs.
Eric Zhang
 
2008/12/25 Sumanth V <[hidden email]>
Thanks for your reply..

   When i want to do PAUSE operation i send
gst_element_set_state (pipeline, GST_STATE_PAUSED)..

when i want to do FORWARD operation i send the following seek event.
gst_element_set_state (pipeline, GST_STATE_PLAYING);
 RetVal = gst_element_seek( pipeline,4.0, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, 0, GST_SEEK_TYPE_NONE, -1 );

forward operation dose happen but it takes some time( after few seconds ). when in FORWARD
i PAUSE the operation by gst_element_set_state (pipeline, GST_STATE_PAUSED).

now i want to resume the play in normal speed i do the following:-

gst_element_set_state (pipeline, GST_STATE_PLAYING);
RetVal = gst_element_seek( pipeline, 1.0,GST_FORMAT_TIME ,  GST_SEEK_FLAG_NONE,GST_SEEK_TYPE_CUR, 0, GST_SEEK_TYPE_NONE, -1 );

but still it dose not resume the play from position where i had PAUSEd in FORWARD mode, but instead it resume the Play back from where i had pressed PAUSE before performing FORWARD operation.

is it the right way of performing the seek operation? previously i used to use the  GST_SEEK_FLAG_FLUSH, now i have removed it, but still its playing from the wrong offset.

Thanks.


On Thu, Dec 25, 2008 at 3:13 PM, Eric Zhang <[hidden email]> wrote:
Hi, gstreamer-devel:

    Did your seek operation succeed? Which state do you seek the pipeline? PAUSED or PLAYING? Maybe you can describe your steps more clearly.

Eric Zhang

2008/12/24 Sumanth V <[hidden email]>
Hi All,
       I am writing a application which dose a trickmode operation on the stored file. When i do PAUSE and then PLAY it resumes play from where i had PAUSED. But when i do seek forward by setting the rate to 2.0 / 4.0 FORWARD happens but when i press PLAY the play back dose not resume from where i pressed PLAY but instead starts playing from offset where i had selected to forward.
To play while forwarding i send this seek event.

gst_element_seek( pipeline, 1.0,GST_FORMAT_TIME ,GST_SEEK_FLAG_FLUSH ,
                                               GST_SEEK_TYPE_CUR, 0, GST_SEEK_TYPE_NONE, -1 );

Is this this the correct seek event format??

------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel