gst_element_query returns NULL

Rossana Guerra guerra.rossana at gmail.com
Sat Feb 18 23:04:51 PST 2012


Hello everyone, I need to know the video duration (time), this is the code:

 gst_element_set_state (pipeline, GST_STATE_PLAYING);

  gdouble length = 0.0;
  gint64 value;

    query = gst_query_new_duration(GST_FORMAT_TIME);
    if (gst_element_query(pipeline, query)) {
        gst_query_parse_duration(query, NULL, &value);
        length = (gdouble)value / (gdouble)GST_SECOND;
    }

    cout << "duracion" << length << endl;

    gst_query_unref(query);

The fact is that length is 0 and value has set a diffetent value from the
actual duration time of the video.

Where I call this query and what variable "value" has a clueless value in
it?

Thanks and regards.

Rossana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120219/725d772d/attachment.htm>


More information about the gstreamer-devel mailing list