GstCollectPads: getting callbacks when a sinkpad's buffer has size 0.

Lei Miao leimiao09 at
Tue Apr 1 07:52:23 PDT 2014

Hi all,

I had a strange problem with GstCollectPads in both gst 0.10 and gst 1.0.
Basically, we have an element that has a collect pad with two sinks. The
beginning of the pipeline is as follows:

souphttpsrc1->queue->sink1 of the collect pad

souphttpsrc2->queue->sink2 of the collect pad

In this element, we use gst_collect_pads_set_function() to specify the
callback function. The code has been working well most of the time.
However, I sometimes notice that sink1 of the collect pad has a buffer of
length 0 when the call back function is called. This is really strange. The
reference manual says: "...this sets a callback that will be invoked
instead when all the pads added to the collection have buffers queued." My
understanding is that the callback function should only be called when both
sink pads have buffers queued. But in reality, we are getting callbacks
when one of the sink pads has zero length buffer.

To be specific, in the callback function, we first
use gst_pad_get_element_private() to get the private data of the sink pad.
We then get the buffer:
GstBuffer * buf = gst_collect_pads_read_buffer(data->collect, data, 1024);
GstMapInfo info;
gst_buffer_map (buf, &info, GST_MAP_READ);
int size = info.size;

"size" sometimes is zero.

Does anybody know why the callback function is called in this case?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list