Segmentation fault when removing src or sink from the pipeline using "gst_bin_remove()"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Segmentation fault when removing src or sink from the pipeline using "gst_bin_remove()"

476 Views
dilna
Contributor II

Hi

we are trying to make a gstreamer application to switch between a compositor and single camera view. By switching between the pipelines in the program.

Each pipeline are prepared by factory making the gstreamer plugins like src(v4l2src), filter, sink(waylandsink) and linking them using gst_element_link_many function.

At the time of switching we are facing increase in file pointers(fd) corresponding to the gstreamer objects. We tried to handle it by removing the src and sink elements using the function shown below.
gst_bin_remove(GST_BIN (Compositor->pipeline), Compositor->src);
gst_bin_remove(GST_BIN (Compositor->pipeline), Compositor->sink);

And after removing these we will close the window and re open another for each view(that is new window for every switching closing the previous window)

But at that time we are facing random segmentation fault. When we tried to debug the same we found that the segmentation fault is caused by the gst_bus_set_sync_handler.

 

But if we are not trying to remove the src and sink the application will crash by hitting the fd limit. Can you suggest us a proper way to remove the src and sink from the pipeline.

 

Or can you suggest us the points to be noticed to properly handle the fd issue we are facing.

Tags (3)
0 Kudos
Reply
1 Reply

471 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @dilna 

I hope you are doing well.

One can try the concept of Dynamically changing the pipeline.

Please refer the Link.

Thanks & Regards

Sanket Parekh

0 Kudos
Reply