Why are all my seek events ignored?
Nikos Chantziaras
realnc at gmail.com
Sun Feb 15 20:16:31 PST 2015
That doesn't work either. If I do:
pipeline->setState(QGst::StatePlaying);
pipeline->sendEvent(seekEv);
without waiting with a getState() first before sending the event, the
seek has no effect. I assume that due to all calls being asynchronous,
the state has not transitioned yet from StateNull to StatePlaying when
the event gets sent. But I don't know for sure, since I'm not familiar
with the gstreamer internals.
On 16/02/15 06:06, Duncan Palmer wrote:
> 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
> <mailto: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.
More information about the gstreamer-devel
mailing list