playbin2, gst_element_seek and http.

Kyrylo V Polezhaiev polezhaiev at ukr.net
Sat May 19 01:58:53 PDT 2012


Hello, I am using the following code in my browser plugin to set position in video:  

void OVIMediaPlayer::set_position(float percents)
{
    gint64 position, length;
    GstFormat format = GST_FORMAT_TIME;
    gst_element_query_duration (pipeline, &format, &length);
    position = static_cast<gint64>(length * (percents * 0.01));
    GstState state;
    gst_element_get_state(pipeline, &state, NULL, GST_CLOCK_TIME_NONE);
    gst_element_set_state(pipeline, GST_STATE_PAUSED);
    gst_element_seek(bin, 1.0, format, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
    gst_element_set_state(pipeline, state);
    return;
}

My pipeline contains playbin2 with directdraw video sink and plays video from http server. Server supports HTTP Range Headers. My function gets percents argument in range [0; 100] to set position of video. But after each call video begins from begging.




More information about the gstreamer-devel mailing list