Given that NVIDIA’s hardware-accelerated GStreamer elements use NVMM, is it safe to interleave them with GStreamer queues (such that the elements run in separate threads)?
For instance, is this thread-safe?
gst-launch-1.0 filesrc location=some_mjpeg_video.mkv ! nvjpegdec ! 'video/x-raw(memory:NVMM), format=I420' ! queue ! nvvidconv ! 'video/x-raw, format=I420' ! videoconverter ! 'video/x-raw, format=RGBx' ! xvimagesink
My worry is what happens between nvjpegdec and nvvidconv. Since they are using NVMM, the actual image data decoded from nvjpegdec is not in the ordinary GstBuffer. Does nvjpegdec ensure to allocate new blocks using NVMM, which are released only after nvvidconv is done using them, so that I don’t risk getting torn frames because of multithreading between nvjpegdec and nvvidconv? I’m worried that nvjpegdec just keeps writing to the same blocks and nvvidconv could read torn frames because it’s running in a separate thread.