[gst-devel] problem while pushing data to multiple srcpads.

Wim Taymans wim at fluendo.com
Fri Feb 2 11:22:55 CET 2007


On Fri, 2007-02-02 at 10:02 +0530, Vinayak wrote:
> Hi all, 
> I am implementing the demuxer which will divide the input stream into
> multiple.
> I wrote a function for request_new_pad which creates a new srcpad
> new_from_template, now this one is associated with my element by
> "gst_element_add_pad". And after that I keep a pointers to alll such
> newly created srcpads. 
> 
Normally a demuxer will create dynamic pads, based on the contents of
the stream, instead of the app requesting pads.

You also need to activate the pads (when requested in >=PAUSED) before
adding them to the element so that they can be used for data passing.

> I'm using default handlers for event passing ( which apparently passes
> the down-stream events to all srcpads in that element) 
> 
> In my chain function: When I try to push data to first srcpad that
> fails..... it never returns and the next element never gets a pushed
> buffer.. may be its waiting for some events tobe passed down ? 
> Could it be a PreRolling issue ?
> 
> thanks in advance, 
> --vinayak 
> 
> Here is snappet of my code : 
> _request_new_pad() 
> {
>   MySplit *split= .....;
>   splitpad = gst_pad_new_from_template(templ, padname); 
>   GST_PAD_ELEMENT_PRIVATE (splitpad) = split;
>   gst_pad_use_fixed_caps (splitpad);
>   gst_pad_set_event_function(splitpad, gst_src_event);
>   .
>   .
>   gst_element_add_pad(element, splitpad);
>   srcpads[index++] = splitpad; 
> }
> 
> _chain_func(GstPad *pad, GstBuffer *buffer)
> {
> 
>   for(i=0; i < n_srcpads; i++) {
>    if(somecondition) { 
>       outbuf = gst_buffer_new();
>    } 
>    .
>    .
>   (!GST_PAD_PEER (srcpads[i])) 
>      return;
> 
>    gst_pad_push (srcpads[i], outbuf);
> }

The return value of _push should tell you about the reason for the
failure. You also need to pass this return value upstream (possibly
combining the return values of all pads).

Wim

> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list