Gstreamer Segment Event Problem

Sujata Gaddemane gsujata at gmail.com
Tue Jan 5 23:15:27 PST 2016


Hi,

Given a video file, I am trying to play the video from a given start time
to a given end time.
I am trying to achieve this using *Segment Event* as follows:

1. Firstly, I am creating and initialising a segment.
2. Created a segment event using *gst_event_new_segment()*
3. Send the segment event to the pipeline using *gst_element_send_event()*

But, The video just plays from the beginning and not from the start time.
The segment event does not have an effect on the playback eventhough the
event is reaching the sink element of the pipeline (verified by gst debug
messages).

Following is the code-snippet:

    GstSegment *gstSegment;
    GstEvent *event_seg;

    gstSegment = gst_segment_new();
    gst_segment_init( gstSegment, GST_FORMAT_BYTES );
    gstSegment->rate  = 2.0;
    gstSegment->start = 10 * 1920 * 1080 * 2;
    gstSegment->stop = 20 * 1920 * 1080 * 2;

    event_seg =  gst_event_new_segment(gstSegment);

    ret = gst_element_set_state (data.videoPipeline, GST_STATE_PLAYING);
    if (ret == GST_STATE_CHANGE_FAILURE) {
        printf("Unable to set the pipeline to the playing state\n");
        gst_object_unref (data.videoPipeline);
        return 1;
    }

    if ( !gst_element_send_event( GST_ELEMENT (data.videoPipeline),
event_seg))
      printf("Error");

If I use, SEEK event it works fine, but Segment event does not.  How does
SEGMENT event differ from SEEK event?

Thanks in advance.

-- 

Regards,
Sujata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160106/a9456ab5/attachment.html>


More information about the gstreamer-devel mailing list