Processing-intensiv element multithreading

Maurice Ackel maurice.ackel at students.uni-mannheim.de
Tue Aug 17 13:41:45 UTC 2021


Hi,

I am developing an element, which carries out a processing-intensive computation and hence is very slow (lets say 1s processing time). I have a 30fps source. Now obviously, if I would process every incoming buffer sequentially, I would end up with 1 frame per second. However, it should be possible to process incoming frames in parallel, leading to a 1s latency but still a 30fps frame rate. So far I have tried to start a new thread for every incoming buffer and directly returning GST_FLOW_OK in the chain function and it somewhat works. However, this can’t be a good solution since I simply ignore the GstFlowRetrun value from downstream when I call gst_pad_push after the processing… 

Has anyone done something like this before and has some code reference for how to achieve what I am trying? Is this even the right way to go or can this be done easier in a different way?

Thanks for your help!

Best
Maurice


More information about the gstreamer-devel mailing list