Why are all my seek events ignored?

Duncan Palmer dpalmer at digisoft.tv
Sun Feb 15 20:06:09 PST 2015


I'd say there's something else wrong there. You can certainly send a seek
event to set the position whilst the pipeline is PLAYING, and I can't see
why changing the speed should make any difference.

On 16 February 2015 at 13:42, Nikos Chantziaras <realnc at gmail.com> wrote:

> On 13/02/15 23:17, Nikos Chantziaras wrote:
>
>> I'm trying to send a seek event to a pipeline to make the video play at
>> half speed with:
>>
>>    QGst::SeekEventPtr seekEv = QGst::SeekEvent::create(
>>      0.5,
>>      QGst::FormatTime,
>>      QGst::SeekFlagSegment,
>>      QGst::SeekTypeSet, 0,
>>      QGst::SeekTypeEnd, 0);
>>
>>    pipeline->sendEvent(seekEv);
>>    pipeline->setState(QGst::StatePlaying);
>>
>> But it gets ignored. The video plays at 100% speed. In fact, my bus
>> message handler doesn't even receive a single QGst::MessageSegmentDone
>> message.
>>
>
> OK, figured it out. For anyone who comes across the same problem, it is
> crucial to:
>
>   a. Set the SeekFlagFlush flag on the event
>   b. Put the pipeline into the paused state before sending the event
>   c. Wait for the state change to complete before sending the event
>
> Although not crucial, using SeekTypeNone for the stop type and
> GST_CLOCK_TIME_NONE for the stop time seems to be a good idea.
>
> So:
>
>   QGst::SeekEventPtr seekEv = QGst::SeekEvent::create(
>       0.5,
>       QGst::FormatTime,
>       QGst::SeekFlagFlush,
>       QGst::SeekTypeSet, 0,
>       QGst::SeekTypeNone, GST_CLOCK_TIME_NONE);
>
>   pipeline->setState(QGst::StatePaused);
>   pipeline->getState(0, 0, GST_CLOCK_TIME_NONE); // wait for pause state
>   pipeline->sendEvent(seekEv);
>   pipeline->setState(QGst::StatePlaying);
>
> This worked correctly.
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150216/1f602295/attachment.html>


More information about the gstreamer-devel mailing list