[gst-devel] question about gst_pad_query_duration()

Yue Li liyue99 at gmail.com
Wed Mar 5 05:14:22 CET 2008


Hi all

I'm making a demux element but got confused with the
gst_pad_query_duration() function.

The example code given in "11.2. Pads driving the pipeline" of "Plugin
Writer's Guide" is:
if (!gst_pad_query_duration (filter->sinkpad, &fmt, &len)) {
  GST_DEBUG_OBJECT (filter, "failed to query duration, pausing");
  goto stop;
}

But I found that in "Core Reference Manual" :
gst_pad_query_duration (GstPad *pad,
                                     GstFormat *format,
                                     gint64 *duration);
Queries a pad for the total stream duration.
pad :         a GstPad to invoke the duration query on.
Returns :   TRUE if the query could be performed.

So, it seems that the right code should be:
if (gst_pad_query_duration (GST_PAD_PEER(filter->sinkpad), &fmt, &len)) {
  GST_DEBUG_OBJECT (filter, "failed to query duration, pausing");
  goto stop;
}

Please help me to know if I got misunderstandings or there's mistake
in the guide.

Thanks a lot.
Yue Li




More information about the gstreamer-devel mailing list