Combining data from two chain_functions

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Combining data from two chain_functions

iron_guitarist1987
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
All your bases are belong to us.
Reply | Threaded
Open this post in threaded view
|

Re: Combining data from two chain_functions

Carlos Rafael Giani
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.
>


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Combining data from two chain_functions

iron_guitarist1987
Thanks for the response, dv. I tried adding queues to the sinks, and also tried adding curly brackets, but still only one of the chain functions is being called. Can it be a problem with the src elements? Do I need to add threads to the code, or should it be doing so automatically?
All your bases are belong to us.
Reply | Threaded
Open this post in threaded view
|

Re: Combining data from two chain_functions

iron_guitarist1987
I tried changing the gst_pad_push to the text chain function, but now the struct chain function runs once, and then I get a segmentation fault. Anyone have any ideas why aren't both chain functions running?
All your bases are belong to us.
Reply | Threaded
Open this post in threaded view
|

Re: Combining data from two chain_functions

iron_guitarist1987
Sorry for reviving such an old thread. The reason it wasn't working was that I had an error in one of the chain functions that I didn't see (kind of dumb). Anyways, how do I synchronize the inputs of the chain functions? Can I just do it inside the chain functions, or do I need a special sync function?
All your bases are belong to us.