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.