Take nvvidconv plugin as example.
Since no mem_copy is implemented in GstNvFilterMemoryAllocator, if a NV buffer is copied by gst_buffer_make_writable or gst_buffer_copy, then the default _fallback_mem_copy would be called.
The associated GstMemory of destination buffer would be allocated and initialized by default system memory allocator.
This would cause problems in some plugin like nvcompositor which will check memory type through ‘inmem->allocator->mem_type’.
Let me give some pipeline example.
// This pipeline works fine
gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=640,height=480,format=RGBA,framerate=30/1’ ! comp.sink_0 nvcompositor name=comp sink_0::width=1920 sink_0::height=1080 sink_0::xpos=0 sink_0::ypos=0 ! ‘video/x-raw(memory:NVMM),format=RGBA’ ! nvvidconv ! nv3dsink
// But if we add interpipesink and interpipesrc in between, we will see black screen with some noise points.
gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=640,height=480,format=RGBA,framerate=30/1’ ! interpipesink name=t forward-events=1 async=false sync=false interpipesrc is-live=1 format=time stream-sync=0 listen-to=t ! comp.sink_0 nvcompositor name=comp sink_0::width=1920 sink_0::height=1080 sink_0::xpos=0 sink_0::ypos=0 ! ‘video/x-raw(memory:NVMM),format=RGBA’ ! nvvidconv ! nv3dsink
Please advise how to fix such issue in NV plugins. Thanks.
(Implement a new mem_copy in nvvidconv ?)