Combining data from two chain_functions

dv dv at pseudoterminal.org
Thu Aug 2 15:21:45 PDT 2012


Both chain functions should get called. However, if the connected 
sources run in the same thread, then this may cause problems. For 
example, udpsrc elements create new threads. If two udpsrc elements are 
connected to two sinkpads of the same element, then both udpsrc elements 
in their respective threads will push buffers downstream, and the 
associated chain functions are called. Of course this also means that 
you have to take care of the synchronization inside your element - if 
both chain functions modify the same data, then you must use something 
like mutexes to make sure you don't get race conditions.

As for your pipeline, try using queue elements between the sinkpads and 
whatever you connected to the sinkpads.

> Hello all,
>
> I am creating a plugin that has two sinkpads with a chain_function each. The
> idea is that when a pad receives data, it will store it in a static variable
> in a function that is shared by both chain functions. The problem that I am
> having is that when I run the pipeline, only one of the chain functions is
> being called. In the code below, only the struct chain function is being
> called.
>
> Why is the text chain function not being called? I have created a src
> element plugins for text and the structure and tested them with a collect
> function, and they work.
>
>
> Another option would be to have only one chain function. Can it be possible
> to have just one chain function, even if the inputs are very different?
>
> Thank you.
>




More information about the gstreamer-devel mailing list