Segment seek problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Segment seek problem

Mikl
Hello,

I have difficulties in playback of segment.
It is freezing:
-sometimes in a moment of sending seek event
-sometimes in a middle of gst_app_sink_pull_preroll loop
-sometimes on try of start next segment

My code:
///this is done once on file open/
        //creation and linking elements of pipeline
        InitPipeline();

        //start pipeline prerolling: all "sometimes pads" will be connected in
pad-added call back function
        gst_element_set_state(pipeline, GST_STATE_PAUSED);

        //wait for GST_MESSAGE_ASYNC_DONE on a bus
        WaitForPipelineReady();
///this is done once on file open/

///this is done for every segment/
//my example is
http://gstreamer-devel.966125.n4.nabble.com/Loop-player-for-GStreamer-td4671773.html

        //move to first frame
        gst_element_seek(
                pipeline,
                1,
                GST_FORMAT_TIME,
                (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT),
                GST_SEEK_TYPE_SET,
                segmentStart,
                GST_SEEK_TYPE_END,
                0);

        ///wait for GST_MESSAGE_SEGMENT_DONE, but i have GST_MESSAGE_ASYNC_DONE
        WaitForPipelineReady();

        //seek segment
        gst_element_seek(
                pipeline,
                1,
                GST_FORMAT_TIME,
                GST_SEEK_FLAG_SEGMENT,
                GST_SEEK_TYPE_SET,
                segmentStart,
                GST_SEEK_TYPE_SET,
                segmentEnd);

        //start playback pipeline
        gst_element_set_state(pipeline, GST_STATE_PLAYING);

        //wait for pipeline start playback
        while (GetElementState(_pipeline) != GST_STATE_PLAYING)
                QThread::msleep(1);

        for (unsigned long long i = 0; i != frames; i++)
                gst_app_sink_pull_sample((GstAppSink*)sink);
///this is done for every segment/

What i am doing wrong?
Mikl



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel