Restarting a pipeline after EOS - "Internal data stream error"
I'm creating a program that can take photos, and I'm trying to achieve this by adding image encoder (plus auxillary elements, such as queues and tees) to a pipeline (that is normally responsible for displaying camera output) when the user requests a photo to be taken. The image encoders have their "snapshot"
property set to true
, so that when the photo is taken, the pipeline is restored to its previous state on EOS.
I've managed to successfully take photos, but the problem is that I can't restart the pipeline afterwards. I wrote sample code (attached) that illustrates my issue more clearly and shows exactly what I'm trying to do. I don't know whether this is a GStreamermm issue, but the equivalent Gstreamer code seems to work perfectly.
In the sample code, the problem occurs on line 190. To reach that line you will have to send SIGTERM
to the process. The program then just prints "Internal data stream error" and exits. Valgrind shows that an invalid read occurs on that line and setting GST_DEBUG=4
shows that somewhere around that line the program is trying to get static sink pad of element v4l2src
(which of course doesn't exist).